vvv-school / tutorial_impedance-control

Tutorial of an Whole-Body impedance controller using iDynTree and YARP
0 stars 2 forks source link

Issue in loading world into Gazebo #8

Open xela-95 opened 10 months ago

xela-95 commented 10 months ago

I'm trying to reproduce this tutorial by using a conda environment created in the following way:

mamba create -c conda-forge -c robotology -n yarp_tutorials_env  cmake ninja pkg-config make compilers yarp icub-contrib-common gazebo icub-models gazebo-yarp-plugins idyntree

I was able to compile and install.

I then started yarpserver and yarpmanager and from it I've launched the following applications:

Tutorial_on_Impedance_Control_system image

Tutorial_on_Impedance_Control image

This module is failing, maybe because icub is not loaded in Gazebo, probably an issue related to https://github.com/vvv-school/tutorial_gazebo-simple-model/issues/1.

I've noted that the gzserver parameters are -slibgazebo_yarp_clock.so icub_simple_fixed_world/icub_simple_fixed.world, hence yarp tries to load Gazebo with icub_simple_fixed_world/icub_simple_fixed.world but it is not able to find this world file.

We searched for it but we didn't find it too. Where is placed this file?

traversaro commented 10 months ago

This is related to https://github.com/robotology/robotology-superbuild/issues/1563 .

traversaro commented 10 months ago

This is related to robotology/robotology-superbuild#1563 .

Actually, this issue in particular is a bit more complicated. The icub_simple_fixed_world/icub_simple_fixed.world file is installed by https://github.com/robotology/icub-gazebo-wholebody, that is a project that we removed from the superbuild in 2021.02, see:

So, this repo would not work even if we use the robotology-superbuild from source, not only if you are using the conda packages.

traversaro commented 10 months ago

The world itself is quite basic (see https://github.com/robotology/icub-gazebo-wholebody/blob/master/worlds/icub_simple_fixed_world/icub_simple_fixed.world), so probably the easiest fix is to include and install it as part of this repo. However, also the model://icub_fixed_no_hands model it refers to is not installed anymore (it used to be part of icub-gazebo, package now removed from the superbuild, see https://github.com/robotology/robotology-superbuild/issues/542 and https://github.com/robotology/robotology-superbuild/pull/646).

So probably if we actually want to use this repo, we should:

xela-95 commented 10 months ago

The world itself is quite basic (see https://github.com/robotology/icub-gazebo-wholebody/blob/master/worlds/icub_simple_fixed_world/icub_simple_fixed.world), so probably the easiest fix is to include and install it as part of this repo. However, also the model://icub_fixed_no_hands model it refers to is not installed anymore (it used to be part of icub-gazebo, package now removed from the superbuild, see robotology/robotology-superbuild#542 and robotology/robotology-superbuild#646).

So probably if we actually want to use this repo, we should:

  • Copy the world in this repo, and update it to use SDF 1.7
  • Make it refer to a modern mantained model contained in icub-models or ergocub-software, such as model://iCubGazeboV2_5_fixed or a similar model from ergocub .

Just to summarize, this approach actually worked. The code is pushed in this branch of my fork of the tutorial: https://github.com/xela-95/tutorial_impedance-control/tree/fix-refs

Moreover in order to make Gazebo be able to find models and world files we added a bash script to add to Gazebo environment variables the folders in which models and world files are installed from the tutorial:

export GAZEBO_MODEL_PATH=${CONDA_PREFIX}/share/gazebo/models:${GAZEBO_MODEL_PATH}
export GAZEBO_RESOURCE_PATH=${CONDA_PREFIX}/share/gazebo/worlds:${GAZEBO_RESOURCE_PATH}

By placing it inside ${CONDA_PREFIX}/etc/conda/activate.d, the script will be activated automatically when activating the conda environment.