JointsPositionsEditorComponent.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #pragma once
  9. #include <AzCore/std/containers/unordered_map.h>
  10. #include <AzCore/std/containers/vector.h>
  11. #include <AzCore/std/string/string.h>
  12. #include <AzCore/std/utility/pair.h>
  13. #include <AzToolsFramework/ToolsComponents/EditorComponentBase.h>
  14. #include <ROS2/Communication/TopicConfiguration.h>
  15. #include <ROS2Controllers/ROS2ControllersTypeIds.h>
  16. namespace ROS2Controllers
  17. {
  18. //! Editor Component responsible for a hierarchical system of joints such as robotic arm with Articulations or Hinge Joints.
  19. class JointsPositionsEditorComponent : public AzToolsFramework::Components::EditorComponentBase
  20. {
  21. public:
  22. JointsPositionsEditorComponent();
  23. ~JointsPositionsEditorComponent() = default;
  24. AZ_EDITOR_COMPONENT(JointsPositionsEditorComponent, JointsPositionsEditorComponentTypeId);
  25. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  26. static void Reflect(AZ::ReflectContext* context);
  27. // AzToolsFramework::Components::EditorComponentBase overrides
  28. void BuildGameEntity(AZ::Entity* gameEntity) override;
  29. private:
  30. AZ::Crc32 FindAllJoints();
  31. ROS2::TopicConfiguration m_topicConfiguration; //!< Configuration of the subscribed topic.
  32. AZStd::vector<AZStd::string> m_jointNames; //!< Ordered list of joint names that can be modified via subscriber
  33. };
  34. } // namespace ROS2Controllers