Space ROS robots demos - minimal setup
$ docker pull ghcr.io/traclabs/spaceros_robots:latest
If you have trouble pulling the image, chances are, you are not logged in the ghcr.io registry. Take a look at the end of this README for some instructions that might help.
If I am going to use graphics tools like Gazebo or Rviz, I often have to run this in the terminal:
xhost local:root
I think this is only needed if your docker user is root, but I am not sure. Just in case, I usually do this (you only need to do it once).
Two options:
- Using vscode: This repository has a .devcontainer folder, so you could open this with vscode and select Reopen in container when asked.
- Using terminal: Start a container with name space_robots_container (or whatever name you want):
$ docker run -it --name=spaceros_robots_container --env="DISPLAY=$DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --env="XAUTHORITY=$XAUTH" --volume="$XAUTH:$XAUTH" --net=host --privileged ghcr.io/traclabs/spaceros_robots:latest bash
Two options:
- Using vscode: Go to the Terminal option in the menu. Click in New terminal, which will open a terminal inside the container.
- Using terminal:
$ docker exec -it spaceros_robots_container bash
(Any line here goes in a container's terminal)
-
Start the demo:
$ ros2 launch mars_rover mars_rover.launch.py
-
Send commands to the rover (one at a time, give it some time, the robot is slow):
$ ros2 service call /move_forward std_srvs/srv/Empty # Move the robot forward $ ros2 service call /move_stop std_srvs/srv/Empty # Stop the robot $ ros2 service call /open_arm std_srvs/srv/Empty # Open the tool arm $ ros2 service call /close_arm std_srvs/srv/Empty # Close the tool arm
Instructions came from the README here: https://github.com/space-ros/docker/tree/main/space_robots
(Any line here goes in a container's terminal)
- Start the demo:
$ ros2 launch canadarm canadarm.launch.py
- Send commands to the arm (takes a while, the arm moves slow):
$ ros2 service call /open_arm std_srvs/srv/Empty {} # Open the arm to outstretched pose $ ros2 service call /close_arm std_srvs/srv/Empty {} # Arm back to tight pose $ ros2 service call /random_arm std_srvs/srv/Empty {} # Move arm to a random pose
In case you had trouble pulling the image, follow these steps:
- Create a personal access token (classic)
- Open New personal access token (classic)
- Give your token a name (eg. "Read package token")
- Select the "read:packages" scope.
- Click on "Generate Token".
- Copy the token (ie.
ghp_.....
) and store it.
- Login to Github's container registry
- Open a new terminal
- Run "docker login ghcr.io -u my_github_username", replace
my_github_username
with your Github username. - When prompted for a password, enter the token you generated. (Don't enter your github password, it won't work.)
- Check if you can pull the docker image
- Pull:
docker pull ghcr.io/traclabs/spaceros_robots:latest
- Pull: