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

How to source setup.bash with catkin build?

asked 2019-03-03 05:02:49 -0500

Billion gravatar image

updated 2019-03-03 07:52:37 -0500

Hi, I'm having some problems with catkin build for my workspace. I've followed the next steps:

  1. $ mkdir -p ~/catkin_tools_ws/src
  2. $ source /opt/ros/melodic/setup.bash
  3. $ cd ~/catkin_tools_ws
  4. $ catkin init
  5. $ catkin build
  6. $ source ~/catkin_tools_ws/devel/setup.bash

It builds correctly without errors or warnings, but if I type 'roscd' it sends me to /opt/ros/melodic and not to my workspace.

The weird thing is that if i create the workspace with catkin_make, it works perfectly.

Thanks for your time

edit retag flag offensive close merge delete

Comments

Are those really all the steps you do?

Because if you haven't source /opt/ros/melodic/setup.bash before step 2, catkin init should complain about "not extend[ing] any other result space", which woud lead to what you describe.

gvdhoorn gravatar image gvdhoorn  ( 2019-03-03 05:47:26 -0500 )edit

Hi gvdhoorn, yes I did it but i forgot to add it in the description. However when i source the setup.bash of my workspace, ROS_PACKAGE_PATH continues to be only '/opt/ros/melodic/share'...

Billion gravatar image Billion  ( 2019-03-03 06:27:18 -0500 )edit

re: ROS_PACKAGE_PATH: I would say that is normal, as you have no packages in your workspace as far as I can tell.

If you want more specific help, edit your original question to show us the exact steps you take when initialising and building your workspace.

gvdhoorn gravatar image gvdhoorn  ( 2019-03-03 07:18:24 -0500 )edit

Thanks to you for your time :)

Billion gravatar image Billion  ( 2019-03-03 07:53:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-03-03 07:50:24 -0500

gvdhoorn gravatar image

Thanks for the update, but just making sure: I don't see a cd ~/catkin_tools_ws anywhere. Without that catkin init runs in the CWD, which I doubt is what you did/wanted.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2019-03-03 05:02:49 -0500

Seen: 1,785 times

Last updated: Mar 03 '19