2
0

ControlConfiguration.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  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/RobotControl/ControlConfiguration.h>
  10. namespace ROS2Controllers
  11. {
  12. void ControlConfiguration::Reflect(AZ::ReflectContext* context)
  13. {
  14. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  15. {
  16. serializeContext->Class<ControlConfiguration>()->Version(1)->Field("Steering", &ControlConfiguration::m_steering);
  17. if (AZ::EditContext* ec = serializeContext->GetEditContext())
  18. {
  19. ec->Class<ControlConfiguration>("Robot control", "Handles robot control")
  20. ->DataElement(
  21. AZ::Edit::UIHandlers::ComboBox,
  22. &ControlConfiguration::m_steering,
  23. "Steering",
  24. "Determines how the robot is controlled.")
  25. ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree)
  26. ->EnumAttribute(ControlConfiguration::Steering::Twist, "Twist")
  27. ->EnumAttribute(ControlConfiguration::Steering::Ackermann, "Ackermann");
  28. }
  29. }
  30. }
  31. } // namespace ROS2Controllers