Skip to content

Commit 3144a50

Browse files
Move sensors from ROS2 Gem into new ROS2Sensors (#847)
Signed-off-by: Jan Hanca <[email protected]>
1 parent 99742ab commit 3144a50

File tree

164 files changed

+1598
-394
lines changed

Some content is hidden

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

164 files changed

+1598
-394
lines changed

Gems/ROS2/Code/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#
44
# SPDX-License-Identifier: Apache-2.0 OR MIT
55

6-
76
# Only allow this gem to be configured on platforms that are currently supported
87
include(${CMAKE_CURRENT_SOURCE_DIR}/Platform/${PAL_PLATFORM_NAME}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
98
if(NOT PAL_TRAIT_BUILD_ROS2_GEM_SUPPORTED)

Gems/ROS2/Code/Include/ROS2/ROS2SensorTypesIds.h

-20
This file was deleted.

Gems/ROS2/Code/Include/ROS2/Sensor/Events/EventSourceAdapter.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <AzCore/Serialization/EditContext.h>
1212
#include <ROS2/ROS2Bus.h>
1313
#include <ROS2/Sensor/Events/SensorEventSource.h>
14-
#include <ROS2/Sensor/SensorConfiguration.h>
1514

1615
namespace ROS2
1716
{
@@ -107,7 +106,7 @@ namespace ROS2
107106
return;
108107
}
109108

110-
m_lastDeltaTime = m_adaptedDeltaTime;
109+
m_lastDeltaTime = m_adaptedDeltaTime;
111110
m_sensorAdaptedEvent.Signal(m_adaptedDeltaTime, AZStd::forward<decltype(args)>(args)...);
112111
m_adaptedDeltaTime = 0.0f;
113112
});

Gems/ROS2/Code/Source/Camera/ROS2CameraSystemComponent.h

-42
This file was deleted.

Gems/ROS2/Code/Source/ROS2EditorModule.cpp

