Skip to content

Commit

Permalink
Update build 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 9, 2024
1 parent 457bbee commit a8fa2d6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 9 deletions.
26 changes: 21 additions & 5 deletions curiosity_rover/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ To start the demo, there are few dependencies that need to be installed. The fol

1. You will need ROS Humble on your host system. If it is not already installed, you can follow the instructions [here](https://docs.ros.org/en/humble/Installation.html).
2. You will need Gazebo Sim installed on your system. If not, you can follow the instructions [here](https://gazebosim.org/docs/all/getstarted/).
3. You will need docker installed on your system. If not, you can follow the instructions [here](https://docs.docker.com/get-docker/).
4. Install xterm for running the demo. You can install it using the following command.
3. 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).
4. You will need docker installed on your system. If not, you can follow the instructions [here](https://docs.docker.com/get-docker/).
5. Install xterm for running the demo. You can install it using the following command.
```bash
sudo apt-get install xterm
```
Expand Down Expand Up @@ -39,13 +40,28 @@ To start the demo, there are few dependencies that need to be installed. The fol
```
5. 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
2 changes: 1 addition & 1 deletion curiosity_rover/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SHELL="/bin/bash"

# Define packages
SIM_PACKAGES="curiosity_description curiosity_gazebo"
CONTROL_PACKAGE="curiosity_rover_demo"
CONTROL_PACKAGE="curiosity_common curiosity_rover_demo"
DEMO_PACKAGES="$CONTROL_PACKAGE $SIM_PACKAGES"

####################################################################################################
Expand Down
27 changes: 24 additions & 3 deletions curiosity_rover/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ XTERM_CONFIG="-bg black -fg white -fa 'Monospace' -fs 11"
DOCKER_IMAGE="osrf/space-ros:curiosity_demo"
LOCAL_WORKSPACE=$(pwd)

# Help function to describe each target
help() {
echo "Curiosity Rover Run Script"
echo "Usage: ./run.sh [--option]"
echo "Available options:"
echo " ./run.sh help - Show this help message"
echo " ./run.sh - Run the CanadArm2 control demo with Gazebo"
echo " ./run.sh --isaacsim - Run the CanadArm2 control demo with IsaacSim"
exit 0
}

# Run the Curiosity Rover Gazebo simulation locally
run-gazebo() {
# shellcheck disable=SC2090
Expand All @@ -20,7 +31,7 @@ run-control-demo() {
xterm $XTERM_CONFIG -T 'Curiosity Rover Demo' -e "docker run -it --rm \
-e RMW_IMPLEMENTATION=rmw_cyclonedds_cpp \
$DOCKER_IMAGE \
bash -c 'source /home/spaceros-user/curiosity_ws/install/setup.bash && ros2 launch curiosity_rover_demo mars_rover.launch.py'" &
bash -c 'source /home/spaceros-user/curiosity_ws/install/setup.bash && $1'" &
}

check_docker() {
Expand Down Expand Up @@ -51,8 +62,18 @@ run() {
check_xterm
check_ros2

if [ "$1" == "--isaacsim" ]; then
LAUNCH_COMMAND="ros2 launch curiosity_rover_demo mars_rover.launch.py environment:=isaacsim"
else
LAUNCH_COMMAND="ros2 launch curiosity_rover_demo mars_rover.launch.py"
fi
run-control-demo "$LAUNCH_COMMAND"

if [ "$1" == "--isaacsim" ]; then
exit 0
fi

run-gazebo
run-control-demo
}

run
run "$@"

0 comments on commit a8fa2d6

Please sign in to comment.