robotology-playground / WBI-Toolbox

Simulink Toolbox for rapid prototyping of Whole Body Robot Controllers
2 stars 2 forks source link

Error when using the block: wholeBodyModel/Jacobians/Link Jacobian #88

Closed iron76 closed 3 years ago

iron76 commented 9 years ago

Description: The installation seems to work fine in general but the block wholeBodyModel/Jacobians/Link Jacobian is giving me the following error:

Error in port widths or dimensions. Output port 1 of 'untitled/Link Jacobian/Link Jacobian' 
is a one dimensional vector with 186 elements.

Further Information:

DanielePucci commented 9 years ago

This problem seems to be due to a dimension mismatch between ROBOT_DOF - a matlab variable that you should set in your workspace - with the length of the list associated to the WBI. The main point is that we still do not provide clear information when these sizes do not match (see #38 ). Anyway, further information can be found at https://github.com/robotology-playground/WBI-Toolbox#using-the-toolbox and https://github.com/robotology-playground/WBI-Toolbox#notes-on-configuration-files

jeljaik commented 9 years ago

This happens as @DanielePucci has pointed out when the variable ROBOT_DOF is defined to something different from the DOF of the corresponding list that you have defined for the current robot. To debug do the following:

  1. Check the configuration file of the WBI-Toolbox in $CODYCO_SUPERBUILD_DIR/install/codyco/contexts/wholeBodyInterfaceToolbox It should read something like this by default.
robot                  icubGazeboSim
localName         simulink
worldRefFrame  l_sole
robot_fixed         false
wbi_id_list          ROBOT_TORQUE_CONTROL_JOINTS
wbi_config_file   yarpWholeBodyInterface.ini

If you are using the simulator, then the value for robot is fine. With the last changes robot_fixed does not matter anymore and it will be deprecated soon. wbi_id_list is correct in this case if you want to control 25-DOF. If you are using one of the latest controllers this should be ROBOT_TORQUE_CONTROL_JOINTS_WITHOUT_PRONOSUP which correspond to a 23-DOF iCub. These lists names can be found in $CODYCO_SUPERBUILD_DIR/install/share/codyco/robots/icubGazeboSim

  1. Once the configuration of the toolbox is correct, make sure that you are either setting the environmental variable YARP_ROBOT_NAME in ./bashrc or from within Matlab (e.g. using setenv('YARP_ROBOT_NAME', 'icubGazeboSim') as I believe you're doing) to for example iCubGenova01 or icubGazeboSim. Depending on whether you use the real robot or the simulator.
  2. In Matlab your initialization script should define the following variables (assuming wbi_id_list = ROBOT_TORQUE_CONTROL_JOINTS_WITHOUT_PRONOSUP
ROBOT_DOF = 23;
localName = 'simulink';
robotName = 'icubGazeboSim';
Ts = 0.010;

If you are using the real robot instead remember this variable robotName corresponds to icub (not iCubGenova01). If ROBOT_DOF is 25, this means you should have wbi_id_list = ROBOT_TORQUE_CONTROL_JOINTS in the WBI-Toolbox configuration file as explained in 1.

Once you have checked all of this you're good to run the simulation.

jeljaik commented 9 years ago

@iron76 Can we close this? :)

DanielePucci commented 3 years ago

Probably yes. Closing :-) @jeljaik @iron76