robotology / icub-models

Official URDF and SDF models of the iCub humanoid robot.
Creative Commons Attribution Share Alike 4.0 International
33 stars 34 forks source link

Load ICub model URDF files in CoppeliaSim #163

Closed diegomaureira closed 2 years ago

diegomaureira commented 2 years ago

Hello! I'm developing a project with CoppeliaSim and I need to import an iCub model into the simulator but I haven't been able to do it until now. In this link https://drive.google.com/drive/folders/1A-ZVaEDVDF36tMxV0H2BDwl_SRrDTlZx?usp=sharing I show you the error messages that I've received when I've tried to import the URDF model of iCub Gazebo v2.7. Has Anyone an idea about how to solve this? Thanks in advance.

traversaro commented 2 years ago

Hello @diegomaureira! First of all, it would be great if you could the error messages in text form, and that simplifies copy&pasting and finding similar error via search engines.

For what regards errors:

diegomaureira commented 2 years ago

Good Morning! I tried to follow the intructions to use the models and I defined the ROS_PACKAGE_PATH but It still doesn't work. Could you show me an example that how I have to do that please? In that context, I see another error message: "simExtURDF: error: neither mesh file 'iCub/meshes/simmechanics/sim_sea_2-5_r_elbow_prosup_prt-binary.stl' nor '' do exist". My currently configuration is: I have the models in /home/diego/icub-models Inside that folder I executed: mkdir build -> cd build -> cmake .. And finally, i defined: export YARP_DATA_DIRS=${YARP_DATA_DIRS}:/home/diego/icub-models/build/iCub export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/diego/icub-models/build

What is wrong? Many thanks for your answer!.

traversaro commented 2 years ago

I am not sure. In my system with ROS1, if I run:

(onlyros) traversaro@IITICUBLAP257:~/icub-models/build$ rospack find iCub

the output is:

/home/traversaro/icub-models/build/iCub

And then /home/traversaro/icub-models/build/iCub/meshes/simmechanics/sim_sea_2-5_r_elbow_prt-binary.stl is a valid mesh. Are you sure that you are launching CoppeliaSim in an environment in which ROS_PACKAGE_PATH contains /home/diego/icub-models/build ?

traversaro commented 2 years ago

I just checked how CoppeliaSim is finding meshes, and indeed it is via the rospack find iCub command (see https://github.com/CoppeliaRobotics/simExtURDF/blob/02410730000001633776478c5217d5c2ceb4558d/rospackagehelper.h#L11), so if that is not working on the command line then it will not work in CoppeliaSim.

diegomaureira commented 2 years ago

I could solve the problem! Many thanks!!

traversaro commented 2 years ago

Great! How did you solved? Just to avoid a situation like https://xkcd.com/979/ . :D

diegomaureira commented 2 years ago

Hello again!

  1. As you said: "rospack failed : This error seems to suggest that you did not defined the ROS_PACKAGE_PATH environment variable as described in the readme. This is probably the reason why you do not see meshes". I modify correctly ROS_PACKAGE_PATH and it works.
  2. Regard to error message: "simExtURDF: error: neither mesh file 'iCub/meshes/simmechanics/sim_sea_2-5_r_elbow_prosup_prt-binary.stl' nor '' do exist". I raised the same thread in the coppelia forum and the admin's answer solved my problem, here I put you the link of the thread: https://forum.coppeliarobotics.com/viewtopic.php?p=37707&hilit=icub#p37707

Cheers

traversaro commented 2 years ago

Great, thanks. If you think the issue is solved, feel free to close it.