isaac_ros_data_replayer
Source code on GitHub.
Overview
The isaac_ros_data_replayer
package enables replaying sensor data recorded using the isaac_ros_data_recorder
package. This package also enables reliable extraction of stereo cameras in different formats,
including depth using AI-based perception. Supported formats include MP4, PNG, and PFM. Stereo camera
frames are extracted in synchronized pairs while depth frames are aligned to the left stereo imager.
Quickstart
Set Up Development Environment
Set up your development environment by following the instructions in getting started.
Clone
isaac_ros_common
under${ISAAC_ROS_WS}/src
.cd ${ISAAC_ROS_WS}/src && \ git clone -b release-3.1 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common.git isaac_ros_common
(Optional) Install dependencies for any sensors you want to use by following the sensor-specific guides.
Warning
We strongly recommend installing all sensor dependencies before starting any quickstarts. Some sensor dependencies require restarting the Isaac ROS Dev container during installation, which will interrupt the quickstart process.
Download Quickstart Assets
Download quickstart data from NGC:
Make sure required libraries are installed.
sudo apt-get install -y curl jq tar
Then, run these commands to download the asset from NGC:
NGC_ORG="nvidia" NGC_TEAM="isaac" PACKAGE_NAME="isaac_ros_data_replayer" NGC_RESOURCE="isaac_ros_data_replayer_assets" NGC_FILENAME="quickstart.tar.gz" MAJOR_VERSION=3 MINOR_VERSION=1 VERSION_REQ_URL="https://catalog.ngc.nvidia.com/api/resources/versions?orgName=$NGC_ORG&teamName=$NGC_TEAM&name=$NGC_RESOURCE&isPublic=true&pageNumber=0&pageSize=100&sortOrder=CREATED_DATE_DESC" AVAILABLE_VERSIONS=$(curl -s \ -H "Accept: application/json" "$VERSION_REQ_URL") LATEST_VERSION_ID=$(echo $AVAILABLE_VERSIONS | jq -r " .recipeVersions[] | .versionId as \$v | \$v | select(test(\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\")) | split(\".\") | {major: .[0]|tonumber, minor: .[1]|tonumber, patch: .[2]|tonumber} | select(.major == $MAJOR_VERSION and .minor <= $MINOR_VERSION) | \$v " | sort -V | tail -n 1 ) if [ -z "$LATEST_VERSION_ID" ]; then echo "No corresponding version found for Isaac ROS $MAJOR_VERSION.$MINOR_VERSION" echo "Found versions:" echo $AVAILABLE_VERSIONS | jq -r '.recipeVersions[].versionId' else mkdir -p ${ISAAC_ROS_WS}/isaac_ros_assets && \ FILE_REQ_URL="https://api.ngc.nvidia.com/v2/resources/$NGC_ORG/$NGC_TEAM/$NGC_RESOURCE/\ versions/$LATEST_VERSION_ID/files/$NGC_FILENAME" && \ curl -LO --request GET "${FILE_REQ_URL}" && \ tar -xf ${NGC_FILENAME} -C ${ISAAC_ROS_WS}/isaac_ros_assets && \ rm ${NGC_FILENAME} fi
Build isaac_ros_data_replayer
Launch the Docker container using the
run_dev.sh
script:cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh
Install the prebuilt Debian package:
sudo apt-get install -y ros-humble-isaac-ros-data-replayer source /opt/ros/humble/setup.bash
Install the required assets:
sudo apt-get install -y ros-humble-isaac-ros-ess-models-install source /opt/ros/humble/setup.bash ros2 run isaac_ros_ess_models_install install_ess_models.sh --eula
Clone this repository under
${ISAAC_ROS_WS}/src
:cd ${ISAAC_ROS_WS}/src && \ git clone -b release-3.1 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nova.git isaac_ros_nova
Launch the Docker container using the
run_dev.sh
script:cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh
Use
rosdep
to install the package’s dependencies:rosdep install -i -r --from-paths ${ISAAC_ROS_WS}/src/isaac_ros_nova/isaac_ros_data_replayer/ --rosdistro humble -y
Install the required assets:
sudo apt-get install -y ros-humble-isaac-ros-ess-models-install source /opt/ros/humble/setup.bash ros2 run isaac_ros_ess_models_install install_ess_models.sh --eula
Build the ROS package in the Docker container:
colcon build --symlink-install --packages-up-to isaac_ros_data_replayer source install/setup.bash
Run Launch File
ros2 launch isaac_ros_data_replayer data_replayer.launch.py \
rosbag:=${ISAAC_ROS_WS}/isaac_ros_assets/isaac_ros_data_replayer/quickstart
Replay a single camera
ros2 launch isaac_ros_data_replayer data_replayer.launch.py \ rosbag:=${ISAAC_ROS_WS}/isaac_ros_assets/isaac_ros_data_replayer/quickstart \ enabled_stereo_cameras:=front_stereo_camera enabled_fisheye_cameras:=None enable_3d_lidar:=False
Visualize
Open a new terminal inside the Docker container:
cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh
Run RViz to visualize data:
rviz2
Data Extraction
Run data extraction:
ros2 run isaac_ros_data_replayer data_extraction.py \
--rosbag ${ISAAC_ROS_WS}/isaac_ros_assets/isaac_ros_data_replayer/quickstart \
--camera front_stereo_camera --output ${ISAAC_ROS_WS} \
--engine_file_path ${ISAAC_ROS_WS}/isaac_ros_assets/models/dnn_stereo_disparity/dnn_stereo_disparity_v4.0.0/ess.engine
ros2 run isaac_ros_data_replayer data_extraction.py \
--rosbag ${ISAAC_ROS_WS}/isaac_ros_assets/isaac_ros_data_replayer/quickstart \
--camera front_stereo_camera --output ${ISAAC_ROS_WS} \
--engine_file_path ${ISAAC_ROS_WS}/isaac_ros_assets/models/dnn_stereo_disparity/dnn_stereo_disparity_v4.0.0/light_ess.engine
Convert rosbag to MP4:
ros2 run isaac_ros_data_replayer camera_converter.py \ -i ${ISAAC_ROS_WS}/isaac_ros_assets/isaac_ros_data_replayer/quickstart \ -t /front_stereo_camera/left/image_compressed \ -o ${ISAAC_ROS_WS}/front_stereo_camera_left.mp4
Convert MP4 to PNG:
mkdir ${ISAAC_ROS_WS}/front_stereo_camera_left && \ ffmpeg -i ${ISAAC_ROS_WS}/front_stereo_camera_left.mp4 -vf fps=30 ${ISAAC_ROS_WS}/front_stereo_camera_left/%05d.png
Troubleshooting
Isaac ROS Troubleshooting
For solutions to problems with Isaac ROS, see troubleshooting.
Not all camera frames extracted from recording
Data extraction extracts synchronized camera frames from a recording. If the number of frames from the left and right camera are not equal, then some frames will be ignored to keep the left and right cameras in sync.
API
Usage
ros2 launch isaac_ros_data_replayer data_replayer.launch.py rosbag:=<rosbag>
ROS Launch Arguments
ROS Launch Argument |
Default Value |
Description |
---|---|---|
|
None |
Path to recording. |
|
|
Stereo cameras enabled for replay. |
|
|
Fisheye cameras enabled for replay. |
|
|
Enable 3D lidar for replay. |
|
|
Loop replay. |
|
|
Extraction rate; 1.0 for real-time, <1.0 for sub-real-time, >1.0 for super-real-time. |
|
None |
Delay to start replay. |
|
|
Additional arguments for replay. |
ROS Topics Published
ROS Topic |
Interface |
Description |
---|---|---|
|
Console logs. |
|
|
Movable transforms on the robot. |
|
|
Fixed transforms on the robot. |
|
|
Front stereo camera left camera stream. |
|
|
Front stereo camera left camera intrinsics. |
|
|
Front stereo camera right camera stream. |
|
|
Front stereo camera right camera intrinsics. |
|
|
Back stereo camera left camera stream. |
|
|
Back stereo camera left camera intrinsics. |
|
|
Back stereo camera right camera stream. |
|
|
Back stereo camera right camera intrinsics. |
|
|
Left stereo camera left camera stream. |
|
|
Left stereo camera left camera intrinsics. |
|
|
Left stereo camera right camera stream. |
|
|
Left stereo camera right camera intrinsics. |
|
|
Right stereo camera left camera stream. |
|
|
Right stereo camera left camera intrinsics. |
|
|
Right stereo camera right camera stream. |
|
|
Right stereo camera right camera intrinsics. |
|
|
Front fisheye camera stream. |
|
|
Front fisheye camera intrinsics. |
|
|
Back fisheye camera stream. |
|
|
Back fisheye camera intrinsics. |
|
|
Left fisheye camera stream. |
|
|
Left fisheye camera intrinsics. |
|
|
Right fisheye camera stream. |
|
|
Right fisheye camera intrinsics. |
|
|
Front 2D lidar scan. |
|
|
Back 2D lidar scan. |
|
|
Front 3D lidar point cloud. |
|
|
Front stereo camera inertial measurement unit. |
|
|
Chassis inertial measurement unit. |
|
|
Chassis encoder count. |
|
|
Chassis odometry. |
|
|
Chassis battery state. |
Usage
ros2 run isaac_ros_data_replayer data_extraction.py --rosbag <rosbag> --camera <camera> --output <output>
ROS Run Arguments
ROS Run Argument |
Default Value |
Description |
---|---|---|
|
None |
Path to recording. |
|
None |
Camera to extract i.e. |
|
None |
Directory to store extracted data. |
|
|
Rectified image width. |
|
|
Rectified image height. |
|
|
Minimum disparity value for normalization. |
|
|
Maximum disparity value for normalization. |
|
|
ESS threshold. |
|
|
ESS engine file path. |
ROS Topics Subscribed
ROS Topic |
Interface |
Description |
---|---|---|
|
Left camera stream. |
|
|
Left camera intrinsics. |
|
|
Right camera stream. |
|
|
Right camera intrinsics. |