+5-9
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
* SPDX-License-Identifier: Apache-2.0 OR MIT
66
*
77
*/
8+
89
#include <AzCore/RTTI/RTTIMacros.h>
9-
#include <Camera/ROS2CameraSensorEditorComponent.h>
10-
#include <Camera/ROS2EditorCameraSystemComponent.h>
1110
#include <Frame/ROS2FrameSystemComponent.h>
12-
#include <Lidar/LidarRegistrarEditorSystemComponent.h>
1311
#include <Manipulation/JointsManipulationEditorComponent.h>
1412
#include <Manipulation/JointsPositionsEditorComponent.h>
1513
#include <QtCore/qglobal.h>
@@ -42,10 +40,7 @@ namespace ROS2
4240
m_descriptors.insert(
4341
m_descriptors.end(),
4442
{ ROS2EditorSystemComponent::CreateDescriptor(),
45-
ROS2EditorCameraSystemComponent::CreateDescriptor(),
46-
LidarRegistrarEditorSystemComponent::CreateDescriptor(),
4743
ROS2RobotImporterEditorSystemComponent::CreateDescriptor(),
48-
ROS2CameraSensorEditorComponent::CreateDescriptor(),
4944
ROS2SpawnerEditorComponent::CreateDescriptor(),
5045
ROS2SpawnPointEditorComponent::CreateDescriptor(),
5146
SdfAssetBuilderSystemComponent::CreateDescriptor(),
@@ -58,9 +53,10 @@ namespace ROS2
5853
AZ::ComponentTypeList GetRequiredSystemComponents() const override
5954
{
6055
return AZ::ComponentTypeList{
61-
azrtti_typeid<ROS2EditorSystemComponent>(), azrtti_typeid<ROS2EditorCameraSystemComponent>(),
62-
azrtti_typeid<LidarRegistrarEditorSystemComponent>(), azrtti_typeid<ROS2RobotImporterEditorSystemComponent>(),
63-
azrtti_typeid<SdfAssetBuilderSystemComponent>(), azrtti_typeid<ROS2FrameSystemComponent>(),
56+
azrtti_typeid<ROS2EditorSystemComponent>(),
57+
azrtti_typeid<ROS2RobotImporterEditorSystemComponent>(),
58+
azrtti_typeid<SdfAssetBuilderSystemComponent>(),
59+
azrtti_typeid<ROS2FrameSystemComponent>(),
6460
};
6561
}
6662
};

Gems/ROS2/Code/Source/ROS2ModuleInterface.h

-29
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,14 @@
99

1010
#include <AzCore/Memory/SystemAllocator.h>
1111
#include <AzCore/Module/Module.h>
12-
#include <Camera/PostProcessing/ROS2ImageEncodingConversionComponent.h>
13-
#include <Camera/ROS2CameraSensorComponent.h>
14-
#include <Camera/ROS2CameraSystemComponent.h>
15-
#include <ContactSensor/ROS2ContactSensorComponent.h>
16-
#include <GNSS/ROS2GNSSSensorComponent.h>
1712
#include <Gripper/FingerGripperComponent.h>
1813
#include <Gripper/GripperActionServerComponent.h>
1914
#include <Gripper/VacuumGripperComponent.h>
20-
#include <Imu/ROS2ImuSensorComponent.h>
21-
#include <Lidar/ClassSegmentationConfigurationComponent.h>
22-
#include <Lidar/LidarRegistrarSystemComponent.h>
23-
#include <Lidar/ROS2Lidar2DSensorComponent.h>
24-
#include <Lidar/ROS2LidarSensorComponent.h>
2515
#include <Manipulation/Controllers/JointsArticulationControllerComponent.h>
2616
#include <Manipulation/Controllers/JointsPIDControllerComponent.h>
2717
#include <Manipulation/JointsManipulationComponent.h>
2818
#include <Manipulation/JointsPositionsComponent.h>
2919
#include <Manipulation/JointsTrajectoryComponent.h>
30-
#include <Odometry/ROS2OdometrySensorComponent.h>
31-
#include <Odometry/ROS2WheelOdometry.h>
3220
#include <ROS2/Frame/ROS2FrameComponent.h>
3321
#include <ROS2/Manipulation/MotorizedJoints/JointMotorControllerComponent.h>
3422
#include <ROS2/Manipulation/MotorizedJoints/ManualMotorControllerComponent.h>
@@ -61,25 +49,12 @@ namespace ROS2
6149
m_descriptors.end(),
6250
{
6351
ROS2SystemComponent::CreateDescriptor(),
64-
ROS2SystemCameraComponent::CreateDescriptor(),
65-
ROS2SensorComponentBase<TickBasedSource>::CreateDescriptor(),
66-
ROS2SensorComponentBase<PhysicsBasedSource>::CreateDescriptor(),
67-
LidarRegistrarSystemComponent::CreateDescriptor(),
6852
ROS2RobotImporterSystemComponent::CreateDescriptor(),
69-
ROS2ImuSensorComponent::CreateDescriptor(),
70-
ROS2GNSSSensorComponent::CreateDescriptor(),
71-
ROS2LidarSensorComponent::CreateDescriptor(),
72-
ROS2Lidar2DSensorComponent::CreateDescriptor(),
73-
ROS2OdometrySensorComponent::CreateDescriptor(),
74-
ROS2WheelOdometryComponent::CreateDescriptor(),
7553
ROS2FrameComponent::CreateDescriptor(),
7654
ROS2RobotControlComponent::CreateDescriptor(),
77-
ROS2CameraSensorComponent::CreateDescriptor(),
78-
ROS2ImageEncodingConversionComponent::CreateDescriptor(),
7955
AckermannControlComponent::CreateDescriptor(),
8056
RigidBodyTwistControlComponent::CreateDescriptor(),
8157
SkidSteeringControlComponent::CreateDescriptor(),
82-
ROS2CameraSensorComponent::CreateDescriptor(),
8358
ROS2SpawnerComponent::CreateDescriptor(),
8459
ROS2SpawnPointComponent::CreateDescriptor(),
8560
VehicleDynamics::AckermannVehicleModelComponent::CreateDescriptor(),
@@ -96,18 +71,14 @@ namespace ROS2
9671
GripperActionServerComponent::CreateDescriptor(),
9772
VacuumGripperComponent::CreateDescriptor(),
9873
FingerGripperComponent::CreateDescriptor(),
99-
ROS2ContactSensorComponent::CreateDescriptor(),
10074
FollowingCameraComponent::CreateDescriptor(),
101-
ClassSegmentationConfigurationComponent::CreateDescriptor(),
10275
});
10376
}
10477

