From 544dba5f413093c01eea788e396baea9c52e89c5 Mon Sep 17 00:00:00 2001 From: franklinselva Date: Mon, 9 Sep 2024 11:14:28 +0200 Subject: [PATCH] Update build / run instructions and README.md for new integration Related to #49 --- curiosity_rover/README.md | 24 ++++++++++++++++++++---- curiosity_rover/docker-compose.yml | 15 +++++++++++++++ curiosity_rover/run.sh | 9 +++++++-- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/curiosity_rover/README.md b/curiosity_rover/README.md index 79668ccd..f0db9148 100644 --- a/curiosity_rover/README.md +++ b/curiosity_rover/README.md @@ -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 @@ -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 diff --git a/curiosity_rover/docker-compose.yml b/curiosity_rover/docker-compose.yml index b67b2389..e17d29d8 100644 --- a/curiosity_rover/docker-compose.yml +++ b/curiosity_rover/docker-compose.yml @@ -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", + ] diff --git a/curiosity_rover/run.sh b/curiosity_rover/run.sh index ae535312..13da0b45 100755 --- a/curiosity_rover/run.sh +++ b/curiosity_rover/run.sh @@ -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