Gepetto/example-robot-data

Can't acces example-robot-data path

Closed this issue · 3 comments

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:

  • The one from Debian using openrobotics, but then example-robot-data is in /opt/openrobots/share/example-robot-data and I haven't found a way to access it other than using the absolute path.
  • The recommended one by cloning the repo in my workspace, but after the usual colcon build, example-robot-data is in the install directory, but isn't found by nether ros2 pkg prefix or get_package_share_directory.

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

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.

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?

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.