Skip to content

Commit

Permalink
Update build / run instructions and README.md for new integration
Browse files Browse the repository at this point in the history
Related to #49
  • Loading branch information
franklinselva committed Sep 11, 2024
1 parent b839b7a commit 544dba5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 6 deletions.
24 changes: 20 additions & 4 deletions curiosity_rover/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ This is a simple demo of controlling the curiosity rover using spaceROS.

To start the demo, there are few dependencies that need to be installed. The following steps will guide you through the installation process.

1. You will need docker installed on your system. If not, you can follow the instructions [here](https://docs.docker.com/get-docker/).
1. You will need Nvidia's Isaac Sim installed on your system. If not, you can follow the instructions [here](https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_workstation.html).
2. You will need docker installed on your system. If not, you can follow the instructions [here](https://docs.docker.com/get-docker/).

### How to run the demo

Expand All @@ -25,13 +26,28 @@ To start the demo, there are few dependencies that need to be installed. The fol
```
4. To run the demo, you can use the following command.
```bash
# To run the demo
# To run the demo with gazebo
./run.sh
# To run the demo with isaac sim
./run.sh --isaacsim
```

This will start the demo in one terminal and gazebo in another terminal. To control the rover, we provide ros2 services for the demo. You can control the rover using the following services.
This will start the demo in one terminal and gazebo in another terminal. To control the canadarm2, we provide ros2 services for the demo. You can control the rover using the following services.

> NOTE: If you are using Isaac Sim, make sure to start the simulation in Isaac Sim before running the demo. You can find more information on how to start the simulation in Isaac Sim [here](https://github.com/space-ros/simulation/).


1. To move around, you can use teleop_twist_keyboard. To run the teleop_twist_keyboard, you can run the following command,
```bash
# For gazebo
ros2 run teleop_twist_keyboard teleop_twist_keyboard
# For isaacsim
ros2 run teleop_twist_keyboard teleop_twist_keyboard -r /cmd_vel:=/curiosity/cmd_vel
```

1. To move around, you can use the `move` service. The service takes two arguments, `linear` and `angular` velocities. You can call the service using the following command.
You can also use the following services to control the rover,
```bash
# Move forward
ros2 service call /move_forward std_srvs/srv/Empty
Expand Down
15 changes: 15 additions & 0 deletions curiosity_rover/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,18 @@ services:
"-c",
"source /home/spaceros-user/curiosity_ws/install/setup.bash && ros2 launch curiosity_rover_demo mars_rover.launch.py",
]
curiosity_demo_isaacsim:
image: osrf/space-ros:curiosity_demo
build:
context: ./
dockerfile: ./Dockerfile
environment:
- PYTHONUNBUFFERED=1 # important to show error messages if a ros service crashes!
- RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
network_mode: host
command:
[
"bash",
"-c",
"source /home/spaceros-user/curiosity_ws/install/setup.bash && ros2 launch curiosity_rover_demo mars_rover.launch.py environment:=isaacsim",
]
9 changes: 7 additions & 2 deletions curiosity_rover/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash

docker compose down
docker compose up -d
docker-compose down

if [ "$1" == "--isaacsim" ]; then
docker compose up -d curiosity_demo_isaacsim
else
docker compose up -d curiosity_demo curiosity_gui
fi

0 comments on commit 544dba5

Please sign in to comment.