ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

rospack cannot find pure CMake package

asked 2022-02-01 14:54:05 -0600

Christian Rauch gravatar image

I am trying to use rospack find to get the path to a "pure cmake" (<build_type>cmake</build_type>) package, such as https://github.com/AprilRobotics/apri....

Even after installing the package.xml via install(FILES package.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/apriltag)(as suggested by https://answers.ros.org/question/2511...):

$ find . -name package.xml
./install/apriltag_ros/share/apriltag_ros/package.xml
./install/apriltag/share/apriltag/package.xml
./src/apriltag_ros/apriltag_ros/package.xml
./src/apriltag/package.xml
./src/apriltag/package.xml

the ROS_PACKAGE_PATH will still miss the apriltag package:

$ echo $ROS_PACKAGE_PATH
/home/christian/Development/apriltag_ws/install/apriltag_ros/share:/opt/ros/noetic/share

What do I have to do to populate ROS_PACKAGE_PATH with the paths automatically and to eventually make rospack find apriltag work?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-06-13 00:22:35 -0600

qilin_gundamenjoyer gravatar image

Make sure you created your package in $ROS_PACKAGE_PATH. After that, type rospack profile, then rospack find apriltag should work!. If it still doesn't work, I would always just default to remaking the catkin workspace by deleting and reinstalling it except for the /src file. After that, navigate to ~catkin_ws/devel to ensure that the setup.bash file is in fact present. Then, type nano ~./bash.rc to open the bash.rc file in the terminal and edit the source path, which is located at the bottom of the text file, with source [file path to setup.bash]. An alternative way is to type ctrl + h on your home folder to open all hidden files on your computer and open and edit the .bashrc file from. On a side note, I would recommend sourcing the environment with source devel_isolated/setup.bash instead of source devel/setup.bash if you are using a ROS1 Distro since it's more reliable in exchange for speed since it processes all packages sequentially. You can learn more about catkin_make vs catkin_make_isolated from Dirk Thomas & gvdhoorn's comment.

edit flag offensive delete link more

Comments

How can I create this in $ROS_PACKAGE_PATH? This points to a non-user-writeable location /opt/ros/noetic/share. You can try this yourself by creating a workspace with just the apriltag package. rospack profile doesn't help since it is only searching in $ROS_PACKAGE_PATH. But after sourcing a workspace, the $ROS_PACKAGE_PATH will only contain "ROS packages" and not the apriltag package.

Christian Rauch gravatar image Christian Rauch  ( 2022-09-16 08:44:32 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2022-02-01 14:54:05 -0600

Seen: 115 times

Last updated: Jun 13 '22