6. Running the RobotSim demo with docker

We’ll use the docker images built in the previous tutorial to run the RobotSim example we ran earlier.

  1. All the commands mentioned in the instructions need to be run from the terminal in the brash_docker, e.g.

    $ cd ${HOME}/brash_docker
    
  2. Start the fsw service:

    $ docker compose -f docker-compose-dev.yml up fsw
    

    If you look at the docker compose file, you’ll see that this service runs the core-cpu2 , similarly as how we have done it in previous tutorials with cpu1 (core-cpu2 is set to run in a multihost setup).

  3. Start the rosgsw service :

    $ docker compose -f docker-compose-dev.yml up rosgsw
    

    If you look at the docker compose file, you’ll see that this service starts the cfe-ros2 bridge and sends a TO message back to cFE, starting the flow of data back to the ground.

  4. Start the novnc service to see ROS2 output:

    $ docker compose -f docker-compose-dev.yml up novnc
    

    This will start a “noVNC” server, which will show GUI applications. Open a browser and go to http://localhost:8080/vnc.html . After you press Connect, you should see a window where any GUI launched from the rosgsw or rosfsw machines will be accessible.

  5. Run in rosgsw all the ROS2 nodes - tracarm, rviz, rqt, joint_converter needed on the ground side:

    $ docker exec -it  brash_docker-rosgsw-1  bash
    $ ros2 launch brash_application_tools robot_sim_tracarm.launch.py
    
    docker_robosim_tracarm

    You can now give a shot at moving the slider in the Joint State Publisher and modify the value of joint3 . You’ll see the robot moving and the plot reflecting the change. The joint states are being calculated in the fsw side and being returned to the gsw side by using the BRASH bridge.

  6. Finally, if you want to see in a plot the value of the joint states on the fsw side, you can start the rosfsw service:

    $ docker compose -f docker-compose-dev.yml up rosfsw
    

    If you see the docker compose file, you’ll see that this service starts an instance of the SBN bridge. Finally, you can see the joint values on the flight side using rqt:

    $ docker exec -it  brash_docker-rosfsw-1  bash
    $ ros2 launch brash_application_tools flight_robot_sim_tracarm.launch.py
    

    Since this last RQT window is running in the flight side, you’ll see that the joint state updates appear faster, as they are being published at a higher rate in the flight side, whereas in th ground side, things are showing up at a 1Hz rate.