10578
AZ::ComponentTypeList GetRequiredSystemComponents() const override
10679
{
10780
return AZ::ComponentTypeList{
10881
azrtti_typeid<ROS2SystemComponent>(),
109-
azrtti_typeid<ROS2SystemCameraComponent>(),
110-
azrtti_typeid<LidarRegistrarSystemComponent>(),
11182
azrtti_typeid<ROS2RobotImporterSystemComponent>(),
11283
};
11384
}

Gems/ROS2/Code/Source/RobotImporter/ROS2RobotImporterEditorSystemComponent.cpp

+9-8
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,15 @@ namespace ROS2
6767
RobotImporterRequestBus::Handler::BusConnect();
6868

6969
// Register default sensor and plugin hooks
70-
m_sensorHooks.emplace_back(SDFormat::ROS2SensorHooks::ROS2CameraSensor());
71-
m_sensorHooks.emplace_back(SDFormat::ROS2SensorHooks::ROS2GNSSSensor());
72-
m_sensorHooks.emplace_back(SDFormat::ROS2SensorHooks::ROS2ImuSensor());
73-
m_sensorHooks.emplace_back(SDFormat::ROS2SensorHooks::ROS2LidarSensor());
74-
m_modelPluginHooks.emplace_back(SDFormat::ROS2ModelPluginHooks::ROS2AckermannModel());
75-
m_modelPluginHooks.emplace_back(SDFormat::ROS2ModelPluginHooks::ROS2SkidSteeringModel());
76-
m_modelPluginHooks.emplace_back(SDFormat::ROS2ModelPluginHooks::ROS2JointStatePublisherModel());
77-
m_modelPluginHooks.emplace_back(SDFormat::ROS2ModelPluginHooks::ROS2JointPoseTrajectoryModel());
70+
// temporarily disable import hooks for sensors and models for https://github.com/o3de/sig-simulation/pull/96
71+
// m_sensorHooks.emplace_back(SDFormat::ROS2SensorHooks::ROS2CameraSensor());
72+
// m_sensorHooks.emplace_back(SDFormat::ROS2SensorHooks::ROS2GNSSSensor());
73+
// m_sensorHooks.emplace_back(SDFormat::ROS2SensorHooks::ROS2ImuSensor());
74+
// m_sensorHooks.emplace_back(SDFormat::ROS2SensorHooks::ROS2LidarSensor());
75+
// m_modelPluginHooks.emplace_back(SDFormat::ROS2ModelPluginHooks::ROS2AckermannModel());
76+
// m_modelPluginHooks.emplace_back(SDFormat::ROS2ModelPluginHooks::ROS2SkidSteeringModel());
77+
// m_modelPluginHooks.emplace_back(SDFormat::ROS2ModelPluginHooks::ROS2JointStatePublisherModel());
78+
// m_modelPluginHooks.emplace_back(SDFormat::ROS2ModelPluginHooks::ROS2JointPoseTrajectoryModel());
7879

7980
// Query user-defined sensor and plugin hooks
8081
auto serializeContext = AZ::Interface<AZ::ComponentApplicationRequests>::Get()->GetSerializeContext();

Gems/ROS2/Code/Source/RobotImporter/SDFormat/ROS2ModelPluginHooks.h

+10-8
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@
1212

