Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NASA Challenge_[@damianphim]_[Update Documentation] (closes #34) #37

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion source/Demos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Demos
=====

There are currently two Space ROS demonstration applications.
The first demo uses `MoveIt2 <https://moveit.ros.org/>`_ and a model of the `Canadarm manipulator <https://en.wikipedia.org/wiki/Canadarm>`_ along with the Space ROS base image.
Both demos uses the `MoveIt2 <https://moveit.ros.org/>`_ docker image. The Canadarm demo uses a model of the `Canadarm manipulator <https://en.wikipedia.org/wiki/Canadarm>`_ along with the Space ROS base image.
In this demo, MoveIt2 is used to plan the motion for the Canadarm, which is running in simulation.
The second demo shows the `Mars Curiosity rover <https://mars.nasa.gov/msl/home/>`_ in simulation, presenting multiple ROS 2 services to allow the user to directly control the rover.
The following pages go into detail to show you how to run these demo applications.
Expand All @@ -11,5 +11,6 @@ The following pages go into detail to show you how to run these demo application
:titlesonly:
:maxdepth: 2

Demos/MoveIt2
Demos/Canadarm
Demos/Mars-Rover
44 changes: 41 additions & 3 deletions source/Demos/Canadarm.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,45 @@
Canadarm Demo
=============

TODO:
Build the Space ROS & MoveIt2 Docker Images
-------------------------------------------

If you haven't already, follow `the MoveIt2 instructions <https://space-ros.github.io/docs/rolling/Demos/MoveIt2.html>`_, and `the Space ROS image instructions <https://space-ros.github.io/docs/rolling/Tutorials/First-Time-Building.html>`_. These are the base images for the Canadarm and Curiosity Mars rover demos. The Dockerfile installs all of the prerequisite system dependencies along with the demos source code, then builds the Space ROS Space Robots Demo.

Space ROS Space Robots Demo Docker Image
----------------------------------------

Build the ``space_robots`` image:

.. code-block:: console

cd ../space_robots
./build.sh

Running the Demo Docker
-----------------------

Run the following to allow GUI passthrough:

.. code-block:: console

xhost +local:docker

Then run:

.. code-block:: console

./run.sh

Depending on the host computer, you might need to remove the ``--gpus all`` flag in ``run.sh``, which uses your GPUs.

Running the Canadarm Demo
-------------------------

Run the following command:

.. code-block:: console

ros2 launch canadarm canadarm.launch.py


Describe how to run the Canadarm demo.
This may be simply a link to the demo repo that provides the instructions.
120 changes: 117 additions & 3 deletions source/Demos/Mars-Rover.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,121 @@
Mars Rover Demo
===============

TODO:
Build the Space ROS & MoveIt2 Docker Images
-------------------------------------------

If you haven't already, follow `these instructions <https://space-ros.github.io/docs/rolling/Demos/MoveIt2.html>`_ for building the MoveIt2 docker image, `and these instructions <https://space-ros.github.io/docs/rolling/Tutorials/First-Time-Building.html>`_ for the spaceros image. These are the base images for the Canadarm and Curiosity Mars rover demos. The Dockerfile installs all of the prerequisite system dependencies along with the demos source code, then builds the Space ROS Space Robots Demo.

Space ROS Space Robots Demo Docker Image
----------------------------------------

Build the ``space_robots`` image:

.. code-block:: console

cd ../space_robots
./build.sh

Running the Demo Docker
-----------------------

Run the following to allow GUI passthrough:

.. code-block:: console

xhost +local:docker

Then run:

.. code-block:: console

./run.sh

Depending on the host computer, you might need to remove the ``--gpus all`` flag in ``run.sh``, which uses your GPUs.

Running the Mars Rover Demo
---------------------------

Launch the demo:

.. code-block:: console

ros2 launch mars_rover mars_rover.launch.py

On the top left corner, click on the refresh button to show camera feed.

Perform Tasks
^^^^^^^^^^^^^

Setup
~~~~~

Open a new terminal and attach it to the currently running container:

.. code-block:: console

docker exec -it <container-name> bash

Make sure packages are sourced:

.. code-block:: console

source ~/spaceros/install/setup.bash

.. code-block:: console

source ~/demos_ws/install/setup.bash

Available Commands
~~~~~~~~~~~~~~~~~~

Drive the rover forward:

.. code-block:: console

ros2 service call /move_forward std_srvs/srv/Empty

Stop the rover:

.. code-block:: console

ros2 service call /move_stop std_srvs/srv/Empty

Turn left:

.. code-block:: console

ros2 service call /turn_left std_srvs/srv/Empty

Turn right:

.. code-block:: console

ros2 service call /turn_right std_srvs/srv/Empty

Open the tool arm:

.. code-block:: console

ros2 service call /open_arm std_srvs/srv/Empty

Cloes the tool arm:

.. code-block:: console

ros2 service call /close_arm std_srvs/srv/Empty

Open the mast (camera arm):

.. code-block:: console

ros2 service call /mast_open std_srvs/srv/Empty

Close the mast (camera arm):

.. code-block:: console

ros2 service call /mast_close std_srvs/srv/Empty



Describe how to run the Mars rover demo.
This may be simply a link to the demo repo that provides the instructions
96 changes: 96 additions & 0 deletions source/Demos/MoveIt2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
Moveit2 Image
=============

The MoveIt2 Docker image uses the Space ROS docker image (openrobotics/spaceros:latest) as its base image, which you can build, following `this <https://space-ros.github.io/docs/rolling/Tutorials/First-Time-Building.html>`_ tutorial. The MoveIt2 Dockerfile installs all of the prerequisite system dependencies to build MoveIt2 (and Moveit2 tutorials) and then pulls and builds the latest MoveIt2 and Moveit2 tutorials source code.

Cloning the repository
----------------------

Move into your Space ROS workspace:

.. code-block:: console

cd spaceros_ws

Clone the docker repository:

.. code-block:: console

git clone https://github.com/space-ros/docker

Building the MoveIt2 Image
--------------------------

To build the docker image, run:

.. code-block:: console

cd docker/moveit2
./build.sh

The build process will take about 30 minutes, depending on the host computer.

Running the MoveIt2 Docker Image in a Container
-----------------------------------------------

After building the image, you can see the newly-built image by running:

.. code-block:: console

docker image list

The output will look something like this:

.. code-block:: console

REPOSITORY TAG IMAGE ID CREATED SIZE
openrobotics/moveit2 latest 6edb2edc9643 10 hours ago 15.5GB
openrobotics/spaceros latest 629b13cf7b74 12 hours ago 7.8GB
nvidia/cudagl 11.4.1-devel-ubuntu20.04 336416dfcbba 1 week ago 5.35GB

The new image is named openrobotics/moveit2:latest.

There is a run.sh script provided for convenience that will run the spaceros image in a container.

.. code-block:: console

./run.sh

Upon startup, the container automatically runs the entrypoint.sh script, which sources the MoveIt2 and Space ROS environment files. You'll now be running inside the container and should see a prompt similar to this:

.. code-block:: console

spaceros-user@8e73b41a4e16:~/moveit2#

Running MoveIt2 Tutorials
-------------------------

Run the following command to launch the MoveIt2 tutorials demo launch file:

.. code-block:: console

ros2 launch moveit2_tutorials demo.launch.py rviz_tutorial:=true

You should see lots of console output and the rviz2 window appear:

.. image:: ../images/rviz2-window.png

You can now follow the `MoveIt2 Tutorial documentation <https://moveit.picknik.ai/main/doc/tutorials/quickstart_in_rviz/quickstart_in_rviz_tutorial.html>`_

Running the MoveIt2 Move Group C++ Interface Demo
-------------------------------------------------

To run the Move Group C++ Interface Demo, execute the following command:

.. code-block:: console

ros2 launch moveit2_tutorials move_group.launch.py

.. image:: ../images/move-group-demo.png

Then, you can follow the `Move Group C++ Interface Demo documentation <https://moveit.picknik.ai/humble/doc/examples/move_group_interface/move_group_interface_tutorial.html>`_

Running the Space ROS Space Robots Demos
----------------------------------------

Once you have tested that MoveIt2 works, you are ready to run some of the other `Space ROS space robot demos <https://space-ros.github.io/docs/rolling/Demos/Canadarm.html>`_
Binary file not shown.
2 changes: 2 additions & 0 deletions source/Getting-Started/Building-From-Source.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Building Space ROS from Source

Building Space ROS from Source
==============================

Expand Down
Loading