Ask Your Question
0

rosrun/roscd not recognising correct folder/project path

asked 2019-08-16 15:00:10 -0500

ambareesh gravatar image

updated 2019-08-16 21:35:35 -0500

I made an executable python script for the nodes, and saved it at the location: /home/florian/catkin_build_ws/src/dlc_project/scripts

  1. I have made it executable with chmod +x
  2. I have the shebang line on top

But when I type:

roscd dlc_project

I find myself at : /home/florian/catkin_build_ws/install/share/dlc_project, instead of the dlc_project I need (inside ../src/..) Why does this happen? Any way to change this back to recognise the correct dlc_project folder.

Other details: I use catkin build (instead of catkin_make), Using Python3 + ROS Melodic + Ubuntu 18.04

Thank you!

P.S:

echo $ROS_PACKAGE_PATH /home/florian/catkin_build_ws/install/share:/home/florian/catkin_ws/src:/opt/ros/melodic/share

The reason I'm sourcing from /install is because I want to use ROS1+Python3+Cv_bridge and I am following the accepted answer here : SO answer

The line: source install/setup.bash --extend, is probably causing this. But I need to do that so that the Cv bridge built with Python3 is added to the environment. After this, how do I ensure that my project is recognized by ROS as a ROS package?

edit retag flag offensive close merge delete

Comments

Have you sourced your workspace?

rmv24 gravatar imagermv24 ( 2019-08-16 15:39:00 -0500 )edit

please post the output of echo $ROS_PACKAGE_PATH

ct2034 gravatar imagect2034 ( 2019-08-16 15:53:33 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-08-16 16:05:00 -0500

ksb gravatar image

Instead of sourcing the setup from /install. Source from /devel (source devel/setup.bash). Then roscd should take you to proper directory.

edit flag offensive delete link more

Comments

P.S:

echo $ROS_PACKAGE_PATH /home/florian/catkin_build_ws/install/share:/home/florian/catkin_ws/src:/opt/ros/melodic/share

The reason I'm sourcing from /install is because I want to use ROS1+Python3+Cv_bridge and I am following the accepted answer here : SO answer

The line: source install/setup.bash --extend, is probably causing this. But I need to do that so that the Cv bridge built with Python3 is added to the environment. After this, how do I ensure that my project is recognized by ROS as a ROS package?

ambareesh gravatar imageambareesh ( 2019-08-19 12:49:21 -0500 )edit
1

So it is either or case where you can either use the install space or the development space. So as you are using install space, you will end up /home/florian/catkin_build_ws/install/share/dlc_project here after roscd which is not incorrect. https://github.com/catkin/catkin_tool... This is a link to a similar issue that you can read up.

ksb gravatar imageksb ( 2019-08-21 11:21:22 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-08-16 15:00:10 -0500

Seen: 26 times

Last updated: Aug 16