1313
namespace ROS2::SDFormat::ROS2ModelPluginHooks
1414
{
15-
//! Get a mapping of SDFormat skid_steer_drive and diff_drive plugins into O3DE components.
16-
ModelPluginImporterHook ROS2SkidSteeringModel();
15+
// temporarily disable import hooks for sensors and models for https://github.com/o3de/sig-simulation/pull/96
1716

18-
//! Get a mapping of SDFormat ackermann_drive plugin into O3DE components.
19-
ModelPluginImporterHook ROS2AckermannModel();
17+
// //! Get a mapping of SDFormat skid_steer_drive and diff_drive plugins into O3DE components.
18+
// ModelPluginImporterHook ROS2SkidSteeringModel();
2019

21-
//! Get a mapping of SDFormat joint_state_publisher plugin into O3DE components.
22-
ModelPluginImporterHook ROS2JointStatePublisherModel();
20+
// //! Get a mapping of SDFormat ackermann_drive plugin into O3DE components.
21+
// ModelPluginImporterHook ROS2AckermannModel();
2322

24-
//! Get a mapping of SDFormat joint_pose_trajectory plugin into O3DE components.
25-
ModelPluginImporterHook ROS2JointPoseTrajectoryModel();
23+
// //! Get a mapping of SDFormat joint_state_publisher plugin into O3DE components.
24+
// ModelPluginImporterHook ROS2JointStatePublisherModel();
25+
26+
// //! Get a mapping of SDFormat joint_pose_trajectory plugin into O3DE components.
27+
// ModelPluginImporterHook ROS2JointPoseTrajectoryModel();
2628

2729
} // namespace ROS2::SDFormat::ROS2ModelPluginHooks

Gems/ROS2/Code/Source/RobotImporter/SDFormat/ROS2SDFormatHooksUtils.cpp

+9-8
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@
2121

