Skip to content

Commit

Permalink
image built successfully, finalizing run script, testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Mechazo11 committed Sep 11, 2024
1 parent 20e3394 commit fb7d5db
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 10 deletions.
3 changes: 0 additions & 3 deletions o3de_mars_rover/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,6 @@ RUN /bin/bash -c 'source ${DEMO_DIR}/install/setup.bash \

RUN cmake --build build/linux --config profile --target ${PROJECT_NAME} Editor ${PROJECT_NAME}.Assets

# # RUN cmake -B build/linux -G "Ninja Multi-Config" -DLY_DISABLE_TEST_MODULES=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLY_STRIP_DEBUG_SYMBOLS=ON -DAZ_USE_PHYSX5:BOOL=ON \
# # && cmake --build build/linux --config profile --target ${PROJECT_NAME} Editor ${PROJECT_NAME}.Assets

# Add the user to the render group so that the user can access /dev/dri/renderD128
# /dev/dri/renderD128 gives access to hardware-accelerated rendering tool such as GPU
RUN sudo usermod -aG render $USERNAME
Expand Down
35 changes: 35 additions & 0 deletions o3de_mars_rover/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# o3de_mars_rover

This directory contains the Dockerfile instructions for creating the ```TODO``` image that showcases Curiosity rover navigating through a clutterd test environment inspired by JPL's Mars Yard testing ground.

This project was created as a submission to the NASA Space ROS Sim Summer Sprint Challenge 2024. A short review on O3DE, a small video showing the system in action and other related discussion can be found in this [PR](https://github.com/space-ros/demos/pull/64)

## Prerequisits

* ```osrf/space-ros```. I will eventually upgrade the Dockerfile to use the ```openrobotics/moveit2::latest``` from [space-ros/docker/movit2](https://github.com/space-ros/docker/tree/main/moveit2) image

## Build instruction

**WARNING** At least have 60 GB of free disk space and since it builds Moveit2 and Demo_ws before building the whole O3DE project, expect at least 3 - 4 hours for the build process to complete.

* Git clone the top level ```demos``` repository and ```change directory``` into it. If you are just interested in the image, you don't need to clone this repo. Then from a terminal

```bash
cd /o3de_mars_rover
./build.sh
```

* Install Nvidia Container toolkit and run configuration as discussed here: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html. If you don't have it open a terminal and do the following

* Make sure you have --runtime nvidia configured. If not this sample example will do it: ```sudo docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi```

## Run the demo

* In the terminal where you would launch the O3DE, run the following

```bash
xhost +local:docker
./run.sh
```

* Open another terminal and find the
1 change: 1 addition & 0 deletions o3de_mars_rover/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -e

# Source all relevant worksapces
source "/opt/ros/humble/setup.bash"
source "${SPACEROS_DIR}/install/setup.bash"
source "${MOVEIT2_DIR}/install/setup.bash"
source "${DEMO_DIR}/install/setup.bash"
Expand Down
24 changes: 17 additions & 7 deletions o3de_mars_rover/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,27 @@ CONTAINER_NAME="$(tr '/' '_' <<< "$IMG_NAME")"

# TODO this needs to be updated with
# Start the container
docker run --rm -it --name $CONTAINER_NAME --network host \
-e DISPLAY -e TERM -e QT_X11_NO_MITSHM=1 $IMG_NAME
# docker run --rm -it --name $CONTAINER_NAME --network host \
# -e DISPLAY -e TERM -e QT_X11_NO_MITSHM=1 $IMG_NAME

# xhost +local:docker

# docker run -d \
# --name=o3de_rosbot_xl \
# Will automatically remove the container once exi
# docker run --rm -it \
# --name=$CONTAINER_NAME \
# --runtime=nvidia \
# --network host \
# -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
# -e DISPLAY=${DISPLAY} \
# -e NVIDIA_VISIBLE_DEVICES=all \
# -e NVIDIA_DRIVER_CAPABILITIES=all \
# o3de-husarion /data/workspace/ROSbotXLDemo/build/linux/bin/profile/Editor
# -e DISPLAY -e TERM -e QT_X11_NO_MITSHM=1 $IMG_NAME


docker run --rm -it --name $CONTAINER_NAME \
--runtime nvidia \
--network host \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
-e DISPLAY=${DISPLAY} \
-e NVIDIA_VISIBLE_DEVICES=all \
-e NVIDIA_DRIVER_CAPABILITIES=all \
-e DISPLAY -e TERM -e QT_X11_NO_MITSHM=1 $IMG_NAME

0 comments on commit fb7d5db

Please sign in to comment.