This Simulink model implements both control and dynamics simulation of a torque controlled humanoid robot. The joint torques references are calculated with a momentum-based controller, and used to estimate the system accelerations with forward dynamics. Then, forward dynamics is integrated inside Simulink.
The folder contains the Simulink model torqueControlBalancingSim.mdl
, which is generated by using Matlab R2017b.
Currently, supported robots are: iCubGazeboV2_5
.
In the current configuration, WBToolbox
blocks require to run yarpserver
on terminal, and to open Gazebo
and insert the iCubGazeboV2_5
model. This actions could be avoided by substituting all the WBToolbox
blocks with proper Matlab-Simulink functions. After opening Yarp and Gazebo, just run the Simulink controller to start.
At the moment, no visualization is provided. A way to visualize the robot is to use Gazebo, but the current YARP-Gazebo workflow does not allow to remove physics from the simulator, so the robot may fall down and fail in Gazebo even if according to Simulink the robot succeed to balance.
The contact switching
demo (YOGA
) can only perform switching from two feet to one foot balancing, as switching from one foot to two feet requires to trigger the instant the robot is touching the ground, but no contact model is simulated at the moment.
At start, the module calls the initialization file initTorqueControlBalancingSim.m. Once opened, this file contains some configuration variables. Please follow the instruction inside the script to properly configure your simulation.
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
.