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

can't source into workspace

asked 2017-07-03 18:34:30 -0500

garygao92 gravatar image

While I am reading different tutorials to create multiple workspaces, I notice that there are 2 ways to do it, either by catkin build or catkin_make.

By using catkin build, the procedures to create a workspace is:

  $source /opt/ros/indigo/setup.bash
  $ mkdir -p ~/catkin_ws/src
  $ cd ~/catkin_ws/src
  $ catkin_init_workspace
  $ cd ~/catkin_ws/
  $ catkin build
  $ source devel/setup.bash

  $ echo $ROS_PACKAGE_PATH
  > /opt/ros/indigo/share:/opt/ros/indigo/stacks

By using catkin_make, the procedure looks similar:

   $ source /opt/ros/indigo/setup.bash
   $ mkdir -p ~/catkin_ws2/src
   $ cd ~/catkin_ws2/
   $ catkin_make
   $ source devel/setup.bash

   $ echo $ROS_PACKAGE_PATH
   > /home/username/catkin_ws2/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks

I used above 2 methods to create 2 workspace: catkin_ws and catkin_ws2 independently. Then I check if the environment has been sourced correctly. The 1st workspace has not been sourced correctly while 2nd workspace has been sourced correctly. I would like to know where am I wrong and how to fix it.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-07-04 01:19:54 -0500

Hello,

according to wjwwood here : https://github.com/catkin/catkin_tool... , neither catkin_tool (catkin build) nor catkin_make set the ROS_PACKAGE_PATH.

And if i'm not wrong, catkin_tool build each package separatly, and each package should appear in your ROS_PACKAGE_PATH

Try adding some package in your catkin tools Workspace :

cd src/
catkin_create_pkg test1 roscpp
catkin_create_pkg test2 rospy
cd ..
catkin build
source devel/setup.bash
echo $ROS_PACKAGE_PATH
edit flag offensive delete link more

Comments

1

Thanks for replying. After adding a package and catkin build the workspace, the ROS_PACKAGE_PATH changes to the workspace's directory. However, it's very frustrating the way this works since I expect the build to overlay the default environment.

garygao92 gravatar image garygao92  ( 2017-07-04 01:22:08 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2017-07-03 18:34:30 -0500

Seen: 774 times

Last updated: Jul 04 '17