JointPositionsSubscriptionHandler.h 947 B

1234567891011121314151617181920212223242526272829
  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 <ROS2Controllers/RobotControl/ControlSubscriptionHandler.h>
  10. #include <std_msgs/msg/float64_multi_array.hpp>
  11. namespace ROS2Controllers
  12. {
  13. class JointPositionsSubscriptionHandler : public ControlSubscriptionHandler<std_msgs::msg::Float64MultiArray>
  14. {
  15. public:
  16. using MessageType = std_msgs::msg::Float64MultiArray;
  17. using MessageCallback = AZStd::function<void(const MessageType&)>;
  18. explicit JointPositionsSubscriptionHandler(MessageCallback messageCallback);
  19. private:
  20. // ROS2::ControlSubscriptionHandler overrides
  21. void SendToBus(const MessageType& message) override;
  22. MessageCallback m_messageCallback;
  23. };
  24. } // namespace ROS2Controllers