Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add hitl setup and docs #194

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions docs/real_world/HITL/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Hardware-In-The-Loop Simulation
We configure a multi-machine HITL simulation, where a powerful desktop computer runs Isaac Simulator and rendering, and one/multiple jetson compute boards run robot-specific programs (planning, mapping, etc.).
## Requirement
A desktop computer configured according to [here](/docs/getting_started). One/multiple ORIN AGX/NX configured according to [here](/docs/real_world/installation/).

## Communication
All machines should connect to the same network. In our test, all machines are connected to the same router with ethernet cables. Ensure that all machines are able to `ping` others' IP addresses.

### Run
On the desktop computer, under your Airstack folder, run
```
docker compose up isaac-sim-hitl
```
You should see the isaac simulator being launched.
On the Jetson computer, run
```
docker compose up robot_l4t
```
Once the scene is played in the Isaac simulator, the rviz GUI on the Jetson should start displaying sensor data, which means the connection is successful.

Screen record of desktop computer:
<iframe src="https://drive.google.com/file/d/1sNkEattgDyBAI9xFPVQsXn8sRi6gYQSG/view?usp=sharing" width="840" height="480" allow="autoplay" allowfullscreen="allowfullscreen"></iframe>

Screen record of Jetson computer:
<iframe src="https://drive.google.com/file/d/19S8Yceq8t2FPubN8Mly003Up1AbLzCA8/view?usp=sharing" width="840" height="480" allow="autoplay" allowfullscreen="allowfullscreen"></iframe>
30 changes: 29 additions & 1 deletion docs/real_world/installation/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
# Installation on Hardware
# Installation on ORIN AGX/NX

We have tested installation and running robot container on Jetson ORIN AGX/NX and Ubuntu 22.04.

## Setup
Ensure you have docker installed.
### Clone

```
git clone --recursive -j8 [email protected]:castacks/AirStack.git
```
Checkout to the correct branch:
```
git checkout jkeller/jetson_36.4
```
## Configure

Run `./configure.sh` and follow the instructions in the prompts to do an initial configuration of the repo.

Pull the correct image:
```
docker compose pull robot_l4t
```

## Run
```
docker compose up robot_l4t
```
You should be able to see the rviz GUI being launched.
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ nav:
- docs/real_world/index.md
- Installation on Hardware:
- docs/real_world/installation/index.md
- HITL Test:
- docs/real_world/HITL/index.md
- About: docs/about.md
plugins:
- search
Expand Down
126 changes: 68 additions & 58 deletions simulation/isaac-sim/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,64 +1,74 @@
x-common-isaac-sim: &common-isaac-sim
image: &image_tag ${PROJECT_DOCKER_REGISTRY}/${PROJECT_NAME}:v${PROJECT_VERSION}_isaac-sim
build:
context: ../
dockerfile: docker/Dockerfile.isaac-ros
tags:
- *image_tag
container_name: isaac-sim
entrypoint: "" # override the default entrypoint with nothing
# for some reason the tmux session manager only works when isaac is running in tmux
command: >
bash -c " tmux new -d -s isaac
&& tmux send-keys -t isaac \"ros2 launch isaacsim run_isaacsim.launch.py gui:=${DEFAULT_ISAAC_SCENE} play_sim_on_start:=${PLAY_SIM_ON_START}\" ENTER
&& sleep infinity"
# Interactive shell
stdin_open: true # docker run -i
tty: true # docker run -t
ipc: host
privileged: true
env_file:
- ./omni_pass.env
environment:
# NVIDIA stuff
- ACCEPT_EULA=Y
- DISPLAY
- QT_X11_NO_MITSHM=1
# ROS2 stuff
- RMW_IMPLEMENTATION=rmw_fastrtps_cpp
- FASTRTPS_DEFAULT_PROFILES_FILE=/isaac-sim/fastdds.xml
deploy:
# let it use the GPU
resources:
reservations:
devices:
- driver: nvidia # https://stackoverflow.com/a/70761193
count: 1
capabilities: [gpu]
volumes:
# display
- $HOME/.Xauthority:/root/.Xauthority
- /tmp/.X11-unix:/tmp/.X11-unix
# isaac sim stuff
- ~/docker/isaac-sim/cache/kit:/isaac-sim/kit/cache:rw
- ~/docker/isaac-sim/cache/ov:/root/.cache/ov:rw
- ~/docker/isaac-sim/cache/pip:/root/.cache/pip:rw
- ~/docker/isaac-sim/cache/glcache:/root/.cache/nvidia/GLCache:rw
- ~/docker/isaac-sim/cache/computecache:/root/.nv/ComputeCache:rw
- ~/docker/isaac-sim/logs:/root/.nvidia-omniverse/logs:rw
- ~/docker/isaac-sim/data:/root/.local/share/ov/data:rw
- ~/docker/isaac-sim/documents:/root/Documents:rw
- ./user.config.json:/root/.local/share/ov/data/Kit/Isaac-Sim/4.2/user.config.json:rw
- ./ui.py:/isaac-sim/kit/exts/omni.kit.widget.nucleus_connector/omni/kit/widget/nucleus_connector/ui.py:rw
# developer stuff
- .dev:/root/.dev:rw # developer config
- .bashrc:/root/.bashrc:rw # bash config
# code
- ../sitl_integration/kit-app-template/source/extensions/:/root/Documents/Kit/shared/exts/
- ../sitl_integration:/sitl_integration:rw
- ../sitl_integration/inputrc:/etc/inputrc
- ../sitl_integration/config:/root/.nvidia-omniverse/config:rw
- /home/airstation-04/isaac_people_scripts:/isaac-sim/isaac_people_scripts:rw

