Skip to content

Commit

Permalink
Update build instructions and README.md for isaac sim integration
Browse files Browse the repository at this point in the history
Related to space-ros#48
  • Loading branch information
franklinselva committed Sep 9, 2024
1 parent 962c4ce commit 7fb45c0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
10 changes: 7 additions & 3 deletions canadarm2/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,8 +40,11 @@ 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 canadarm2, we provide ros2 services for the demo. You can control the rover using the following services.
Expand Down
2 changes: 1 addition & 1 deletion canadarm2/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="canadarm_description canadarm_gazebo"
CONTROL_PACKAGE="canadarm_moveit_config canadarm_demo"
CONTROL_PACKAGE="canadarm_moveit_config canadarm_common canadarm_demo"
DEMO_PACKAGES="$CONTROL_PACKAGE $SIM_PACKAGES"

####################################################################################################
Expand Down
29 changes: 26 additions & 3 deletions canadarm2/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:canadarm_demo"
LOCAL_WORKSPACE=$(pwd)

# Help function to describe each target
help() {
echo "CanadArm2 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 CanadArm Gazebo simulation locally
run-gazebo() {
# shellcheck disable=SC2090
Expand All @@ -20,7 +31,7 @@ run-control-demo() {
xterm $XTERM_CONFIG -T 'CanadArm2 Demo' -e "docker run -it --rm \
-e RMW_IMPLEMENTATION=rmw_cyclonedds_cpp \
$DOCKER_IMAGE \
bash -c 'source /home/spaceros-user/canadarm_ws/install/setup.bash && ros2 launch canadarm_demo canadarm.launch.py'" &
bash -c 'source /home/spaceros-user/canadarm_ws/install/setup.bash && $1'" &
}

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

if [ "$1" == "--isaacsim" ]; then
echo "Running CanadArm2 control demo with IsaacSim"
LAUNCH_COMMAND="ros2 launch canadarm_demo canadarm.launch.py environment:=isaacsim"
else
echo "Running CanadArm2 control demo with Gazebo"
LAUNCH_COMMAND="ros2 launch canadarm_demo canadarm.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 7fb45c0

Please sign in to comment.