-
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.
Update with w.r.t. changes from after #122.
- Loading branch information
1 parent
c217f05
commit 374e9c8
Showing
7 changed files
with
408 additions
and
353 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
54 changes: 46 additions & 8 deletions
54
controllers/floating-base-balancing-torque-control-with-simulator/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 |
---|---|---|
@@ -1,29 +1,67 @@ | ||
## Module description | ||
|
||
This module implements a torque control balancing strategy. It computes the interaction forces at the feet in order to stabilise a desired `centroidal momentum` dynamics, which implies the tracking of a desired center-of-mass trajectory. A cost function penalizing high joint torques - that generate the feet forces - is added to the control framework. | ||
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/torqueControl.png" width="1800"> | ||
<img src="/doc/pics/torqueControlwithSimu_w_SampleRates.png" width="1800"> | ||
|
||
For details see also: [iCub whole-body control through force regulation on rigid non-coplanar contacts](http://journal.frontiersin.org/article/10.3389/frobt.2015.00006/abstract) and [Stability Analysis and Design of Momentum-Based Controllers for Humanoid Robots](https://ieeexplore.ieee.org/document/7759126). | ||
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 `torqueControlBalancing.mdl`, which is generated by using Matlab R2017b. | ||
The folder contains the Simulink model `torqueControlBalancingWithSimu.mdl`, which is generated by using Matlab R2020b. | ||
|
||
### Supported robots | ||
|
||
Currently, supported robots are: `iCubGenova04`, `iCubGenova02`, `icubGazeboSim`, `iCubGazeboV2_5`. | ||
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 | ||
|
||
For information on how to use the controllers both in **simulation** and with the **real robot**, please refer to the **wiki** of the repo. | ||
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 a terminal: | ||
``` | ||
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. | ||
### Configuration file | ||
At start, the module calls the initialization file initTorqueControlBalancing.m. Once opened, this file contains some configuration variables. Please follow the instruction inside the script to properly configure your simulation. | ||
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`. | ||
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`. |
Oops, something went wrong.