Skip to content

Commit e585ce2

Browse files
Isaac ROS 3.2
1 parent a3b8824 commit e585ce2

File tree

462 files changed

+12155
-2426
lines changed

Some content is hidden

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

462 files changed

+12155
-2426
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Isaac ROS NITROS is composed of a number of individual packages, each with eithe
3131
`isaac_ros_nitros_type`:
3232
: This folder contains a number of packages, each defining a specific NITROS type and the associated type adaptation logic to convert to and from a standard ROS type.
3333

34+
`isaac_ros_pynitros`:
35+
: This folder contains the implementation of Python NITROS.
36+
3437
---
3538

3639
## Documentation
@@ -45,11 +48,28 @@ Please visit the [Isaac ROS Documentation](https://nvidia-isaac-ros.github.io/re
4548
* [`isaac_ros_managed_nitros`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_managed_nitros/index.html)
4649
* [`isaac_ros_nitros`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros/index.html)
4750
* [Quickstart](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros/index.html#quickstart)
51+
* [Isaac ROS NITROS Bridge](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html)
52+
* [Overview](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#overview)
53+
* [Performance](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#performance)
54+
* [Packages](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#packages)
55+
* [Quickstart](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#quickstart)
56+
* [Try Another Example](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#try-another-example)
57+
* [Troubleshooting](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#troubleshooting)
58+
* [Updates](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#updates)
59+
* [`isaac_ros_nitros_bridge_ros1`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/isaac_ros_nitros_bridge_ros1/index.html)
60+
* [API](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/isaac_ros_nitros_bridge_ros1/index.html#api)
61+
* [`isaac_ros_nitros_bridge_ros2`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/isaac_ros_nitros_bridge_ros2/index.html)
62+
* [API](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/isaac_ros_nitros_bridge_ros2/index.html#api)
4863
* [`isaac_ros_nitros_interfaces`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_interfaces/index.html)
4964
* [`isaac_ros_nitros_topic_tools`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_topic_tools/index.html)
5065
* [NitrosCameraDrop Node](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_topic_tools/index.html#nitroscameradrop-node)
5166
* [`isaac_ros_nitros_type`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_type/index.html)
67+
* [`isaac_ros_pynitros`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_pynitros/index.html)
68+
* [Creating PyNITROS-Accelerated Nodes](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_pynitros/index.html#creating-pynitros-accelerated-nodes)
69+
* [Quickstart](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_pynitros/index.html#quickstart)
70+
* [Try More Examples](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_pynitros/index.html#try-more-examples)
71+
* [API Reference](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_pynitros/index.html#api-reference)
5272

5373
## Latest
5474

55-
Update 2024-09-26: Update for Isaac ROS 3.1
75+
Update 2024-12-10: Update to be compatible with JetPack 6.1

isaac_ros_gxf/CMakeLists.txt

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ install(
3434

3535
# Install extensions directory
3636
if( ${ARCHITECTURE} STREQUAL "x86_64" )
37-
install(DIRECTORY gxf/core/lib/gxf_x86_64_cuda_12_2/ DESTINATION share/${PROJECT_NAME}/gxf/lib)
38-
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_2/core/libgxf_core.so DESTINATION lib)
39-
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_2/logger/libgxf_logger.so DESTINATION lib)
40-
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_2/multimedia/libgxf_multimedia.so DESTINATION lib)
41-
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_2/cuda/libgxf_cuda.so DESTINATION lib)
37+
install(DIRECTORY gxf/core/lib/gxf_x86_64_cuda_12_6/ DESTINATION share/${PROJECT_NAME}/gxf/lib)
38+
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_6/core/libgxf_core.so DESTINATION lib)
39+
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_6/logger/libgxf_logger.so DESTINATION lib)
40+
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_6/multimedia/libgxf_multimedia.so DESTINATION lib)
41+
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_6/cuda/libgxf_cuda.so DESTINATION lib)
4242
elseif( ${ARCHITECTURE} STREQUAL "aarch64" )
43-
install(DIRECTORY gxf/core/lib/gxf_jetpack60/ DESTINATION share/${PROJECT_NAME}/gxf/lib)
44-
install(FILES gxf/core/lib/gxf_jetpack60/core/libgxf_core.so DESTINATION lib)
45-
install(FILES gxf/core/lib/gxf_jetpack60/logger/libgxf_logger.so DESTINATION lib)
46-
install(FILES gxf/core/lib/gxf_jetpack60/multimedia/libgxf_multimedia.so DESTINATION lib)
47-
install(FILES gxf/core/lib/gxf_jetpack60/cuda/libgxf_cuda.so DESTINATION lib)
43+
install(DIRECTORY gxf/core/lib/gxf_jetpack61/ DESTINATION share/${PROJECT_NAME}/gxf/lib)
44+
install(FILES gxf/core/lib/gxf_jetpack61/core/libgxf_core.so DESTINATION lib)
45+
install(FILES gxf/core/lib/gxf_jetpack61/logger/libgxf_logger.so DESTINATION lib)
46+
install(FILES gxf/core/lib/gxf_jetpack61/multimedia/libgxf_multimedia.so DESTINATION lib)
47+
install(FILES gxf/core/lib/gxf_jetpack61/cuda/libgxf_cuda.so DESTINATION lib)
4848
endif()
4949

5050
# Register cmake in install.
@@ -124,4 +124,10 @@ if(BUILD_TESTING)
124124
ament_lint_auto_find_test_dependencies()
125125
endif()
126126

127+
128+
# Embed versioning information into installed files
129+
ament_index_get_resource(ISAAC_ROS_COMMON_CMAKE_PATH isaac_ros_common_cmake_path isaac_ros_common)
130+
include("${ISAAC_ROS_COMMON_CMAKE_PATH}/isaac_ros_common-version-info.cmake")
131+
generate_version_info(${PROJECT_NAME})
132+
127133
ament_auto_package(INSTALL_TO_SHARE cmake)

isaac_ros_gxf/gxf/core/include/common/assert.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,15 @@
126126
std::to_string(_vb).c_str()); \
127127
}
128128

129+
// Asserts that abs(A - B) <= abs_error. If not prints a panic message and aborts the program.
130+
#define GXF_ASSERT_NEAR(exp_a, exp_b, exp_abs_error) \
131+
{ \
132+
const auto _va = exp_a; \
133+
const auto _vb = exp_b; \
134+
const auto _verror = exp_abs_error; \
135+
GXF_ASSERT(std::abs(_va - _vb) <= _verror, "Assert failed: abs(%s - %s) <= %s.", \
136+
std::to_string(_va).c_str(), std::to_string(_vb).c_str(), \
137+
std::to_string(_verror).c_str()); \
138+
}
139+
129140
#endif // NVIDIA_COMMON_ASSERT_HPP_

isaac_ros_gxf/gxf/core/include/common/fixed_vector.hpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class FixedVectorBase {
5757
kArgumentOutOfRange, // Argument is out of valid range
5858
kContainerEmpty, // Container is empty
5959
kContainerFull, // Container is fixed and reached max capacity
60+
kInvalidIterator, // Iterator is invalid
6061
};
6162

6263
// Expected type which uses class specific errors
@@ -187,6 +188,27 @@ class FixedVectorBase {
187188
constexpr Expected<void> insert(size_t index, T&& obj) {
188189
return emplace(index, std::forward<T>(obj));
189190
}
191+
192+
// Insert elements from another fixed vector object to the specified index
193+
constexpr Expected<void> insert(iterator index, iterator start, iterator end) {
194+
size_t count = static_cast<size_t>(std::distance(start, end));
195+
size_t pos = static_cast<size_t>(std::distance(begin(), index));
196+
if ((pos > size_) || (pos + count > capacity_) || (count < 0)) {
197+
return Unexpected<Error>{Error::kArgumentOutOfRange};
198+
}
199+
200+
auto maybe_value = *start;
201+
if (maybe_value) {
202+
T* ptr = &(*maybe_value);
203+
ArrayCopyConstruct(BytePointer(data_ + pos), ptr, count);
204+
size_ += count;
205+
} else {
206+
return Unexpected<Error>{Error::kInvalidIterator};
207+
}
208+
209+
return kSuccess;
210+
}
211+
190212
// Copies the object to the end of the vector
191213
constexpr Expected<void> push_back(const T& obj) { return emplace_back(obj); }
192214
// Moves the object to the end of the vector

isaac_ros_gxf/gxf/core/include/common/type_name.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
#include <cstdint>
2121

2222
#if defined(__clang__)
23-
// Not yet implemented
23+
inline char* TypenameAsStringImpl(const char* begin, char* output, int32_t max_length) {
24+
// Return nullptr since this is not implemented
25+
return nullptr;
26+
}
2427
#elif defined(__GNUC__)
2528
#include "type_name_gnuc.hpp"
2629
#elif defined(_MSC_VER)

isaac_ros_gxf/gxf/core/include/gxf/app/application.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,28 +162,28 @@ class Application : public Segment {
162162
* each segment is launched asynchronously and this thread is blocked until each one of
163163
* the segments have finished execution. If the graph contains multiple entities,
164164
* then this thread is blocked until the graph execution is complete.
165-
* @return gxf_result_t On success the function returns GXF_SUCCESS.
165+
* @return Expected<void> Success or error code
166166
*/
167167
Expected<void> run();
168168

169169
/**
170170
* @brief A non blocking api call to run an application. If the application contains multiple
171171
* segments, each segment is launched asynchronously.
172-
* @return gxf_result_t On success the function returns GXF_SUCCESS.
172+
* @return Expected<void> Success or error code
173173
*/
174174
Expected<void> runAsync();
175175

176176
/**
177177
* @brief A non blocking api to stop all running running segments or entities.
178178
*
179-
* @return gxf_result_t On success the function returns GXF_SUCCESS.
179+
* @return Expected<void> Success or error code
180180
*/
181181
Expected<void> interrupt();
182182

183183
/**
184184
* @brief A blocking API to waits until the graph execution has completed
185185
*
186-
* @return gxf_result_t On success the function returns GXF_SUCCESS.
186+
* @return Expected<void> Success or error code
187187
*/
188188
Expected<void> wait();
189189

@@ -284,6 +284,7 @@ class Application : public Segment {
284284
Expected<void> activate();
285285
Expected<void> deactivate();
286286
Expected<void> finalize();
287+
Expected<void> setupCrashHandler();
287288

288289
std::map<std::string, std::shared_ptr<Segment>> segments_;
289290
std::map<std::string, std::shared_ptr<Segment>> segments_plan_;

isaac_ros_gxf/gxf/core/include/gxf/app/arg.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct ArgOverride<Handle<T>> {
9292
GXF_LOG_ERROR("Unable to find the entity for %s", c_name.c_str());
9393
return Unexpected{result};
9494
}
95-
result = GxfParameterGetStr(value.context(), eid, kInternalNameParameterKey, &entity_name);
95+
result = GxfEntityGetName(value.context(), eid, &entity_name);
9696
if (result != GXF_SUCCESS) {
9797
GXF_LOG_ERROR("Unable to get the entity name");
9898
return Unexpected{result};
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
2+
// Copyright (c) 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 NVIDIA_GXF_ENTITY_GROUP_HPP_
19+
#define NVIDIA_GXF_ENTITY_GROUP_HPP_
20+
21+
#include <map>
22+
#include <memory>
23+
#include <string>
24+
#include <vector>
25+
26+
#include "gxf/app/graph_entity.hpp"
27+
28+
namespace nvidia {
29+
namespace gxf {
30+
31+
/**
32+
* @brief A wrapper over EntityGroup C APIs to manage a programmable
33+
* entity group in C++ API layer
34+
*
35+
*/
36+
class EntityGroup {
37+
public:
38+
EntityGroup() = default;
39+
40+
~EntityGroup() = default;
41+
42+
EntityGroup(const EntityGroup&) = delete;
43+
44+
EntityGroup& operator=(const EntityGroup&) = delete;
45+
46+
/**
47+
* @brief Creates a programmable entity group with the runtime context and sets its name
48+
*
49+
* @param context A valid GXF context
50+
* @param name Name of the graph entity
51+
*/
52+
Expected<void> setup(gxf_context_t context, const char* name);
53+
54+
/**
55+
* @brief Add single entity into this entity group.
56+
* All Resouce components within the group will be automatically resolved to owner components
57+
* that has corresponding type of Resource members registered.
58+
*
59+
* @param GraphEntityPtr An entity in C++ API representation
60+
*/
61+
Expected<void> add(GraphEntityPtr entity);
62+
63+
/**
64+
* @brief Add a list of entities into this entity group.
65+
* All Resouce components within the group will be automatically resolved to owner components
66+
* that has corresponding type of Resource members registered.
67+
*
68+
* @param entity_members A list of entities in C++ API representation
69+
*/
70+
Expected<void> add(std::vector<GraphEntityPtr> entity_members);
71+
72+
/**
73+
* @return This entity group ID.
74+
*/
75+
gxf_uid_t gid() const { return gid_; }
76+
77+
/**
78+
* @return This entity group name.
79+
*/
80+
std::string name() const { return name_; }
81+
82+
private:
83+
gxf_uid_t gid_{kNullUid};
84+
std::string name_;
85+
std::map<std::string, GraphEntityPtr> entity_members_;
86+
};
87+
88+
typedef std::shared_ptr<EntityGroup> EntityGroupPtr;
89+
90+
} // namespace gxf
91+
} // namespace nvidia
92+
93+
#endif // NVIDIA_GXF_ENTITY_GROUP_HPP_

isaac_ros_gxf/gxf/core/include/gxf/app/graph_entity.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ class GraphEntity {
8181
* @tparam T Type of component. Must be derived from nvidia::gxf::Component
8282
* @param name Name of the component
8383
* @param args Args must be of type Arg
84-
* @return Handle<T> Handle to newly created component
84+
* @return Handle<T> Handle to newly created component. Null handle if component was not created.
8585
*/
8686
template <typename T, typename... Args>
8787
Handle<T> add(const char* name = nullptr, Args... args) {
8888
std::vector<Arg> arg_list;
8989
if constexpr (sizeof...(args) > 0) { arg_list = parseArgsOfType<Arg>(args...); }
90-
return add<T>(name, arg_list);
90+
return add<T>(name, std::move(arg_list));
9191
}
9292

9393
/**
@@ -98,7 +98,7 @@ class GraphEntity {
9898
* @tparam T Type of component. Must be derived from nvidia::gxf::Component
9999
* @param name Name of the component
100100
* @param arg_list vector of Arg used for initializing the component's parameters.
101-
* @return Handle<T> Handle to newly created component
101+
* @return Handle<T> Handle to newly created component. Null handle if component was not created.
102102
*/
103103
template <typename T>
104104
Handle<T> add(const char* name, std::vector<Arg> arg_list) {
@@ -115,7 +115,7 @@ class GraphEntity {
115115
*/
116116
template <typename T, size_t N = kMaxComponents>
117117
FixedVector<Handle<T>, N> findAll() const {
118-
auto maybe_result = entity_.findAll<T>();
118+
auto maybe_result = entity_.findAll<T, N>();
119119
return maybe_result ? maybe_result.value() : FixedVector<Handle<T>, N>();
120120
}
121121

@@ -685,7 +685,7 @@ class GraphEntity {
685685
// resource lookup by name
686686
std::map<std::string, Handle<ResourceBase>> resources_;
687687

688-
gxf_uid_t eid_;
688+
gxf_uid_t eid_{kNullUid};
689689
Entity entity_;
690690
};
691691

0 commit comments

Comments
 (0)