WheelOdometrySensorConfiguration.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 <AzCore/Serialization/EditContext.h>
  9. #include <ROS2Controllers/Sensors/ROS2OdometryCovariance.h>
  10. #include <ROS2Controllers/Sensors/WheelOdometrySensorConfiguration.h>
  11. namespace ROS2Controllers
  12. {
  13. void WheelOdometrySensorConfiguration::Reflect(AZ::ReflectContext* context)
  14. {
  15. ROS2OdometryCovariance::Reflect(context);
  16. if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
  17. {
  18. serialize->Class<WheelOdometrySensorConfiguration>()
  19. ->Version(1)
  20. ->Field("Pose covariance", &WheelOdometrySensorConfiguration::m_poseCovariance)
  21. ->Field("Twist covariance", &WheelOdometrySensorConfiguration::m_twistCovariance);
  22. if (AZ::EditContext* editContext = serialize->GetEditContext())
  23. {
  24. editContext
  25. ->Class<WheelOdometrySensorConfiguration>("ROS2 Wheel Odometry configuration", "Wheel odometry sensor configuration")
  26. ->DataElement(
  27. AZ::Edit::UIHandlers::Default,
  28. &WheelOdometrySensorConfiguration::m_poseCovariance,
  29. "Pose covariance",
  30. "Set ROS pose covariance")
  31. ->DataElement(
  32. AZ::Edit::UIHandlers::Default,
  33. &WheelOdometrySensorConfiguration::m_twistCovariance,
  34. "Twist covariance",
  35. "Set ROS twist covariance");
  36. }
  37. }
  38. }
  39. } // namespace ROS2Controllers