0
$\begingroup$

Rosanswers logo

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.


Originally posted by garygao92 on ROS Answers with karma: 17 on 2017-07-03

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hello,

according to wjwwood here : https://github.com/catkin/catkin_tools/issues/143 , 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

Originally posted by lmathieu with karma: 591 on 2017-07-04

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by garygao92 on 2017-07-04:
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.

$\endgroup$

Your Answer

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