0
$\begingroup$

Rosanswers logo

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?


Originally posted by ambareesh on ROS Answers with karma: 25 on 2019-08-16

Post score: 0


Original comments

Comment by rmv24 on 2019-08-16:
Have you sourced your workspace?

Comment by ct2034 on 2019-08-16:
please post the output of echo $ROS_PACKAGE_PATH

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by ksb with karma: 36 on 2019-08-16

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by ambareesh on 2019-08-19:
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?

Comment by ksb on 2019-08-21:
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_tools/issues/441 This is a link to a similar issue that you can read up.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.