ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
After you build a ROS2 workspace, you have to add some directories to your path in order to being able to run the nodes or to build other packages which depend on something in the just built workspace.
Both scripts can be used to setup the environment, but their effect is slightly different.
local_setup.*
will add to the path only the directories built in the current workspacesetup.*
will add to the path the directories built in the current workspace AND the directories of the packages that were sourced while building the current workspace. This last operation will be done by sourcing the local_setup.*
files for those workspaces.Some examples:
If you want to source the ROS2 SDK, the two scripts will have the same effect as there are no workspaces which are on top of the current one.
I create a workspace for my new package. In order to build it I have to source the ROS2 SDK.
When I will run something from this package I will have two options for setting up the environment: I can source setup.*
OR I can source /opt/ros2/bouncy/setup.*
and source local_setup.*
You can find some information here