19.2.7. Update Catkin Workspace
If you want to update already existing packages in the /ros_catkin_ws
, you have to update the .rosinstall
file and merge it with your current workspace with wstool
.
Attention
We assume here that you haven’t added any new ROS packages by following the Install ROS Packages guide. If you have, these won’t be updated by following these steps.
Change directory
cd ~/ros_catkin_ws
Update your
.rosinstall
fileFirst, move your existing rosinstall file (assuming
noetic-ros_comm-perception-wet.rosinstall
) so that it doesn’t get overwritten:mv -i noetic-ros_comm-perception-wet.rosinstall noetic-ros_comm-perception-wet.rosinstall.old
Generate new rosinstall file with same, but updated packages:
rosinstall_generator ros_comm perception --rosdistro noetic --deps --wet-only --tar > noetic-ros_comm-perception-wet.rosinstall
You can compare the new rosinstall file to the old version to see which packages will be updated:
diff -u noetic-ros_comm-perception-wet.rosinstall noetic-ros_comm-perception-wet.rosinstall.old
Merge
wstool merge -t src noetic-ros_comm-perception-wet.rosinstall
Update
wstool update -t src
Build
sudo catkin build --cmake-args -DCMAKE_BUILD_TYPE=Release