2222
namespace ROS2::SDFormat
2323
{
24-
void HooksUtils::AddTopicConfiguration(
25-
SensorConfiguration& sensorConfig, const AZStd::string& topic, const AZStd::string& messageType, const AZStd::string& configName)
26-
{
27-
TopicConfiguration config;
28-
config.m_topic = topic;
29-
config.m_type = messageType;
30-
sensorConfig.m_publishersConfigurations.insert(AZStd::make_pair(configName, config));
31-
}
24+
// temporarily disable import hooks for sensors and models for https://github.com/o3de/sig-simulation/pull/96
25+
// void HooksUtils::AddTopicConfiguration(
26+
// SensorConfiguration& sensorConfig, const AZStd::string& topic, const AZStd::string& messageType, const AZStd::string& configName)
27+
// {
28+
// TopicConfiguration config;
29+
// config.m_topic = topic;
30+
// config.m_type = messageType;
31+
// sensorConfig.m_publishersConfigurations.insert(AZStd::make_pair(configName, config));
32+
// }
3233

3334
AZ::EntityId HooksUtils::GetJointEntityId(
3435
const std::string& jointName, const sdf::Model& sdfModel, const CreatedEntitiesMap& createdEntities)

Gems/ROS2/Code/Source/RobotImporter/SDFormat/ROS2SDFormatHooksUtils.h

+9-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
#include <AzToolsFramework/ToolsComponents/GenericComponentWrapper.h>
1818
#include <ROS2/Frame/ROS2FrameEditorComponent.h>
1919
#include <ROS2/RobotImporter/SDFormatModelPluginImporterHook.h>
20-
#include <ROS2/Sensor/SensorConfiguration.h>
20+
// temporarily disable import hooks for sensors and models for https://github.com/o3de/sig-simulation/pull/96
21+
// #include <ROS2/Sensor/SensorConfiguration.h>
2122
#include <Source/EditorArticulationLinkComponent.h>
2223
#include <Source/EditorHingeJointComponent.h>
2324

@@ -33,11 +34,13 @@ namespace ROS2::SDFormat
3334
//! @param topic ROS 2 topic name
3435
//! @param messageType ROS 2 message type
3536
//! @param configName name under which topic configuration is stored in sensor's configuration
36-
void AddTopicConfiguration(
37-
SensorConfiguration& sensorConfig,
38-
const AZStd::string& topic,
39-
const AZStd::string& messageType,
40-
const AZStd::string& configName);
37+
38+
// temporarily disable import hooks for sensors and models for https://github.com/o3de/sig-simulation/pull/96
39+
// void AddTopicConfiguration(
40+
// SensorConfiguration& sensorConfig,
41+
// const AZStd::string& topic,
42+
// const AZStd::string& messageType,
43+
// const AZStd::string& configName);
4144

4245
//! Find O3DE entity id of the SDFormat joint based on its name and a map of all created entities.
4346
//! @param jointName name of the joint in query

Gems/ROS2/Code/Source/RobotImporter/SDFormat/ROS2SensorHooks.h

+10-8
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,19 @@ namespace ROS2::SDFormat
1414
{
1515
namespace ROS2SensorHooks
1616
{
17+
// temporarily disable import hooks for sensors and models for https://github.com/o3de/sig-simulation/pull/96
18+
1719
//! Retrieve a sensor importer hook which is used to map SDFormat sensor of type camera, depth or rgbd into O3DE
18-
//! ROS2CameraSensorComponent
19-
SensorImporterHook ROS2CameraSensor();
20+
// //! ROS2CameraSensorComponent
21+
// SensorImporterHook ROS2CameraSensor();
2022

21-
//! Retrieve a sensor importer hook which is used to map SDFormat sensor of type navsat into O3DE ROS2GNSSSensorComponent
22-
SensorImporterHook ROS2GNSSSensor();
23+
// //! Retrieve a sensor importer hook which is used to map SDFormat sensor of type navsat into O3DE ROS2GNSSSensorComponent
24+
// SensorImporterHook ROS2GNSSSensor();
2325

24-
//! Retrieve a sensor importer hook which is used to map SDFormat sensor of type imu into O3DE ROS2ImuSensorComponent
25-
SensorImporterHook ROS2ImuSensor();
26+
// //! Retrieve a sensor importer hook which is used to map SDFormat sensor of type imu into O3DE ROS2ImuSensorComponent
27+
// SensorImporterHook ROS2ImuSensor();
2628

27-
//! Retrieve a sensor importer hook which is used to map SDFormat sensor of type lidar into O3DE ROS2LidarSensorComponent
28-
SensorImporterHook ROS2LidarSensor();
29+
// //! Retrieve a sensor importer hook which is used to map SDFormat sensor of type lidar into O3DE ROS2LidarSensorComponent
30+
// SensorImporterHook ROS2LidarSensor();
2931
} // namespace ROS2SensorHooks
3032
} // namespace ROS2::SDFormat

Gems/ROS2/Code/Source/Sensor/Events/PhysicsBasedSource.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
*
77
*/
88

9+
#include <AzCore/Serialization/SerializeContext.h>
910
#include <AzFramework/Physics/PhysicsSystem.h>
10-
11-
#include <ROS2/Utilities/ROS2Conversions.h>
1211
#include <ROS2/Sensor/Events/PhysicsBasedSource.h>
13-
#include <ROS2/Sensor/SensorConfiguration.h>
12+
#include <ROS2/Utilities/ROS2Conversions.h>
1413

1514
namespace ROS2
1615
{

Gems/ROS2/Code/Source/Sensor/Events/TickBasedSource.cpp

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/*
2-
* Copyright (c) Contributors to the Open 3D Engine Project.
3-
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
4-
*
5-
* SPDX-License-Identifier: Apache-2.0 OR MIT
6-
*
7-
*/
2+
* Copyright (c) Contributors to the Open 3D Engine Project.
3+
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
4+
*
5+
* SPDX-License-Identifier: Apache-2.0 OR MIT
6+
*
7+
*/
88

9-
#include <ROS2/Sensor/Events/TickBasedSource.h>
10-
#include <ROS2/Sensor/SensorConfiguration.h>
9+
#include <AzCore/Serialization/SerializeContext.h>
10+
#include <AzCore/std/numeric.h>
1111
#include <ROS2/ROS2Bus.h>
12+
#include <ROS2/Sensor/Events/TickBasedSource.h>
1213
#include <ROS2/Utilities/ROS2Conversions.h>
13-
#include <AzCore/std/numeric.h>
1414
namespace ROS2
1515
{
1616
void TickBasedSource::Reflect(AZ::ReflectContext* context)
@@ -42,6 +42,5 @@ namespace ROS2
4242
AZ_UNUSED(deltaTime);
4343
const auto expectedSimulationLoopTime = ROS2Interface::Get()->GetExpectedSimulationLoopTime();
4444
m_sourceEvent.Signal(expectedSimulationLoopTime);
45-
4645
}
4746
} // namespace ROS2

0 commit comments

Comments
 (0)