-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from robotology/nunoguedelha-patch-1
- Update README (after #122) - Converted floating-base-balancing-torque-control-with-simulator into a package +floatingBaseBalancingTorqueControlWithSimulator - Added the package installation through CMake.
- Loading branch information
Showing
25 changed files
with
439 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
75 changes: 75 additions & 0 deletions
75
controllers/+floatingBaseBalancingTorqueControlWithSimulator/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
## Module description | ||
|
||
This module implements the same torque controller described in [floating-base-balancing-torque-control](../floating-base-balancing-torque-control/README.md), the block **"MOMENTUM BASED TORQUE CONTROL"**, but instead of controlling the real iCub robot or the model on Gazebo, it is integrated with the robot simulator from [matlab-whole-body-simulator](https://github.com/dic-iit/matlab-whole-body-simulator). | ||
|
||
<img src="/doc/pics/torqueControlwithSimu_w_SampleRates.png" width="1800"> | ||
|
||
In the above diagram, signals and blocks sampling times are identified by colors | ||
- red: 1 ms | ||
- pink: constant | ||
- green: 10 ms | ||
|
||
More precisely: | ||
- The controller **"MOMENTUM BASED TORQUE CONTROL"** feeds the joint torques to the robot dynamics simulator **"Robot Simulator"** through a memory block for avoiding algebraic loops. | ||
- The **"Robot Simulator"** simulates the robot dynamics, handling the contacts of the feet with the ground. This sub-system provides the inputs required by the controller: | ||
- joint positions | ||
- joint velocities | ||
- joint accelerations | ||
- left foot wrench | ||
- right foot wrench | ||
- IMU measurements | ||
- The **"Robot Visualizer"** allows to visualize the robot. It avoids using Gazebo as a visualizer. As a result, the overall procedure for running the simulation is simpler (no need to run Yarp nor Gazebo, nor synchronize them with Matlab). | ||
|
||
<img src="/doc/pics/robotSimulator_w_SampleRates.png" width="1800"> | ||
|
||
The **"Robot Simulator"** has its own **"Config"** block, for a robot configuration specific to the simulation, and is composed of three other blocks: | ||
- The **"RobotDynWithContacts"**, actual simulator core, simulates the robot dynamics and provides all the robot kinematic and dynamic quantities. | ||
- The **"IMU"** emulates the sensor outputs from the floating base state and linear acceleration. | ||
- The **"Friction Model"** block implements a simple viscous friction model, function of the joints velocities and desired torques. | ||
|
||
"RobotDynWithContacts", "IMU" and "RobotVisualizer" blocks are library blocks imported from [`matlab-whole-body-simulator`](https://github.com/dic-iit/matlab-whole-body-simulator). Their parameters are set through their respective masks. For further details on the "RobotDynWithContacts" configuration, refer to https://github.com/dic-iit/matlab-whole-body-simulator/blob/master/README.md. | ||
|
||
### Compatibility | ||
|
||
The folder contains the Simulink model `torqueControlBalancingWithSimu.mdl`, which is generated by using Matlab R2020b. | ||
|
||
### Supported robots | ||
|
||
Currently, the only supported robot model is `iCubGazeboV2_5` which has the proper inertia tuning (for the very small and light links within the shoulders, hips, etc). | ||
|
||
## Module details | ||
|
||
### How to run the demo | ||
|
||
You don't need any module external module running outside of Matlab. | ||
|
||
For running the simulation from the source module (for developpers wishing to perform any modification), follow the few steps below: | ||
1. Set the `YARP_ROBOT_NAME` environment variable to the desired model. The default and only currently supported model is `iCubGazeboV2_5`. There is no direct link with Gazebo. This model is suitable for the `matlab-whole-body-simulator` because of the modified inertia of the intermediate small and light links within the 3-DoF joints (shoulder pitch-roll-yaw, hip pitch-roll-yaw, etc), tuned for stabilising the dynamics of the simulation. | ||
``` | ||
> setenv(`YARP_ROBOT_NAME`,`iCubGazeboV2_5`) | ||
``` | ||
2. Verify that the target robot model is available. You can check if the controller is targeting the correct robot model by typing on the Matlab command line: | ||
``` | ||
system('yarp resource --find model.urdf') | ||
``` | ||
then, check that the path and the model name are correct. | ||
3. Change the working directory to the [parent folder of the controller model](./). | ||
4. Open the Simulink model `torqueControlBalancingWithSimu.mdl`. | ||
5. Run the model. | ||
For running the simulation from the installed module (e.g. in case of a user, without any experience in simulation nor control, just trying the simulator for the first time), skip steps 3. and 4. and execute instead: | ||
- still in Matlab, and from any location except from [whole-body-controllers/controllers](../) (for avoiding file naming collision with [this folder](./)), open the model directly from the Matlab command line: | ||
``` | ||
>> floatingBaseBalancingTorqueControlWithSimulator.torqueControlBalancingWithSimu | ||
``` | ||
### Configuration file | ||
At start, the module calls the initialization file `initTorqueControlBalancingWithSimu.m`. Once opened, this file contains some configuration variables. Please follow the instruction inside the script to properly configure your simulation. | ||
### Robot and demo specific configurations | ||
The gains and references for a specific robot (specified by the variable `YARP_ROBOT_NAME`) or a specific demo can be found in the folder `app/robots/YARP_ROBOT_NAME`. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.