ROS2SensorsModuleInterface.cpp 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  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. */
  8. #include "ROS2SensorsModuleInterface.h"
  9. #include <AzCore/Memory/Memory.h>
  10. #include <Clients/ROS2SensorsSystemComponent.h>
  11. #include <ROS2/Sensor/Events/PhysicsBasedSource.h>
  12. #include <ROS2/Sensor/Events/TickBasedSource.h>
  13. #include <ROS2Sensors/ROS2SensorsTypeIds.h>
  14. #include <ROS2Sensors/Sensor/ROS2SensorComponentBase.h>
  15. #include <Camera/PostProcessing/ROS2ImageEncodingConversionComponent.h>
  16. #include <Camera/ROS2CameraSensorComponent.h>
  17. #include <Camera/ROS2CameraSystemComponent.h>
  18. #include <ContactSensor/ROS2ContactSensorComponent.h>
  19. #include <GNSS/ROS2GNSSSensorComponent.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>
  25. #include <Odometry/ROS2OdometrySensorComponent.h>
  26. #include <Odometry/ROS2WheelOdometry.h>
  27. namespace ROS2Sensors
  28. {
  29. AZ_TYPE_INFO_WITH_NAME_IMPL(ROS2SensorsModuleInterface, "ROS2SensorsModuleInterface", ROS2SensorsModuleInterfaceTypeId);
  30. AZ_RTTI_NO_TYPE_INFO_IMPL(ROS2SensorsModuleInterface, AZ::Module);
  31. AZ_CLASS_ALLOCATOR_IMPL(ROS2SensorsModuleInterface, AZ::SystemAllocator);
  32. ROS2SensorsModuleInterface::ROS2SensorsModuleInterface()
  33. {
  34. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  35. // Add ALL components descriptors associated with this gem to m_descriptors.
  36. // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext.
  37. // This happens through the [MyComponent]::Reflect() function.
  38. m_descriptors.insert(
  39. m_descriptors.end(),
  40. {
  41. ROS2SensorsSystemComponent::CreateDescriptor(),
  42. ROS2SensorComponentBase<ROS2::TickBasedSource>::CreateDescriptor(),
  43. ROS2SensorComponentBase<ROS2::PhysicsBasedSource>::CreateDescriptor(),
  44. ROS2CameraSensorComponent::CreateDescriptor(),
  45. ROS2SystemCameraComponent::CreateDescriptor(),
  46. ROS2ImageEncodingConversionComponent::CreateDescriptor(),
  47. ROS2ContactSensorComponent::CreateDescriptor(),
  48. ROS2GNSSSensorComponent::CreateDescriptor(),
  49. ROS2ImuSensorComponent::CreateDescriptor(),
  50. ROS2LidarSensorComponent::CreateDescriptor(),
  51. ROS2Lidar2DSensorComponent::CreateDescriptor(),
  52. ClassSegmentationConfigurationComponent::CreateDescriptor(),
  53. LidarRegistrarSystemComponent::CreateDescriptor(),
  54. ROS2OdometrySensorComponent::CreateDescriptor(),
  55. ROS2WheelOdometryComponent::CreateDescriptor(),
  56. });
  57. }
  58. AZ::ComponentTypeList ROS2SensorsModuleInterface::GetRequiredSystemComponents() const
  59. {
  60. return AZ::ComponentTypeList{
  61. azrtti_typeid<ROS2SensorsSystemComponent>(),
  62. azrtti_typeid<ROS2SystemCameraComponent>(),
  63. azrtti_typeid<LidarRegistrarSystemComponent>(),
  64. };
  65. }
  66. } // namespace ROS2Sensors