Running remote screen with ROS

less than 1 minute read

Published:

This post is about how to run remote screen(s) with ROS.

The correct syntax for launching a remote screen running a ROS script / program is the following:

screen -S screen_name -dm bash -c "source /opt/ros/kinetic/setup.bash && source ~/catkin_workspace/devel/setup.bash && roslaunch ros_launch_file.launch"

This command will create a screen called screen_name and run the required launch file.

:bangbang: Note that you need to source your ROS path for every screen you want to run!

Example:
  1. Run your launch file in a 1st screen:
    screen -S screen_name -dm bash -c "source /opt/ros/kinetic/setup.bash && source ~/catkin_workspace/devel/setup.bash && roslaunch ros_launch_file.launch"
    
  2. Record topics int the ros_bags directory in a 2nd screen:
    screen -S recording_data -dm bash -c "source /opt/ros/kinetic/setup.bash && source ~/catkin_workspace/devel/setup.bash && cd ~/ros_bags && rosbag record /topics"