Skip to main content

Setting up the Environment

You will likely need multiple terminals running to see everything you are wanting to monitor. To do this you can either run tmux outside of the docker with multiple sessions, or multiple terminal windows that are executing the rosbag_container bash. Whichever method you use, you will need to ensure the rosbag_container container is already running.

Start a ROSCORE Instance

You will need roscore running to perform any playback of data stored in bags. The best approach that I've found so far is to start roscore in a tmux session so that it is persistent without needing to always have a roscore terminal running. 

Check to see if the roscore tmux session already exists

tmux list-sessions

You should get a list of current tmux sessions.

rkitect@gibsonhh:~$ tmux list-sessions
invokewebai: 1 windows (created Wed Oct 16 09:56:34 2024)
rkitect@gibsonhh:~$

If roscore isn't listed, then continue. If it is listed, then roscore should be running already.

Start a new tmux session title roscore

tmux new -t roscore

Bash into the rosbag_container docker instance

rkitect@gibsonhh:~$ docker exec -it rosbag_container bash
root@03efcb8f4879:/#

Source the ROS environment

root@03efcb8f4879:/# source /opt/ros/noetic/setup.bash

Run ROSCORE

root@03efcb8f4879:/# roscore
... logging to /root/.ros/log/179ffe12-8f26-11ef-988c-0242ac1c0002/roslaunch-03efcb8f4879-255.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://03efcb8f4879:44425/
ros_comm version 1.17.0


SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.17.0

NODES

auto-starting new master
process[master]: started with pid [263]
ROS_MASTER_URI=http://03efcb8f4879:11311/

setting /run_id to 179ffe12-8f26-11ef-988c-0242ac1c0002
process[rosout-1]: started with pid [273]
started core service [/rosout]

You can leave this up if you want to observe, or you can exit it by typing Ctrl+B. The tmux session will remain running. You can verify this by using tmux list-sessions

rkitect@gibsonhh:~$ tmux list-sessions
invokewebai: 1 windows (created Wed Oct 16 09:56:34 2024)
roscore-5: 1 windows (created Sun Oct 20 15:57:43 2024) (group roscore)
rkitect@gibsonhh:~$

If you want to reattach the roscore session you can use

rkitect@gibsonhh:~$ tmux a -t roscore

New Sessions

To start new sessions for running ROS commands or viewing output, use one of the following methods. 

TMUX

tmux new -t rosdocker1

Multi-Terminal

In each new terminal window, execute bash for the rosbag_container contrainer

docker exec -it rosbag_container bash