Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
01f0198
Added CMAKE logic to disable Contact Sensor and Spawner components. (…
michalpelka Mar 21, 2025
9e440b2
Simulation interfaces gem - initial code and features (#848)
michalpelka Apr 2, 2025
bf04076
[SimulationIterfaces] Refactor API to use heavily AZ::Outcome and err…
michalpelka Apr 3, 2025
15a2633
Added ROS2 interface for SimulationInterfaces (#853)
patrykantosz Apr 3, 2025
2b3689b
Added `get_simulation_features` to SimulationInterfaces and Simulatio…
norbertprokopiuk Apr 4, 2025
dbca5f3
Tests for SimulationInterfacesROS2 (#855)
michalpelka Apr 7, 2025
e75f67b
SimulationInterfacesROS2 Gem clean up (#859)
norbertprokopiuk Apr 7, 2025
ffb9a53
Adjust state applying (#858)
michalpelka Apr 7, 2025
a6561a3
Fix undefined behavior in removal already removed simulated entities.…
michalpelka Apr 7, 2025
592e76c
Add allow renaming option to Simulation Interface spawner (#863)
michalpelka Apr 8, 2025
e537b8f
SimulationInterfacesROS2 - added action server for SimulateSteps (#861)
patrykantosz Apr 9, 2025
1f3d834
Simulation interfaces - reset simulator service (#862)
michalpelka Apr 9, 2025
1b38dfa
[Simulation Interfaces] Adjust error code type - ROS2 way, setting fr…
michalpelka Apr 9, 2025
2f96b6f
Fix compilation error in SimulationIterfaceAppTest (#867)
michalpelka Apr 9, 2025
353a245
Removed copied simulation_interfaces msgs (#868)
norbertprokopiuk Apr 9, 2025
6e78d3d
Nprokopiuk/simulation interfaces set simulation state (#871)
norbertprokopiuk Apr 9, 2025
748bf1d
[Simulation Interfaces] Validate Namespace and name (#866)
michalpelka Apr 10, 2025
81d91b6
[Simulation Interfaces] step simulation service (#873)
michalpelka Apr 10, 2025
474c4dc
Adjust capabilities (#872)
michalpelka Apr 10, 2025
2ab4ca2
[Simulation Interfaces] Added simple test for the SimulateSteps actio…
patrykantosz Apr 10, 2025
42765e0
[Simulation Interfaces] Support for reset state (#875)
michalpelka Apr 10, 2025
36b835b
Simulation Interfaces Gems merge (#877)
norbertprokopiuk Apr 10, 2025
d6bd8b5
Simulation Interfaces hotfixes (#879)
norbertprokopiuk Apr 11, 2025
5d40454
Fix for wrong simulation state after reset (#883)
norbertprokopiuk Apr 14, 2025
7b66b1b
Fix for articulations (#887)
michalpelka Apr 15, 2025
6109f38
Use simulated body request instead rigid body (#888)
michalpelka Apr 15, 2025
f084056
Added missing #pragma once
norbertprokopiuk Apr 16, 2025
f1fbcc8
Simulation interfaces - part of review suggestions applied (#889)
norbertprokopiuk Apr 16, 2025
f0b2de7
Review comments
michalpelka Apr 16, 2025
466fcca
Clang format applied
michalpelka Apr 16, 2025
99aede3
Alias type from ROS 2 messages, instead of hardcoding (#892)
michalpelka Apr 19, 2025
6384ec8
Fix nitpicks in simulation interfaces (#893)
jhanca-robotecai Apr 22, 2025
222d688
[simulation interfaces] Code review fixes (#896)
jhanca-robotecai Apr 28, 2025
3d448aa
Added SpinUntilFuture to test fixture (#899)
michalpelka Apr 29, 2025
8cf97e3
Disable certain state transitions in Editor (#901)
michalpelka Apr 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion Gems/ROS2/Code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ add_custom_target(
COMMAND ${CMAKE_COMMAND} -DROS_DISTRO=${ROS_DISTRO} -P ${CMAKE_CURRENT_SOURCE_DIR}/checkROS2Distribution.cmake
)

# Gazebo messages are optional, so we will only add the dependents if the package is found.
# The gazebo_msgs package is EOL and will not be available in ROS 2 Kilted Kaiju.
# If you need to use ContactSensor and/or ROS2 Spawner, please consider building gazebo_msgs from the source.
find_package(gazebo_msgs QUIET)
Comment thread
michalpelka marked this conversation as resolved.
if (gazebo_msgs_FOUND)
message(STATUS "Found gazebo_msgs package, enabling legacy features like ContactSensor Component and ROS2 Spawner Component")
SET (WITH_GAZEBO_MSGS TRUE)
if(NOT (ROS_DISTRO STREQUAL "humble" OR ROS_DISTRO STREQUAL "jazzy"))
message(WARNING
"The support for deprecated gazebo_msgs package is not supported in ROS 2 Kilted or newer. "
"Please consider migration to Simulation Interfaces. "
"If you do not intend to use Gazebo messages, please make sure that this package is not sourced in your environment." )

endif()
else()
message(STATUS "Could not find gazebo_msgs package, disabling legacy features like ContactSensor Component and ROS2 Spawner Component")
SET(WITH_GAZEBO_MSGS FALSE)
endif()

# Add the ROS2.Static target
# Note: We include the common files and the platform specific files which are set in ros2_common_files.cmake
# and in ${pal_dir}/ros2_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
Expand Down Expand Up @@ -71,7 +90,12 @@ ly_add_target(
Gem::LevelGeoreferencing.API
)

target_depends_on_ros2_packages(${gem_name}.Static rclcpp builtin_interfaces std_msgs sensor_msgs nav_msgs tf2_ros ackermann_msgs gazebo_msgs vision_msgs control_msgs)
target_depends_on_ros2_packages(${gem_name}.Static rclcpp builtin_interfaces std_msgs sensor_msgs nav_msgs tf2_ros ackermann_msgs vision_msgs control_msgs)

if (WITH_GAZEBO_MSGS)
target_depends_on_ros2_package(${gem_name}.Static gazebo_msgs REQUIRED)
target_compile_definitions(${gem_name}.Static PUBLIC "WITH_GAZEBO_MSGS")
endif()

ly_add_target(
NAME ${gem_name}.API HEADERONLY
Expand Down
7 changes: 7 additions & 0 deletions Gems/ROS2/Code/Include/ROS2/Clock/ITimeSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#pragma once

#include <builtin_interfaces/msg/time.hpp>
#include <AzCore/Outcome/Outcome.h>
#include <AzCore/std/string/string.h>

namespace ROS2
{
Expand All @@ -19,6 +21,11 @@ namespace ROS2

virtual ~ITimeSource() = default;

//! Sets the time source to the given time.
//! @param time The time to set the time source to.
//! @return An outcome indicating success or failure.
virtual AZ::Outcome<void, AZStd::string> AdjustTime(const builtin_interfaces::msg::Time & time) = 0;

//! Get time as ROS 2 message.
//! @see ROS2Requests::GetROSTimestamp() for more details.
virtual builtin_interfaces::msg::Time GetROSTimestamp() const = 0;
Expand Down
8 changes: 7 additions & 1 deletion Gems/ROS2/Code/Include/ROS2/Clock/ROS2Clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
#pragma once

#include "ITimeSource.h"
#include <AzCore/Outcome/Outcome.h>
#include <AzCore/std/chrono/chrono.h>
#include <AzCore/std/smart_ptr/unique_ptr.h>
#include <AzCore/std/string/string.h>
#include <rclcpp/publisher.hpp>
#include <rosgraph_msgs/msg/clock.hpp>

Expand All @@ -21,7 +23,6 @@ namespace ROS2
//! the /use_sim_time parameter set to true.
class ROS2Clock
{

public:
ROS2Clock();
ROS2Clock(AZStd::unique_ptr<ITimeSource> timeSource, bool publishClock);
Expand All @@ -32,6 +33,11 @@ namespace ROS2

builtin_interfaces::msg::Time GetROSTimestamp() const;

//! Sets the time source to the given time.
//! @param time The time to set the time source to.
//! @return An outcome indicating success or failure.
AZ::Outcome<void, AZStd::string> AdjustTime(const builtin_interfaces::msg::Time& time) const;

//! Update time in the ROS 2 ecosystem.
//! This will publish current time to the ROS 2 `/clock` topic, if Clock is configured to do it.
void Tick();
Expand Down
6 changes: 6 additions & 0 deletions Gems/ROS2/Code/Include/ROS2/Clock/ROS2TimeSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ namespace ROS2
//! Get ROS 2 time as ROS2 message.
//! @see ROS2Requests::GetROSTimestamp() for more details.
virtual builtin_interfaces::msg::Time GetROSTimestamp() const override;

//! Sets the time source to the given time.
//! @param time The time to set the time source to.
//! @return An outcome indicating success or failure.
virtual AZ::Outcome<void, AZStd::string> AdjustTime(const builtin_interfaces::msg::Time& time) override;

};

} // namespace ROS2
3 changes: 3 additions & 0 deletions Gems/ROS2/Code/Include/ROS2/Clock/RealTimeSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ namespace ROS2
virtual void Activate() override {};
virtual void Deactivate() override {};


virtual AZ::Outcome<void, AZStd::string> AdjustTime(const builtin_interfaces::msg::Time& time) override;
Comment thread
jhanca-robotecai marked this conversation as resolved.

//! Get simulation time as ROS 2 message.
//! @see ROS2Requests::GetROSTimestamp() for more details.
virtual builtin_interfaces::msg::Time GetROSTimestamp() const override;
Expand Down
5 changes: 5 additions & 0 deletions Gems/ROS2/Code/Include/ROS2/Clock/SimulationTimeSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ namespace ROS2
virtual void Activate() override;
virtual void Deactivate() override;

//! Sets the time source to the given time.
//! @param time The time to set the time source to.
//! @return An outcome indicating success or failure.
virtual AZ::Outcome<void, AZStd::string> AdjustTime(const builtin_interfaces::msg::Time& time) override;
Comment thread
michalpelka marked this conversation as resolved.

//! Get ROS 2 time as ROS2 message.
//! @see ROS2Requests::GetROSTimestamp() for more details.
virtual builtin_interfaces::msg::Time GetROSTimestamp() const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ namespace ROS2
void ROS2SystemCameraComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
{
required.push_back(AZ_CRC_CE("ROS2Service"));
required.push_back(AZ_CRC_CE("RPISystem"));
}

void ROS2SystemCameraComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent)
{
dependent.push_back(AZ_CRC_CE("RPISystem"));
Comment thread
michalpelka marked this conversation as resolved.
}

void ROS2SystemCameraComponent::InitPassTemplateMappingsHandler()
Expand Down
1 change: 1 addition & 0 deletions Gems/ROS2/Code/Source/Camera/ROS2CameraSystemComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace ROS2
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);

void InitPassTemplateMappingsHandler();

Expand Down
5 changes: 5 additions & 0 deletions Gems/ROS2/Code/Source/Clock/ROS2Clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,9 @@ namespace ROS2
msg.clock = GetROSTimestamp();
m_clockPublisher->publish(msg);
}

AZ::Outcome<void, AZStd::string> ROS2Clock::AdjustTime(const builtin_interfaces::msg::Time & time) const
{
return m_timeSource->AdjustTime(time);
}
} // namespace ROS2
6 changes: 6 additions & 0 deletions Gems/ROS2/Code/Source/Clock/ROS2TimeSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,10 @@ namespace ROS2
builtin_interfaces::msg::Time timeStamp = ros2Node->get_clock()->now();
return timeStamp;
}

AZ::Outcome<void, AZStd::string> ROS2TimeSource::AdjustTime(const builtin_interfaces::msg::Time& time)
{
return AZ::Failure(AZStd::string("ROS2TimeSource does not support setting a specific time."));
}

} // namespace ROS2
5 changes: 5 additions & 0 deletions Gems/ROS2/Code/Source/Clock/RealTimeSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ namespace ROS2
return 0;
}
}

AZ::Outcome<void, AZStd::string> RealTimeSource::AdjustTime(const builtin_interfaces::msg::Time& time)
{
return AZ::Failure(AZStd::string("RealTimeSource does not support setting a specific time."));
}
} // namespace ROS2
7 changes: 7 additions & 0 deletions Gems/ROS2/Code/Source/Clock/SimulationTimeSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,11 @@ namespace ROS2
timeStamp.nanosec = static_cast<uint32_t>((m_elapsed - timeStamp.sec) * 1e9);
return timeStamp;
}

AZ::Outcome<void, AZStd::string> SimulationTimeSource::AdjustTime(const builtin_interfaces::msg::Time& time)
{
const double timeSec = static_cast<double>(time.sec) + static_cast<double>(time.nanosec) * 1e-9;
m_elapsed = timeSec;
return AZ::Success();
}
} // namespace ROS2
7 changes: 5 additions & 2 deletions Gems/ROS2/Code/Source/ROS2EditorModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
#include <ROS2ModuleInterface.h>
#include <RobotImporter/ROS2RobotImporterEditorSystemComponent.h>
#include <SdfAssetBuilder/SdfAssetBuilderSystemComponent.h>
#include <SystemComponents/ROS2EditorSystemComponent.h>
#ifdef WITH_GAZEBO_MSGS
#include <Spawner/ROS2SpawnPointEditorComponent.h>
#include <Spawner/ROS2SpawnerEditorComponent.h>
#include <SystemComponents/ROS2EditorSystemComponent.h>

#endif
void InitROS2Resources()
{
// Registration of Qt (ROS2.qrc) resources
Expand All @@ -46,8 +47,10 @@ namespace ROS2
LidarRegistrarEditorSystemComponent::CreateDescriptor(),
ROS2RobotImporterEditorSystemComponent::CreateDescriptor(),
ROS2CameraSensorEditorComponent::CreateDescriptor(),
#ifdef WITH_GAZEBO_MSGS
ROS2SpawnerEditorComponent::CreateDescriptor(),
ROS2SpawnPointEditorComponent::CreateDescriptor(),
#endif
SdfAssetBuilderSystemComponent::CreateDescriptor(),
JointsManipulationEditorComponent::CreateDescriptor(),
JointsPositionsEditorComponent::CreateDescriptor(),
Expand Down
18 changes: 10 additions & 8 deletions Gems/ROS2/Code/Source/ROS2ModuleInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <Camera/PostProcessing/ROS2ImageEncodingConversionComponent.h>
#include <Camera/ROS2CameraSensorComponent.h>
#include <Camera/ROS2CameraSystemComponent.h>
#include <ContactSensor/ROS2ContactSensorComponent.h>
#include <GNSS/ROS2GNSSSensorComponent.h>
#include <Gripper/FingerGripperComponent.h>
#include <Gripper/GripperActionServerComponent.h>
Expand All @@ -39,14 +38,16 @@
#include <RobotControl/ROS2RobotControlComponent.h>
#include <RobotImporter/ROS2RobotImporterSystemComponent.h>
#include <SimulationUtils/FollowingCameraComponent.h>
#include <Spawner/ROS2SpawnPointComponent.h>
#include <Spawner/ROS2SpawnerComponent.h>
#include <SystemComponents/ROS2SystemComponent.h>
#include <VehicleDynamics/ModelComponents/AckermannModelComponent.h>
#include <VehicleDynamics/ModelComponents/SkidSteeringModelComponent.h>
#include <VehicleDynamics/VehicleModelComponent.h>
#include <VehicleDynamics/WheelControllerComponent.h>

#ifdef WITH_GAZEBO_MSGS
#include <Spawner/ROS2SpawnPointComponent.h>
#include <Spawner/ROS2SpawnerComponent.h>
#include <ContactSensor/ROS2ContactSensorComponent.h>
#endif
namespace ROS2
{
class ROS2ModuleInterface : public AZ::Module
Expand Down Expand Up @@ -74,14 +75,11 @@ namespace ROS2
ROS2WheelOdometryComponent::CreateDescriptor(),
ROS2FrameComponent::CreateDescriptor(),
ROS2RobotControlComponent::CreateDescriptor(),
ROS2CameraSensorComponent::CreateDescriptor(),
ROS2ImageEncodingConversionComponent::CreateDescriptor(),
AckermannControlComponent::CreateDescriptor(),
RigidBodyTwistControlComponent::CreateDescriptor(),
SkidSteeringControlComponent::CreateDescriptor(),
ROS2CameraSensorComponent::CreateDescriptor(),
ROS2SpawnerComponent::CreateDescriptor(),
ROS2SpawnPointComponent::CreateDescriptor(),
VehicleDynamics::AckermannVehicleModelComponent::CreateDescriptor(),
VehicleDynamics::WheelControllerComponent::CreateDescriptor(),
VehicleDynamics::SkidSteeringModelComponent::CreateDescriptor(),
Expand All @@ -96,9 +94,13 @@ namespace ROS2
GripperActionServerComponent::CreateDescriptor(),
VacuumGripperComponent::CreateDescriptor(),
FingerGripperComponent::CreateDescriptor(),
ROS2ContactSensorComponent::CreateDescriptor(),
FollowingCameraComponent::CreateDescriptor(),
ClassSegmentationConfigurationComponent::CreateDescriptor(),
#ifdef WITH_GAZEBO_MSGS
ROS2SpawnerComponent::CreateDescriptor(),
ROS2SpawnPointComponent::CreateDescriptor(),
ROS2ContactSensorComponent::CreateDescriptor(),
#endif
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ namespace ROS2
void ROS2SystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
{
required.push_back(AZ_CRC("AssetDatabaseService", 0x3abf5601));
required.push_back(AZ_CRC("RPISystem", 0xf2add773));
}

void ROS2SystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
Expand Down
15 changes: 11 additions & 4 deletions Gems/ROS2/Code/ros2_editor_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ set(FILES
Source/RobotImporter/Utils/TypeConversions.cpp
Source/RobotImporter/Utils/TypeConversions.h
Source/ROS2GemUtilities.cpp
Source/Spawner/ROS2SpawnerEditorComponent.cpp
Source/Spawner/ROS2SpawnerEditorComponent.h
Source/Spawner/ROS2SpawnPointEditorComponent.cpp
Source/Spawner/ROS2SpawnPointEditorComponent.h
Source/SdfAssetBuilder/SdfAssetBuilder.cpp
Source/SdfAssetBuilder/SdfAssetBuilder.h
Source/SdfAssetBuilder/SdfAssetBuilderSettings.cpp
Expand All @@ -101,3 +97,14 @@ set(FILES
Source/SystemComponents/ROS2EditorSystemComponent.cpp
Source/SystemComponents/ROS2EditorSystemComponent.h
)

# optional, legacy features compilation
if (WITH_GAZEBO_MSGS)
list(APPEND FILES
Source/Spawner/ROS2SpawnerEditorComponent.cpp
Source/Spawner/ROS2SpawnerEditorComponent.h
Source/Spawner/ROS2SpawnPointEditorComponent.cpp
Source/Spawner/ROS2SpawnPointEditorComponent.h
)
endif ()

26 changes: 16 additions & 10 deletions Gems/ROS2/Code/ros2_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ set(FILES
Source/Communication/QoS.cpp
Source/Communication/PublisherConfiguration.cpp
Source/Communication/TopicConfiguration.cpp
Source/ContactSensor/ROS2ContactSensorComponent.cpp
Source/ContactSensor/ROS2ContactSensorComponent.h
Source/Frame/NamespaceConfiguration.cpp
Source/Frame/ROS2FrameComponent.cpp
Source/Frame/ROS2FrameConfiguration.cpp
Expand Down Expand Up @@ -130,14 +128,6 @@ set(FILES
Source/SimulationUtils/FollowingCameraConfiguration.h
Source/SimulationUtils/FollowingCameraComponent.cpp
Source/SimulationUtils/FollowingCameraComponent.h
Source/Spawner/ROS2SpawnerComponent.cpp
Source/Spawner/ROS2SpawnerComponent.h
Source/Spawner/ROS2SpawnPointComponent.cpp
Source/Spawner/ROS2SpawnPointComponent.h
Source/Spawner/ROS2SpawnerComponentController.cpp
Source/Spawner/ROS2SpawnerComponentController.h
Source/Spawner/ROS2SpawnPointComponentController.cpp
Source/Spawner/ROS2SpawnPointComponentController.h
Source/SystemComponents/ROS2SystemComponent.cpp
Source/SystemComponents/ROS2SystemComponent.h
Source/Utilities/ArticulationsUtilities.cpp
Expand Down Expand Up @@ -178,3 +168,19 @@ set(FILES
Source/VehicleDynamics/WheelControllerComponent.h
Source/VehicleDynamics/WheelDynamicsData.h
)

# optional, legacy features compilation
if (WITH_GAZEBO_MSGS)
list(APPEND FILES
Source/ContactSensor/ROS2ContactSensorComponent.cpp
Source/ContactSensor/ROS2ContactSensorComponent.h
Source/Spawner/ROS2SpawnerComponent.cpp
Source/Spawner/ROS2SpawnerComponent.h
Source/Spawner/ROS2SpawnPointComponent.cpp
Source/Spawner/ROS2SpawnPointComponent.h
Source/Spawner/ROS2SpawnerComponentController.cpp
Source/Spawner/ROS2SpawnerComponentController.h
Source/Spawner/ROS2SpawnPointComponentController.cpp
Source/Spawner/ROS2SpawnPointComponentController.h
)
endif ()
14 changes: 9 additions & 5 deletions Gems/ROS2/Code/ros2_target_depends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
function(target_depends_on_ros2_package TARGET_NAME)
list(GET ARGN 0 _package)
find_package(${ARGN})
include(${${_package}_DIR}/${_package}Config.cmake OPTIONAL)
if (${${_package}_FOUND_AMENT_PACKAGE})
message(DEBUG "Package ${_package} was found (${${_package}_DIR}) version ${${_package}_VERSION} targets : ${${_package}_TARGETS}")
target_link_libraries(${TARGET_NAME} PUBLIC ${${_package}_TARGETS})
if (${${_package}_FOUND})
include(${${_package}_DIR}/${_package}Config.cmake OPTIONAL)
if (${${_package}_FOUND_AMENT_PACKAGE})
message(DEBUG "Package ${_package} was found (${${_package}_DIR}) version ${${_package}_VERSION} targets : ${${_package}_TARGETS}")
target_link_libraries(${TARGET_NAME} PUBLIC ${${_package}_TARGETS})
else ()
message(FATAL_ERROR "Package ${_package} was found (${${_package}_DIR}), but package is not an Ament package.")
endif ()
else ()
message(FATAL_ERROR "Package ${_package} was found (${${_package}_DIR}), but package is not an Ament package.")
message(DEBUG "Package ${_package} was not found.")
endif ()
endfunction()

Expand Down
Loading