Skip to content

Commit

Permalink
REL.10.00.00.05. Compatible with: Processor SDK Linux for Edge AI 10.…
Browse files Browse the repository at this point in the history
…00.00
  • Loading branch information
junechul committed Sep 9, 2024
1 parent a463fba commit ed17755
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 23 deletions.
13 changes: 10 additions & 3 deletions docker/entrypoint_arm64.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash
set -e

# setup proxy as required
# set up proxy as needed
source /root/setup_proxy.sh

# Ubuntu version and ROS distro
UBUNTU_VER=$(lsb_release -r | cut -f2)
echo "Ubuntu $UBUNTU_VER. ROS-$ROS_DISTRO"

# set up ROS environment
# set up the ROS environment
source "/opt/ros/$ROS_DISTRO/setup.bash"

# setup TI Processor SDK environment
# set up the TI Processor SDK environment
SRC_PATH=/opt/robotics_sdk/docker
FILE="$SRC_PATH/setup_ti_processor_sdk.sh"
if [ -f $FILE ]; then
Expand All @@ -20,6 +20,13 @@ else
echo "$FILE does not exist"
fi

# set up the SDK ROS packages pre-installed in the container
SETUP_FILE="/opt/ros/robotics_sdk_install/setup.bash"
if [ -f "$SETUP_FILE" ]; then
source "$SETUP_FILE"
fi

# set up the ROS packages in the ROS workspace
if [ "$ROS_VERSION" == "1" ]; then
# ROS network settings
if [ -z "$J7_IP_ADDR" ]; then
Expand Down
11 changes: 9 additions & 2 deletions docker/entrypoint_viz.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
#!/bin/bash
set -e

# setup proxy as required
# set up proxy as needed
source /root/setup_proxy.sh

# Ubuntu version
UBUNTU_VER=$(lsb_release -r | cut -f2)
echo "Ubuntu $UBUNTU_VER. ROS-$ROS_DISTRO"

# set up ROS environment
# set up the ROS environment
source "/opt/ros/$ROS_DISTRO/setup.bash"

# set up the SDK ROS packages pre-installed in the container
SETUP_FILE="/opt/ros/robotics_sdk_install/setup.bash"
if [ -f "$SETUP_FILE" ]; then
source "$SETUP_FILE"
fi

# set up the ROS packages in the ROS workspace
if [ "$ROS_VERSION" == "1" ]; then
# ROS network settings
if [ -z "$J7_IP_ADDR" ]; then
Expand Down
80 changes: 62 additions & 18 deletions docker/setting_docker_ros2.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,46 @@
# Docker Setup for ROS 2

In the ROS 2 Docker images both for the target SK board and Ubuntu PC, two popular DDS implementations are installed by default:
## Quick Start Guide

- eProsima Fast DDS (default DDS for ROS 2 {{ROS2_DISTRO}})
- Eclipse Cyclone DDS (additionally installed)
```{note}
For a quick started, it is recommended to use the pre-built SDK Docker images. In the SDK Docker container, pre-built ROS packages for the Robotics SDK are already installed (under `/opt/ros/robotics_sdk_install` in the container filesystem).
```

To ensure smooth running of the out-of-box demos, the following DDS selections are made in the ROS 2 Docker containers by default on each platform.
### On the Target

| Platform | DDS Choice | Note |
|-------------------|----------------------|-------------------------------------------------|
| Target SK board | Eclipse Cyclone DDS | Provides better performance, especially with "rosbag play" |
| Visualization PC | eProsima Fast DDS | Provides better `Ctrl+C` response |
1. Set up the SDK git repository and the workspace:
```bash
source /opt/edgeai-gst-apps/scripts/install_robotics_sdk.sh
cd ~/j7ros_home
make scripts
```

You can switch the DDS implementation in each launch session by setting the environment variable `RMW_IMPLEMENTATION`. For example,
2. Pull and Run the SDK Docker image:
```bash
docker pull ghcr.io/texasinstruments/robotics-sdk:10.0.0-humble-$SOC
docker tag ghcr.io/texasinstruments/robotics-sdk:10.0.0-humble-$SOC robotics-sdk:10.0.0-humble-$SOC
./docker_run.sh
```
3. Run the demos by referring to the ["Run Demo Applications" section](#run-demos).

To use the eProsima Fast DDS,
```
RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 ...
```
### On the Visualization PC

To use the Eclipse Cyclone DDS,
```
RMW_IMPLEMENTATION=rmw_cyclonedds_cpp ros2 ...
```
1. Set up the SDK git repository and the workspace:
```bash
wget -O init_setup.sh https://git.ti.com/cgit/processor-sdk-vision/jacinto_ros_perception/plain/init_setup.sh
source ./init_setup.sh
cd ~/j7ros_home
make scripts [GPUS=y]
```

2. Pull and Run the Docker image for the visualization PC.
```bash
docker pull ghcr.io/texasinstruments/robotics-sdk:10.0.0-humble-viz
docker tag ghcr.io/texasinstruments/robotics-sdk:10.0.0-humble-viz robotics-sdk:10.0.0-humble-viz
./docker_run.sh
```

For those interested in building the SDK Docker image and the SDK ROS packages, please refer to the following sections.

## Set Up Docker Environment on the Target

Expand Down Expand Up @@ -99,13 +117,14 @@ You can choose any folder, but `init_setup.sh` script sets up `${HOME}/j7ros_hom
root@pc-docker:~/j7ros_home/ros_ws$ source install/setup.bash
```

(run-demos)=
## Run Demo Applications

The table below summarizes the launch commands that you can use in the Docker container for each demo, on the target SK board, and on the remote visualization PC. For more details, see the following subsections.

Launch arguments can be passed to the following launch commands.

```{note}
```{note} Installed
Camera ID and subdev ID for cameras: You can check the camera ID (`cam_id`) and subdev ID (`subdev_id`) for the camera
attached to the SK board by running `/opt/edgeai-gst-apps/scripts/setup_cameras.sh`. You can use the alias `setup_cameras` inside the SDK container.
Expand Down Expand Up @@ -179,3 +198,28 @@ You can use TMUX inside the ROS Docker container to split the current terminal w
- `Ctrl + b`, followed by `` or ``: Switch to the pane in the respective direction.
- `Ctrl + b`, followed by `x`: Close the current pane.
```
## DDS Implementation Options
In the ROS 2 Docker images both for the target SK board and Ubuntu PC, two popular DDS implementations are installed by default:
- eProsima Fast DDS (default DDS for ROS 2 {{ROS2_DISTRO}})
- Eclipse Cyclone DDS (additionally installed)
To ensure smooth running of the out-of-box demos, the following DDS selections are made in the ROS 2 Docker containers by default on each platform.
| Platform | DDS Choice | Note |
|-------------------|----------------------|-------------------------------------------------|
| Target SK board | Eclipse Cyclone DDS | Provides better performance, especially with "rosbag play" |
| Visualization PC | eProsima Fast DDS | Provides better `Ctrl+C` response |
You can switch the DDS implementation in each launch session by setting the environment variable `RMW_IMPLEMENTATION`. For example,
To use the eProsima Fast DDS,
```
RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 ...
```
To use the Eclipse Cyclone DDS,
```
RMW_IMPLEMENTATION=rmw_cyclonedds_cpp ros2 ...
```

0 comments on commit ed17755

Please sign in to comment.