Gepetto / example-robot-data

Set of robot URDFs for benchmarking and developed examples.
BSD 3-Clause "New" or "Revised" License
131 stars 48 forks source link

Can't acces example-robot-data path #196

Closed Remi-Tortue closed 7 months ago

Remi-Tortue commented 7 months ago

Hi I'm using ROS2 humble on Ubuntu 22.04, coding in python. I'm trying to implement Pinocchio example in my own ROS2 package but I am facing an issue: accessing example-robot-data path (for getting .urdf and .srfd). In the example join(dirname(dirname(str(abspath(__file__)))),"models") is used, but this does not work in other packages than Pinocchio. I've tried two installations:

For now I'm using the absolute path from openrobotics, but is there a better way to do it?

cmastalli commented 7 months ago

Hi @Remi-Tortue

This might be related to not defining the ROS_PACKAGE_PATH correctly. You need to include the install path of example-robot-data.

Remi-Tortue commented 7 months ago

Hi @cmastalli, Thank you for your response.

I already have export ROS_PACKAGE_PATH=/opt/openrobots/share:$ROS_PACKAGE_PATH export ROS_PACKAGE_PATH=/opt/openrobots/share/example-robot-data:$ROS_PACKAGE_PATH export ROS_PACKAGE_PATH=/opt/openrobots/include:$ROS_PACKAGE_PATH export ROS_PACKAGE_PATH=/opt/openrobots/include/example-robot-data:$ROS_PACKAGE_PATH in my bashrc. And I have source install/setup.bash. Should have I used another path?

cmastalli commented 7 months ago

Now, I understand your issue. This code is designed to work within Pinocchio.

If you want to use the Romeo humanoid robot, then do

import example_robot_data

romeo = example_robot_data.load("romeo")
print("this is the Pinocchio model", romeo.model)

Please next time try

  1. To understand the code on your own. This has nothing to do with Pinocchio or example-robot-data
  2. To create an issue in the right repository.

We are a small team with many responsibilities and I cannot answer each one's question. I hope you can understand this.