JointsManipulationEditorComponent.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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/PublisherConfiguration.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 JointsManipulationEditorComponent : public AzToolsFramework::Components::EditorComponentBase
  20. {
  21. public:
  22. JointsManipulationEditorComponent();
  23. JointsManipulationEditorComponent(const ROS2::PublisherConfiguration& publisherConfiguration);
  24. ~JointsManipulationEditorComponent() = default;
  25. AZ_EDITOR_COMPONENT(JointsManipulationEditorComponent, JointsManipulationEditorComponentTypeId);
  26. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  27. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  28. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  29. static void Reflect(AZ::ReflectContext* context);
  30. // AzToolsFramework::Components::EditorComponentBase overrides
  31. void BuildGameEntity(AZ::Entity* gameEntity) override;
  32. private:
  33. AZ::Crc32 ReloadJoints();
  34. ROS2::PublisherConfiguration m_jointStatePublisherConfiguration;
  35. AZStd::vector<AZStd::pair<AZStd::string, float>> m_initialPositions;
  36. };
  37. } // namespace ROS2Controllers