Create/Initialize Catkin Workspace
-
First, source your ROS environment
source /opt/ros/melodic/setup.bash
-
Create catkin directories
mkdir -p ~/catkin_ws/src
-
Initialize catkin workspace
cd ~/catkin_ws catkin_make
New environment can be sourced by running
source ~/catkin_ws/devel/setup.bash
Update forked repository using git rebase
To be able to make a pull request to an open source project, one might need to update the forked repository. This can be done using git rebase
using the following steps:
-
Add the remote original repo as upstream to your local repo
git remote add upstream <original repo>
-
Fetch all the branches from the remote upstream
git fetch upstream
-
Rebase local master with upstream’s master
git rebase upstream/master
-
Update your forked repository master by pushing the rebased branch
git push origin master
Set environment variable for ROS package
An environment variable for a specific ROS package can be set in the package’s launch file.
Simply add the <env>
tag within the <launch>
tags.
#file: package_1_launch_file.luanch
<launch>
<env name="KEY" value="10" />
<node pkg="package_1" type="main.py" name="ros_package_1" args="-v">
</node>
</launch>