${Name}SampleComponent.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // {BEGIN_LICENSE}
  2. /*
  3. * Copyright (c) Contributors to the Open 3D Engine Project.
  4. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. *
  6. * SPDX-License-Identifier: Apache-2.0 OR MIT
  7. *
  8. */
  9. // {END_LICENSE}
  10. #pragma once
  11. #include <AzCore/std/containers/vector.h>
  12. #include <AzCore/Component/Component.h>
  13. #include <AzCore/Component/EntityId.h>
  14. #include <ImGuiBus.h>
  15. #include <ROS2/ROS2Bus.h>
  16. #include <ROS2/Communication/TopicConfiguration.h>
  17. #include <rclcpp/publisher.hpp>
  18. #include <geometry_msgs/msg/pose_stamped.hpp>
  19. namespace ${SanitizedCppName}
  20. {
  21. class ${SanitizedCppName}SampleComponent
  22. : public AZ::Component
  23. , public ImGui::ImGuiUpdateListenerBus::Handler
  24. {
  25. public:
  26. AZ_COMPONENT(${SanitizedCppName}SampleComponent, "{${Random_Uuid}}", AZ::Component);
  27. ${SanitizedCppName}SampleComponent();
  28. ~${SanitizedCppName}SampleComponent() = default;
  29. void Activate() override;
  30. void Deactivate() override;
  31. static void Reflect(AZ::ReflectContext* context);
  32. private:
  33. void OnImGuiUpdate() override;
  34. AZStd::vector<AZ::EntityId> m_goalEntities;
  35. std::shared_ptr<rclcpp::Publisher<geometry_msgs::msg::PoseStamped>> m_goalPublisher;
  36. geometry_msgs::msg::PoseStamped m_goalMessage;
  37. ROS2::TopicConfiguration m_goalTopicConfiguration;
  38. };
  39. } // namespace ${SanitizedCppName}