Skip to content

Commit 955df88

Browse files
committed
Isaac ROS 3.0.0
1 parent 4759a95 commit 955df88

File tree

62 files changed

+2961
-2626
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2961
-2626
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
# ROS Bags
2323
**/resources/**/*.db3 filter=lfs diff=lfs merge=lfs -text
2424
**/resources/**/*.yaml filter=lfs diff=lfs merge=lfs -text
25-
isaac_ros_visual_slam/test/test_cases/rosbags/** filter=lfs diff=lfs merge=lfs -text
25+
isaac_ros_visual_slam/test/test_cases/rosbags/** filter=lfs diff=lfs merge=lfs -text

README.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Isaac ROS Visual SLAM
22

3-
Hardware-accelerated, simultaneous localization and mapping (SLAM) using stereo visual inertial odometry (SVIO).
3+
NVIDIA-accelerated, simultaneous localization and mapping (SLAM) using stereo
4+
visual inertial odometry (SVIO).
45

56
<div align="center"><a class="reference internal image-reference" href="https://media.githubusercontent.com/media/NVIDIA-ISAAC-ROS/.github/main/resources/isaac_ros_docs/repositories_and_packages/isaac_ros_visual_slam/cuvslam_ros_3.gif/"><img alt="image" src="https://media.githubusercontent.com/media/NVIDIA-ISAAC-ROS/.github/main/resources/isaac_ros_docs/repositories_and_packages/isaac_ros_visual_slam/cuvslam_ros_3.gif/" width="800px"/></a></div>
67

@@ -16,32 +17,32 @@ Jetson](https://gateway.on24.com/wcc/experience/elitenvidiabrill/1407606/3998202
1617

1718
## Overview
1819

19-
[Isaac ROS Visual SLAM](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_visual_slam) provides a high-performance, best-in-class ROS 2 package
20+
[Isaac ROS Visual SLAM](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_visual_slam)
21+
provides a high-performance, best-in-class ROS 2 package
2022
for VSLAM (visual simultaneous localization and mapping). This package
21-
uses a stereo camera with an IMU to estimate odometry as an input to
22-
navigation. It is GPU accelerated to provide real-time, low-latency
23-
results in a robotics application. VSLAM provides an additional odometry
24-
source for mobile robots (ground based) and can be the primary odometry
25-
source for drones.
23+
uses one or more stereo cameras and optionally an IMU to estimate
24+
odometry as an input to navigation. It is GPU accelerated to provide
25+
real-time, low-latency results in a robotics application. VSLAM
26+
provides an additional odometry source for mobile robots
27+
(ground based) and can be the primary odometry source for drones.
2628

2729
VSLAM provides a method for visually estimating the position of a robot
2830
relative to its start position, known as VO (visual odometry). This is
2931
particularly useful in environments where GPS is not available (such as
3032
indoors) or intermittent (such as urban locations with structures
3133
blocking line of sight to GPS satellites). This method is designed to
32-
use left and right stereo camera frames and an IMU (inertial measurement
33-
unit) as input. It uses input stereo image pairs to find matching key
34-
points in the left and right images; using the baseline between the left
35-
and right camera, it can estimate the distance to the key point. Using
36-
two consecutive input stereo image pairs, VSLAM can track the 3D motion
37-
of key points between the two consecutive images to estimate the 3D
38-
motion of the camera-which is then used to compute odometry as an output
34+
use multiple stereo camera frames and an IMU (inertial measurement
35+
unit) as input. It uses stereo image pairs to find matching key
36+
points. Using the baseline between the camera pairs, it can estimate
37+
the distance to the key point. Using consecutive images, VSLAM
38+
can track the motion of key points to estimate the 3D motion of the
39+
camera-which is then used to compute odometry as an output
3940
to navigation. Compared to the classic approach to VSLAM, this method
4041
uses GPU acceleration to find and match more key points in real-time,
4142
with fine tuning to minimize overall reprojection error.
4243

43-
Key points depend on distinctive features in the left and right camera
44-
image that can be repeatedly detected with changes in size, orientation,
44+
Key points depend on distinctive features in the images
45+
that can be repeatedly detected with changes in size, orientation,
4546
perspective, lighting, and image noise. In some instances, the number of
4647
key points may be limited or entirely absent; for example, if the camera
4748
field of view is only looking at a large solid colored wall, no key
@@ -100,15 +101,19 @@ outdoor scenes.
100101

101102
## Performance
102103

103-
| Sample Graph<br/><br/> | Input Size<br/><br/> | AGX Orin<br/><br/> | Orin NX<br/><br/> | Orin Nano 8GB<br/><br/> | x86_64 w/ RTX 4060 Ti<br/><br/> |
104-
|-------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
105-
| [Visual SLAM Node](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_benchmark/blob/main/scripts/isaac_ros_visual_slam_node.py)<br/><br/><br/><br/> | 720p<br/><br/><br/><br/> | [228 fps](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_benchmark/blob/main/results/isaac_ros_visual_slam_node-agx_orin.json)<br/><br/><br/>40 ms<br/><br/> | [127 fps](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_benchmark/blob/main/results/isaac_ros_visual_slam_node-orin_nx.json)<br/><br/><br/>74 ms<br/><br/> | [113 fps](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_benchmark/blob/main/results/isaac_ros_visual_slam_node-orin_nano.json)<br/><br/><br/>65 ms<br/><br/> | [456 fps](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_benchmark/blob/main/results/isaac_ros_visual_slam_node-nuc_4060ti.json)<br/><br/><br/>37 ms<br/><br/> |
104+
| Sample Graph<br/><br/> | Input Size<br/><br/> | Nova Carter<br/><br/> |
105+
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
106+
| [Multicam Visual SLAM Live Graph](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_benchmark/blob/main/benchmarks/isaac_ros_perceptor_nova_benchmark/scripts/isaac_ros_visual_slam_graph.py)<br/><br/><br/>4 Hawk Cameras<br/><br/> | 1200p<br/><br/><br/><br/> | [30.0 fps](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_benchmark/blob/main/results/isaac_ros_4_hawk_vslam_graph-carter_v2.4.json)<br/><br/><br/><br/> |
107+
108+
> [!Note]
109+
> This benchmark can only be run on a [Nova Orin](https://developer.nvidia.com/isaac/nova-orin) compatible system.
106110
107111
---
108112

109113
## Documentation
110114

111-
Please visit the [Isaac ROS Documentation](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_visual_slam/index.html) to learn how to use this repository.
115+
Please visit the [Isaac ROS Documentation](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_visual_slam/index.html) to learn how to use
116+
this repository.
112117

113118
---
114119

@@ -124,4 +129,4 @@ Please visit the [Isaac ROS Documentation](https://nvidia-isaac-ros.github.io/re
124129

125130
## Latest
126131

127-
Update 2023-10-18: Improved stability.
132+
Update 2024-05-30: Add support for multi-cam VIO

isaac_ros_visual_slam/CMakeLists.txt

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
2-
# Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -45,24 +45,19 @@ endforeach()
4545

4646
include_directories(${CUVSLAM}/include)
4747
add_library(cuvslam SHARED IMPORTED)
48-
if( ${ARCHITECTURE} STREQUAL "x86_64" )
49-
set_property(TARGET cuvslam PROPERTY IMPORTED_LOCATION ${CUVSLAM}/lib_x86_64_cuda_11_8/libcuvslam.so)
50-
elseif( ${ARCHITECTURE} STREQUAL "aarch64" )
51-
set_property(TARGET cuvslam PROPERTY IMPORTED_LOCATION ${CUVSLAM}/lib_aarch64_jetpack51/libcuvslam.so)
52-
endif()
48+
set_property(TARGET cuvslam PROPERTY IMPORTED_LOCATION ${CUVSLAM}/lib/libcuvslam.so)
5349

5450
# visual_slam_node
5551
ament_auto_add_library(
5652
visual_slam_node SHARED
5753
src/visual_slam_node.cpp
58-
src/impl/cuvslam_ros_convertion.cpp
54+
src/impl/cuvslam_ros_conversion.cpp
5955
src/impl/landmarks_vis_helper.cpp
6056
src/impl/localizer_vis_helper.cpp
6157
src/impl/pose_cache.cpp
6258
src/impl/posegraph_vis_helper.cpp
6359
src/impl/visual_slam_impl.cpp
6460
src/impl/viz_helper.cpp
65-
src/impl/qos.cpp
6661
)
6762
target_link_libraries(visual_slam_node cuvslam)
6863
rclcpp_components_register_nodes(visual_slam_node "nvidia::isaac_ros::visual_slam::VisualSlamNode")
@@ -75,27 +70,30 @@ ament_auto_add_executable(${PROJECT_NAME}
7570
target_link_libraries(${PROJECT_NAME} visual_slam_node)
7671

7772
# Install cuVSLAM
78-
if( ${ARCHITECTURE} STREQUAL "x86_64" )
79-
install(DIRECTORY ${CUVSLAM}/lib_x86_64_cuda_11_8/ DESTINATION share/cuvslam)
80-
elseif( ${ARCHITECTURE} STREQUAL "aarch64" )
81-
install(DIRECTORY ${CUVSLAM}/lib_aarch64_jetpack51/ DESTINATION share/cuvslam)
82-
endif()
83-
set_target_properties(visual_slam_node PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
84-
set_target_properties(visual_slam_node PROPERTIES INSTALL_RPATH "$ORIGIN/../share/cuvslam")
73+
install(DIRECTORY ${CUVSLAM}/lib DESTINATION share/cuvslam)
74+
75+
set_target_properties(visual_slam_node PROPERTIES
76+
BUILD_WITH_INSTALL_RPATH TRUE
77+
BUILD_RPATH_USE_ORIGIN TRUE
78+
INSTALL_RPATH_USE_LINK_PATH TRUE
79+
INSTALL_RPATH "$ORIGIN/../share/cuvslam")
80+
8581

8682
if(BUILD_TESTING)
8783
find_package(ament_lint_auto REQUIRED)
8884
ament_lint_auto_find_test_dependencies()
8985

90-
9186
# The FindPythonInterp and FindPythonLibs modules are removed
9287
if(POLICY CMP0148)
9388
cmake_policy(SET CMP0148 OLD)
9489
endif()
9590

9691
find_package(launch_testing_ament_cmake REQUIRED)
97-
add_launch_test(test/isaac_ros_visual_slam_pol.py)
98-
add_launch_test(test/isaac_ros_visual_slam_srv.py)
92+
add_launch_test(test/isaac_ros_visual_slam_pol_single_cam_imu.py)
93+
add_launch_test(test/isaac_ros_visual_slam_pol_multi_cam_imu.py)
94+
add_launch_test(test/isaac_ros_visual_slam_srv_reset.py)
95+
add_launch_test(test/isaac_ros_visual_slam_srv_get_all_poses.py)
96+
add_launch_test(test/isaac_ros_visual_slam_srv_set_slam_pose.py)
9997

10098
find_package(ament_cmake_gtest REQUIRED)
10199
ament_add_gtest(${PROJECT_NAME}_test_message_buffer test/test_message_buffer.cpp)
@@ -115,6 +113,18 @@ if(BUILD_TESTING)
115113
ament_target_dependencies(${PROJECT_NAME}_test_message_stream_sequencer
116114
std_msgs
117115
)
116+
117+
ament_add_gtest(${PROJECT_NAME}_test_message_stream_synchronizer
118+
test/test_message_stream_synchronizer.cpp
119+
)
120+
target_include_directories(${PROJECT_NAME}_test_message_stream_synchronizer PUBLIC
121+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
122+
$<INSTALL_INTERFACE:include>
123+
)
124+
ament_target_dependencies(${PROJECT_NAME}_test_message_stream_synchronizer
125+
rclcpp
126+
geometry_msgs
127+
)
118128
endif()
119129

120-
ament_auto_package(INSTALL_TO_SHARE config launch params)
130+
ament_auto_package(INSTALL_TO_SHARE config launch rviz)
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
2+
// Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
// SPDX-License-Identifier: Apache-2.0
17+
18+
#ifndef ISAAC_ROS_VISUAL_SLAM__IMPL__CUVSLAM_ROS_CONVERSION_HPP_
19+
#define ISAAC_ROS_VISUAL_SLAM__IMPL__CUVSLAM_ROS_CONVERSION_HPP_
20+
21+
#include <string>
22+
23+
#include "cuvslam.h" // NOLINT - include .h without directory
24+
#include "cv_bridge/cv_bridge.h"
25+
#include "isaac_ros_visual_slam/impl/types.hpp"
26+
#include "tf2/LinearMath/Transform.h"
27+
#include "eigen3/Eigen/Eigen"
28+
29+
namespace nvidia
30+
{
31+
namespace isaac_ros
32+
{
33+
namespace visual_slam
34+
{
35+
36+
// Transformation converting from
37+
// Canonical ROS Frame (x-forward, y-left, z-up) to
38+
// cuVSLAM Frame (x-right, y-up, z-backward)
39+
// ROS -> cuVSLAM
40+
// x -> -z
41+
// y -> -x
42+
// z -> y
43+
const tf2::Transform cuvslam_pose_canonical(tf2::Matrix3x3(
44+
0, -1, 0,
45+
0, 0, 1,
46+
-1, 0, 0
47+
));
48+
49+
// Transformation converting from
50+
// cuVSLAM Frame (x-right, y-up, z-backward) to
51+
// Canonical ROS Frame (x-forward, y-left, z-up)
52+
const tf2::Transform canonical_pose_cuvslam(cuvslam_pose_canonical.inverse());
53+
54+
// Transformation converting from
55+
// Optical Frame (x-right, y-down, z-forward) to
56+
// cuVSLAM Frame (x-right, y-up, z-backward)
57+
// Optical -> cuVSLAM
58+
// x -> x
59+
// y -> -y
60+
// z -> -z
61+
const tf2::Transform cuvslam_pose_optical(tf2::Matrix3x3(
62+
1, 0, 0,
63+
0, -1, 0,
64+
0, 0, -1
65+
));
66+
67+
// Transformation converting from
68+
// cuVSLAM Frame (x-right, y-up, z-backward) to
69+
// Optical Frame (x-right, y-down, z-forward)
70+
const tf2::Transform optical_pose_cuvslam(cuvslam_pose_optical.inverse());
71+
72+
tf2::Transform ChangeBasis(
73+
const tf2::Transform & target_pose_source, const tf2::Transform & source_pose_source);
74+
75+
CUVSLAM_Pose TocuVSLAMPose(const tf2::Transform & tf_mat);
76+
tf2::Transform FromcuVSLAMPose(const CUVSLAM_Pose & cuvslam_pose);
77+
78+
CUVSLAM_ImageEncoding TocuVSLAMImageEncoding(const std::string & image_encoding);
79+
80+
CUVSLAM_Image TocuVSLAMImage(
81+
int32_t camera_index, const ImageType & image_view, const int64_t & acqtime_ns);
82+
83+
CUVSLAM_ImuMeasurement TocuVSLAMImuMeasurement(const ImuType::ConstSharedPtr & msg_imu);
84+
85+
void FillIntrinsics(const CameraInfoType::ConstSharedPtr & msg, CUVSLAM_Camera & camera);
86+
87+
void FillExtrinsics(const tf2::Transform & base_pose_camera_optical, CUVSLAM_Camera & camera);
88+
89+
Eigen::Matrix<float, 6, 6> FromcuVSLAMCovariance(float covariance[36]);
90+
91+
} // namespace visual_slam
92+
} // namespace isaac_ros
93+
} // namespace nvidia
94+
95+
#endif // ISAAC_ROS_VISUAL_SLAM__IMPL__CUVSLAM_ROS_CONVERSION_HPP_

isaac_ros_visual_slam/include/isaac_ros_visual_slam/impl/cuvslam_ros_convertion.hpp

Lines changed: 0 additions & 42 deletions
This file was deleted.

isaac_ros_visual_slam/include/isaac_ros_visual_slam/impl/has_subscribers.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
2-
// Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
// Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
55
// you may not use this file except in compliance with the License.
66
// You may obtain a copy of the License at
77
//
8-
// http://www.apache.org/licenses/LICENSE-2.0
8+
// http://www.apache.org/licenses/LICENSE-2.0
99
//
1010
// Unless required by applicable law or agreed to in writing, software
1111
// distributed under the License is distributed on an "AS IS" BASIS,

isaac_ros_visual_slam/include/isaac_ros_visual_slam/impl/landmarks_vis_helper.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
2-
// Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
// Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
55
// you may not use this file except in compliance with the License.
66
// You may obtain a copy of the License at
77
//
8-
// http://www.apache.org/licenses/LICENSE-2.0
8+
// http://www.apache.org/licenses/LICENSE-2.0
99
//
1010
// Unless required by applicable law or agreed to in writing, software
1111
// distributed under the License is distributed on an "AS IS" BASIS,

isaac_ros_visual_slam/include/isaac_ros_visual_slam/impl/limited_vector.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
2-
// Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
// Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
55
// you may not use this file except in compliance with the License.
66
// You may obtain a copy of the License at
77
//
8-
// http://www.apache.org/licenses/LICENSE-2.0
8+
// http://www.apache.org/licenses/LICENSE-2.0
99
//
1010
// Unless required by applicable law or agreed to in writing, software
1111
// distributed under the License is distributed on an "AS IS" BASIS,

isaac_ros_visual_slam/include/isaac_ros_visual_slam/impl/localizer_vis_helper.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
2-
// Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
// Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
55
// you may not use this file except in compliance with the License.
66
// You may obtain a copy of the License at
77
//
8-
// http://www.apache.org/licenses/LICENSE-2.0
8+
// http://www.apache.org/licenses/LICENSE-2.0
99
//
1010
// Unless required by applicable law or agreed to in writing, software
1111
// distributed under the License is distributed on an "AS IS" BASIS,

0 commit comments

Comments
 (0)