services:
isaac-sim:
image: &image_tag ${PROJECT_DOCKER_REGISTRY}/${PROJECT_NAME}:v${PROJECT_VERSION}_isaac-sim
build:
context: ../
dockerfile: docker/Dockerfile.isaac-ros
tags:
- *image_tag
<<: *common-isaac-sim
container_name: isaac-sim
entrypoint: "" # override the default entrypoint with nothing
# for some reason the tmux session manager only works when isaac is running in tmux
command: >
bash -c " tmux new -d -s isaac
&& tmux send-keys -t isaac \"ros2 launch isaacsim run_isaacsim.launch.py gui:=${DEFAULT_ISAAC_SCENE} play_sim_on_start:=${PLAY_SIM_ON_START}\" ENTER
&& sleep infinity"
# Interactive shell
stdin_open: true # docker run -i
tty: true # docker run -t
ipc: host
privileged: true
networks:
airstack_network:
ipv4_address: 172.31.0.200
env_file:
- ./omni_pass.env
environment:
# NVIDIA stuff
- ACCEPT_EULA=Y
- DISPLAY
- QT_X11_NO_MITSHM=1
# ROS2 stuff
- RMW_IMPLEMENTATION=rmw_fastrtps_cpp
- FASTRTPS_DEFAULT_PROFILES_FILE=/isaac-sim/fastdds.xml
deploy:
# let it use the GPU
resources:
reservations:
devices:
- driver: nvidia # https://stackoverflow.com/a/70761193
count: 1
capabilities: [gpu]
volumes:
# display
- $HOME/.Xauthority:/root/.Xauthority
- /tmp/.X11-unix:/tmp/.X11-unix
# isaac sim stuff
- ~/docker/isaac-sim/cache/kit:/isaac-sim/kit/cache:rw
- ~/docker/isaac-sim/cache/ov:/root/.cache/ov:rw
- ~/docker/isaac-sim/cache/pip:/root/.cache/pip:rw
- ~/docker/isaac-sim/cache/glcache:/root/.cache/nvidia/GLCache:rw
- ~/docker/isaac-sim/cache/computecache:/root/.nv/ComputeCache:rw
- ~/docker/isaac-sim/logs:/root/.nvidia-omniverse/logs:rw
- ~/docker/isaac-sim/data:/root/.local/share/ov/data:rw
- ~/docker/isaac-sim/documents:/root/Documents:rw
- ./user.config.json:/root/.local/share/ov/data/Kit/Isaac-Sim/4.2/user.config.json:rw
- ./ui.py:/isaac-sim/kit/exts/omni.kit.widget.nucleus_connector/omni/kit/widget/nucleus_connector/ui.py:rw
# developer stuff
- .dev:/root/.dev:rw # developer config
- .bashrc:/root/.bashrc:rw # bash config
# code
- ../sitl_integration/kit-app-template/source/extensions/:/root/Documents/Kit/shared/exts/
- ../sitl_integration:/sitl_integration:rw
- ../sitl_integration/inputrc:/etc/inputrc
- ../sitl_integration/config:/root/.nvidia-omniverse/config:rw

isaac-sim-hitl:
<<: *common-isaac-sim
container_name: isaac-sim-hitl
network_mode: host # Use host networking