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

Adding Demos, Getting-Started, Simulation Assets and RTEMS #20

Draft
wants to merge 2 commits into
base: rolling
Choose a base branch
from
Draft
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
11 changes: 7 additions & 4 deletions source/Demos/Canadarm.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
###############################
Canadarm Demo
=============
###############################

TODO:

Describe how to run the Canadarm demo.
This may be simply a link to the demo repo that provides the instructions.
Run
=============
```
$ ros2 launch canadarm canadarm.launch.py
```
81 changes: 78 additions & 3 deletions source/Demos/Mars-Rover.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,82 @@
#############################
Mars Rover Demo
#############################

The Mars Rover demo is a part of the Space ROS Space Robots Demos. This demo depends on the docker image uses the Space ROS docker image (*openrobotics/spaceros:latest*) as its base image.
Running the Demos
===============
Launch the demo:
```
$ ros2 launch mars_rover mars_rover.launch.py
```

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

Perform Tasks
===============

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

```
$ docker exec -it <container-name> bash
```

Make sure packages are sourced:

```
$ source ~/spaceros/install/setup.bash
```

```
$ source ~/demos_ws/install/setup.bash
```

Available Commands
===============
Drive the rover forward

```
$ ros2 service call /move_forward std_srvs/srv/Empty
```

Stop the rover

```
$ ros2 service call /move_stop std_srvs/srv/Empty
```

Turn left

```
$ ros2 service call /turn_left std_srvs/srv/Empty
```

Turn right

```
$ ros2 service call /turn_right std_srvs/srv/Empty
```

Open the tool arm:

```
$ ros2 service call /open_arm std_srvs/srv/Empty
```

Close the tool arm:

```
$ ros2 service call /close_arm std_srvs/srv/Empty
```

Open the mast (camera arm)

```
$ ros2 service call /mast_open std_srvs/srv/Empty
```

TODO:
Close the mast (camera arm)

Describe how to run the Mars rover demo.
This may be simply a link to the demo repo that provides the instructions
```
$ ros2 service call /mast_close std_srvs/srv/Empty
```
123 changes: 121 additions & 2 deletions source/Getting-Started/Building-From-Source.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,125 @@
Building Space ROS from Source
==============================

TODO:
To use Space ROS in your project, you can build it by:
- Directly cloning the [ROS 2 fork repository](https://github.com/space-ros/space-ros
) and importing packages from the repos file.
- Setting up a Dockerized environment (recommended).

Space ROS Fork
===========================




Space ROS Docker Image and Earthly configuration
===========================

The Earthfile configuration in this directory facilitates builds of Space ROS from source code.
The generated container image is based on Ubuntu 22.04 (Jammy) and can be used with [`rocker`](https://github.com/osrf/rocker) to add X11 and GPU passthrough.

## Building the Docker Image

The [Earthly](https://earthly.dev/get-earthly) utility is required to build this image.

To build the image, run:

```
$ ./build.sh
```

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

## Running the Space ROS Docker Image in a Container

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

```
$ docker image list
```

The output will look something like this:

```
$ docker image list
REPOSITORY TAG IMAGE ID CREATED SIZE
osrf/space-ros latest 109ad8fb7460 4 days ago 2.45GB
ubuntu jammy a8780b506fa4 5 days ago 77.8MB
```

The new image is named **osrf/space-ros:latest**.

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

```
$ ./run.sh
```

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

```
spaceros-user@d10d85c68f0e:~/spaceros$
```

At this point, you can run the 'ros2' command line utility to make sure everything is working OK:

```
spaceros-user@d10d85c68f0e:~/spaceros$ ros2
usage: ros2 [-h] [--use-python-default-buffering] Call `ros2 <command> -h` for more detailed usage. ...

ros2 is an extensible command-line tool for ROS 2.

optional arguments:
-h, --help show this help message and exit
--use-python-default-buffering
Do not force line buffering in stdout and instead use the python default buffering, which might be affected by PYTHONUNBUFFERED/-u and depends on whatever stdout is interactive or not

Commands:
action Various action related sub-commands
component Various component related sub-commands
daemon Various daemon related sub-commands
doctor Check ROS setup and other potential issues
interface Show information about ROS interfaces
launch Run a launch file
lifecycle Various lifecycle related sub-commands
multicast Various multicast related sub-commands
node Various node related sub-commands
param Various param related sub-commands
pkg Various package related sub-commands
run Run a package specific executable
service Various service related sub-commands
topic Various topic related sub-commands
trace Trace ROS nodes to get information on their execution
wtf Use `wtf` as alias to `doctor`

Call `ros2 <command> -h` for more detailed usage.
```

Connecting Another Terminal to a Running Docker Container
===========================

Sometimes it may be convenient to attach additional terminals to a running Docker container.

With the Space ROS Docker container running, open a second host terminal and then run the following command to determine the container ID:

```
$ docker container list
```

The output will look something like this:

```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d10d85c68f0e openrobotics/spaceros "/entrypoint.sh …" 28 minutes ago Up 28 minutes inspiring_moser
```

The container ID in this case, is *d10d85c68f0e*. So, run the following command in the host terminal:

```
docker exec -it d10d85c68f0e /bin/bash --init-file "install/setup.bash"
```

You will then be at a prompt in the same running container.

In place of the container ID, you can also use the automatically-generated container name ("inspiring_moser" in this case).

Describe how to build Space ROS from source code (presumably using Earthly).
23 changes: 21 additions & 2 deletions source/Getting-Started/Docker-Images.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
###############################
The Space ROS Docker Images
===========================
###############################

TODO:

Describe how to use the Space ROS docker image from Docker Hub, and any other images published to Docker Hub.

* Docker Hub
* Base image, MoveIt2, demos, etc.


The Space ROS project provides a layered configuration of Docker containers to build different functionalities on top.

Overview

The base layer is the `spaceros` docker image, see [] to build it.



Next steps
===========================




Related Content
===========================
Tutorial earthly
8 changes: 4 additions & 4 deletions source/How-To-Guides/Use-Simulation-Assets.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###############################
Using Space-Related Simulation Assets
=====================================

TODO:
###############################

How to use the provided simulation assets in a new project.

How to use the provided simulation assets in a new project?
=====================================
Loading