Skip to content

Commit

Permalink
Merge pull request #50 from NVIDIA-ISAAC-ROS/release-3.2
Browse files Browse the repository at this point in the history
Isaac ROS 3.2
  • Loading branch information
jaiveersinghNV authored Dec 11, 2024
2 parents a3b8824 + e585ce2 commit 9173278
Show file tree
Hide file tree
Showing 462 changed files with 12,155 additions and 2,426 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Isaac ROS NITROS is composed of a number of individual packages, each with eithe
`isaac_ros_nitros_type`:
: 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.

`isaac_ros_pynitros`:
: This folder contains the implementation of Python NITROS.

---

## Documentation
Expand All @@ -45,11 +48,28 @@ Please visit the [Isaac ROS Documentation](https://nvidia-isaac-ros.github.io/re
* [`isaac_ros_managed_nitros`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_managed_nitros/index.html)
* [`isaac_ros_nitros`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros/index.html)
* [Quickstart](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros/index.html#quickstart)
* [Isaac ROS NITROS Bridge](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html)
* [Overview](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#overview)
* [Performance](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#performance)
* [Packages](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#packages)
* [Quickstart](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#quickstart)
* [Try Another Example](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#try-another-example)
* [Troubleshooting](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#troubleshooting)
* [Updates](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_bridge/index.html#updates)
* [`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)
* [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)
* [`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)
* [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)
* [`isaac_ros_nitros_interfaces`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_interfaces/index.html)
* [`isaac_ros_nitros_topic_tools`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_topic_tools/index.html)
* [NitrosCameraDrop Node](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_topic_tools/index.html#nitroscameradrop-node)
* [`isaac_ros_nitros_type`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_nitros_type/index.html)
* [`isaac_ros_pynitros`](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_pynitros/index.html)
* [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)
* [Quickstart](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_pynitros/index.html#quickstart)
* [Try More Examples](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_pynitros/index.html#try-more-examples)
* [API Reference](https://nvidia-isaac-ros.github.io/repositories_and_packages/isaac_ros_nitros/isaac_ros_pynitros/index.html#api-reference)

## Latest

Update 2024-09-26: Update for Isaac ROS 3.1
Update 2024-12-10: Update to be compatible with JetPack 6.1
26 changes: 16 additions & 10 deletions isaac_ros_gxf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ install(

# Install extensions directory
if( ${ARCHITECTURE} STREQUAL "x86_64" )
install(DIRECTORY gxf/core/lib/gxf_x86_64_cuda_12_2/ DESTINATION share/${PROJECT_NAME}/gxf/lib)
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_2/core/libgxf_core.so DESTINATION lib)
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_2/logger/libgxf_logger.so DESTINATION lib)
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_2/multimedia/libgxf_multimedia.so DESTINATION lib)
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_2/cuda/libgxf_cuda.so DESTINATION lib)
install(DIRECTORY gxf/core/lib/gxf_x86_64_cuda_12_6/ DESTINATION share/${PROJECT_NAME}/gxf/lib)
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_6/core/libgxf_core.so DESTINATION lib)
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_6/logger/libgxf_logger.so DESTINATION lib)
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_6/multimedia/libgxf_multimedia.so DESTINATION lib)
install(FILES gxf/core/lib/gxf_x86_64_cuda_12_6/cuda/libgxf_cuda.so DESTINATION lib)
elseif( ${ARCHITECTURE} STREQUAL "aarch64" )
install(DIRECTORY gxf/core/lib/gxf_jetpack60/ DESTINATION share/${PROJECT_NAME}/gxf/lib)
install(FILES gxf/core/lib/gxf_jetpack60/core/libgxf_core.so DESTINATION lib)
install(FILES gxf/core/lib/gxf_jetpack60/logger/libgxf_logger.so DESTINATION lib)
install(FILES gxf/core/lib/gxf_jetpack60/multimedia/libgxf_multimedia.so DESTINATION lib)
install(FILES gxf/core/lib/gxf_jetpack60/cuda/libgxf_cuda.so DESTINATION lib)
install(DIRECTORY gxf/core/lib/gxf_jetpack61/ DESTINATION share/${PROJECT_NAME}/gxf/lib)
install(FILES gxf/core/lib/gxf_jetpack61/core/libgxf_core.so DESTINATION lib)
install(FILES gxf/core/lib/gxf_jetpack61/logger/libgxf_logger.so DESTINATION lib)
install(FILES gxf/core/lib/gxf_jetpack61/multimedia/libgxf_multimedia.so DESTINATION lib)
install(FILES gxf/core/lib/gxf_jetpack61/cuda/libgxf_cuda.so DESTINATION lib)
endif()

# Register cmake in install.
Expand Down Expand Up @@ -124,4 +124,10 @@ if(BUILD_TESTING)
ament_lint_auto_find_test_dependencies()
endif()


# Embed versioning information into installed files
ament_index_get_resource(ISAAC_ROS_COMMON_CMAKE_PATH isaac_ros_common_cmake_path isaac_ros_common)
include("${ISAAC_ROS_COMMON_CMAKE_PATH}/isaac_ros_common-version-info.cmake")
generate_version_info(${PROJECT_NAME})

ament_auto_package(INSTALL_TO_SHARE cmake)
11 changes: 11 additions & 0 deletions isaac_ros_gxf/gxf/core/include/common/assert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,15 @@
std::to_string(_vb).c_str()); \
}

// Asserts that abs(A - B) <= abs_error. If not prints a panic message and aborts the program.
#define GXF_ASSERT_NEAR(exp_a, exp_b, exp_abs_error) \
{ \
const auto _va = exp_a; \
const auto _vb = exp_b; \
const auto _verror = exp_abs_error; \
GXF_ASSERT(std::abs(_va - _vb) <= _verror, "Assert failed: abs(%s - %s) <= %s.", \
std::to_string(_va).c_str(), std::to_string(_vb).c_str(), \
std::to_string(_verror).c_str()); \
}

#endif // NVIDIA_COMMON_ASSERT_HPP_
22 changes: 22 additions & 0 deletions isaac_ros_gxf/gxf/core/include/common/fixed_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class FixedVectorBase {
kArgumentOutOfRange, // Argument is out of valid range
kContainerEmpty, // Container is empty
kContainerFull, // Container is fixed and reached max capacity
kInvalidIterator, // Iterator is invalid
};

// Expected type which uses class specific errors
Expand Down Expand Up @@ -187,6 +188,27 @@ class FixedVectorBase {
constexpr Expected<void> insert(size_t index, T&& obj) {
return emplace(index, std::forward<T>(obj));
}

// Insert elements from another fixed vector object to the specified index
constexpr Expected<void> insert(iterator index, iterator start, iterator end) {
size_t count = static_cast<size_t>(std::distance(start, end));
size_t pos = static_cast<size_t>(std::distance(begin(), index));
if ((pos > size_) || (pos + count > capacity_) || (count < 0)) {
return Unexpected<Error>{Error::kArgumentOutOfRange};
}

auto maybe_value = *start;
if (maybe_value) {
T* ptr = &(*maybe_value);
ArrayCopyConstruct(BytePointer(data_ + pos), ptr, count);
size_ += count;
} else {
return Unexpected<Error>{Error::kInvalidIterator};
}

return kSuccess;
}

// Copies the object to the end of the vector
constexpr Expected<void> push_back(const T& obj) { return emplace_back(obj); }
// Moves the object to the end of the vector
Expand Down
5 changes: 4 additions & 1 deletion isaac_ros_gxf/gxf/core/include/common/type_name.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
#include <cstdint>

#if defined(__clang__)
// Not yet implemented
inline char* TypenameAsStringImpl(const char* begin, char* output, int32_t max_length) {
// Return nullptr since this is not implemented
return nullptr;
}
#elif defined(__GNUC__)
#include "type_name_gnuc.hpp"
#elif defined(_MSC_VER)
Expand Down
9 changes: 5 additions & 4 deletions isaac_ros_gxf/gxf/core/include/gxf/app/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,28 +162,28 @@ class Application : public Segment {
* each segment is launched asynchronously and this thread is blocked until each one of
* the segments have finished execution. If the graph contains multiple entities,
* then this thread is blocked until the graph execution is complete.
* @return gxf_result_t On success the function returns GXF_SUCCESS.
* @return Expected<void> Success or error code
*/
Expected<void> run();

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

/**
* @brief A non blocking api to stop all running running segments or entities.
*
* @return gxf_result_t On success the function returns GXF_SUCCESS.
* @return Expected<void> Success or error code
*/
Expected<void> interrupt();

/**
* @brief A blocking API to waits until the graph execution has completed
*
* @return gxf_result_t On success the function returns GXF_SUCCESS.
* @return Expected<void> Success or error code
*/
Expected<void> wait();

Expand Down Expand Up @@ -284,6 +284,7 @@ class Application : public Segment {
Expected<void> activate();
Expected<void> deactivate();
Expected<void> finalize();
Expected<void> setupCrashHandler();

std::map<std::string, std::shared_ptr<Segment>> segments_;
std::map<std::string, std::shared_ptr<Segment>> segments_plan_;
Expand Down
2 changes: 1 addition & 1 deletion isaac_ros_gxf/gxf/core/include/gxf/app/arg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct ArgOverride<Handle<T>> {
GXF_LOG_ERROR("Unable to find the entity for %s", c_name.c_str());
return Unexpected{result};
}
result = GxfParameterGetStr(value.context(), eid, kInternalNameParameterKey, &entity_name);
result = GxfEntityGetName(value.context(), eid, &entity_name);
if (result != GXF_SUCCESS) {
GXF_LOG_ERROR("Unable to get the entity name");
return Unexpected{result};
Expand Down
93 changes: 93 additions & 0 deletions isaac_ros_gxf/gxf/core/include/gxf/app/entity_group.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
// SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
// Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

#ifndef NVIDIA_GXF_ENTITY_GROUP_HPP_
#define NVIDIA_GXF_ENTITY_GROUP_HPP_

#include <map>
#include <memory>
#include <string>
#include <vector>

#include "gxf/app/graph_entity.hpp"

namespace nvidia {
namespace gxf {

/**
* @brief A wrapper over EntityGroup C APIs to manage a programmable
* entity group in C++ API layer
*
*/
class EntityGroup {
public:
EntityGroup() = default;

~EntityGroup() = default;

EntityGroup(const EntityGroup&) = delete;

EntityGroup& operator=(const EntityGroup&) = delete;

/**
* @brief Creates a programmable entity group with the runtime context and sets its name
*
* @param context A valid GXF context
* @param name Name of the graph entity
*/
Expected<void> setup(gxf_context_t context, const char* name);

/**
* @brief Add single entity into this entity group.
* All Resouce components within the group will be automatically resolved to owner components
* that has corresponding type of Resource members registered.
*
* @param GraphEntityPtr An entity in C++ API representation
*/
Expected<void> add(GraphEntityPtr entity);

/**
* @brief Add a list of entities into this entity group.
* All Resouce components within the group will be automatically resolved to owner components
* that has corresponding type of Resource members registered.
*
* @param entity_members A list of entities in C++ API representation
*/
Expected<void> add(std::vector<GraphEntityPtr> entity_members);

/**
* @return This entity group ID.
*/
gxf_uid_t gid() const { return gid_; }

/**
* @return This entity group name.
*/
std::string name() const { return name_; }

private:
gxf_uid_t gid_{kNullUid};
std::string name_;
std::map<std::string, GraphEntityPtr> entity_members_;
};

typedef std::shared_ptr<EntityGroup> EntityGroupPtr;

} // namespace gxf
} // namespace nvidia

#endif // NVIDIA_GXF_ENTITY_GROUP_HPP_
10 changes: 5 additions & 5 deletions isaac_ros_gxf/gxf/core/include/gxf/app/graph_entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ class GraphEntity {
* @tparam T Type of component. Must be derived from nvidia::gxf::Component
* @param name Name of the component
* @param args Args must be of type Arg
* @return Handle<T> Handle to newly created component
* @return Handle<T> Handle to newly created component. Null handle if component was not created.
*/
template <typename T, typename... Args>
Handle<T> add(const char* name = nullptr, Args... args) {
std::vector<Arg> arg_list;
if constexpr (sizeof...(args) > 0) { arg_list = parseArgsOfType<Arg>(args...); }
return add<T>(name, arg_list);
return add<T>(name, std::move(arg_list));
}

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

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

gxf_uid_t eid_;
gxf_uid_t eid_{kNullUid};
Entity entity_;
};

Expand Down
Loading

0 comments on commit 9173278

Please sign in to comment.