isaac_ros_bi3d_freespace
Source code on GitHub.
Quickstart
Set up your development environment by following the instructions here.
Clone
isaac_ros_common
and 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_common.git isaac_ros_common
git clone -b release-3.1 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_freespace_segmentation.git isaac_ros_freespace_segmentation
Pull down a rosbag of sample data:
git clone -b release-3.1 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_depth_segmentation.git isaac_ros_depth_segmentation
cd ${ISAAC_ROS_WS}/src/isaac_ros_depth_segmentation && git lfs pull -X "" -I "resources/rosbags/bi3dnode_rosbag"
Launch the Docker container using the
run_dev.sh
script:cd ${ISAAC_ROS_WS}/src/isaac_ros_common && ./scripts/run_dev.sh
Install this package’s dependencies.
sudo apt-get install -y ros-humble-isaac-ros-bi3d-freespace
Download model files for Bi3D (refer to the Model Preparation section for more information):
mkdir -p /tmp/models/bi3d && cd /tmp/models/bi3d && wget 'https://api.ngc.nvidia.com/v2/models/nvidia/isaac/bi3d_proximity_segmentation/versions/2.0.0/files/featnet.onnx' && wget 'https://api.ngc.nvidia.com/v2/models/nvidia/isaac/bi3d_proximity_segmentation/versions/2.0.0/files/segnet.onnx'
Convert the
.onnx
model files to TensorRT engine plan files (refer to the Model Preparation section for more information):If using Jetson (Generate engine plans with DLA support enabled):
/usr/src/tensorrt/bin/trtexec --saveEngine=/tmp/models/bi3d/bi3dnet_featnet.plan \ --onnx=/tmp/models/bi3d/featnet.onnx \ --int8 --useDLACore=0 --allowGPUFallback && /usr/src/tensorrt/bin/trtexec --saveEngine=/tmp/models/bi3d/bi3dnet_segnet.plan \ --onnx=/tmp/models/bi3d/segnet.onnx \ --int8 --useDLACore=0 --allowGPUFallback
If using x86_64:
/usr/src/tensorrt/bin/trtexec --saveEngine=/tmp/models/bi3d/bi3dnet_featnet.plan \ --onnx=/tmp/models/bi3d/featnet.onnx --int8 && /usr/src/tensorrt/bin/trtexec --saveEngine=/tmp/models/bi3d/bi3dnet_segnet.plan \ --onnx=/tmp/models/bi3d/segnet.onnx --int8
Note
The engine plans generated using the x86_64 commands will also work on Jetson, but performance will be reduced.
Run the launch file to spin up a demo of this package:
cd /workspaces/isaac_ros-dev
ros2 launch isaac_ros_bi3d_freespace isaac_ros_bi3d_freespace.launch.py featnet_engine_file_path:=/tmp/models/bi3d/bi3dnet_featnet.plan \ segnet_engine_file_path:=/tmp/models/bi3d/bi3dnet_segnet.plan \ max_disparity_values:=10
Open a second terminal inside the Docker container:
cd ${ISAAC_ROS_WS}/src/isaac_ros_common && \ ./scripts/run_dev.sh
Visualize the occupancy grid in RViz.
Start RViz:
rviz2
In the left pane, change Fixed Frame to
base_link
.In the left pane, click the Add button, then select By topic followed by Map to add the occupancy grid.
Try More Examples
To continue your exploration, check out the following suggested examples:
API
Usage
ros2 launch isaac_ros_bi3d_freespace isaac_ros_freespace_segmentation.launch.py base_link_frame:=<"name of base link"> camera_frame:=<"name of camera frame"> f_x:=<"focal length in pixels in x dimension"> f_y:=<"focal length in pixels in y dimension"> grid_width:=<"desired grid width"> grid_height:=<"desired grid height"> grid_resolution:=<"desired grid resolution">
ROS Parameters
ROS Parameter |
Type |
Default |
Description |
---|---|---|---|
|
|
|
The name of the |
|
|
|
The name of the |
|
|
|
The focal length in pixels in x dimension |
|
|
|
The focal length in pixels in y dimension |
|
|
|
The width of the output occupancy grid, in number of cells |
|
|
|
The height of the output occupancy grid, in number of cells |
|
|
|
The resolution of the output occupancy grid, in meters per cell |
ROS Topics Subscribed
ROS Topic |
Interface |
Description |
---|---|---|
|
The input disparity image, with pixels corresponding to ground labeled as 0 |
Limitation: For all input images, both the height and width must be an even number of pixels.
ROS Topics Published
ROS Topic |
Interface |
Description |
---|---|---|
|
The output occupancy grid, with cells marked as 0 if free |