.. _brash_docker_mars_rover_demo: Running the Mars rover Demo with docker ######################################## In this tutorial, we'll use the space-ros Curiosity rover. We'll use the same cFS application we have used previously (rover_app), with the only difference being the odometry and twist topics being used, as they have different names for the Husky rover and Curiosity. To follow this tutorial, you have to build docker images of BRASH with SpaceROS (see tutorial: :ref:`brash_docker_spaceros` ). Instructions ============= 1. Run the services :code:`fsw` , :code:`rosgsw`, :code:`rosfsw` and :code:`novnc` : .. code-block:: bash $ cd ${HOME}/brash_demonstrations $ docker compose -f docker-compose-dev.yml up fsw rosgsw rosfsw novnc They do the following: * *fsw* : Start cFS in the spacecraft machine. * *rosgsw* : Start the cFS-ROS2 bridge in the ground machine. It also sent a TO request. * *rosfsw* : Start the cFS-SBN bridge in the flight machine. * *novnc* : Start the noVNC server to show GUI applications. 2. 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 :code:`rosgsw` or :code:`rosfsw` machines will be accessible. 3. Open a terminal in the :code:`rosgsw` container and start the GUI tools to send commands to the robots: .. code-block:: bash $ docker exec -it brash_demonstrations-rosgsw-1 bash $ ros2 launch brash_application_tools ground_mars_rover.launch.py .. figure:: _static/rover_demo_rosgsw.png :width: 800px :alt: Rover demo - Groundsystem :align: center You'll see an Rviz window, where you'll see the odometry information returned by the bridge. There should also be an Rqt window which you'll use to send twist commands to the remote rover in the flightsystem side. #. Finally, we need to start the Rover on the flightside: .. code-block:: bash $ docker exec -it brash_demonstrations-rosfsw-1 bash $ ros2 launch brash_application_tools flight_mars_rover.launch.py You'll see something like this in the browser: .. figure:: _static/docker_mars_rover_novnc.png :width: 800px :alt: Mars rover in gazebo :align: center #. That is it for setup, now you can command the robot. Using the rqt interface, send twist commands. As you might remember, the rqt and rviz interfaces are running in **rosgsw** (ground). You'll see the rover moving around in gazebo, on **rosfsw** (flight side). The commands and odometry are flowing back and forth using the BRASH bridges. The video below shows an example run: .. youtube:: L1kCyaW30MI :width: 640 :height: 480