/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #pragma once #include #include #include #include #include #include #include namespace ROS2Controllers { struct JointStatePublisherContext { AZ::EntityId m_entityId; AZStd::string m_frameId; AZStd::string m_publisherNamespace; }; //! A class responsible for publishing the joint positions on ROS2 /joint_states topic. //!< @see jointState message. class JointStatePublisher { public: JointStatePublisher(const ROS2::PublisherConfiguration& configuration, const JointStatePublisherContext& context); virtual ~JointStatePublisher(); void InitializePublisher(); private: void PublishMessage(); ROS2::EventSourceAdapter m_eventSourceAdapter; typename ROS2::PhysicsBasedSource::AdaptedEventHandlerType m_adaptedEventHandler; ROS2::PublisherConfiguration m_configuration; JointStatePublisherContext m_context; std::shared_ptr> m_jointStatePublisher; sensor_msgs::msg::JointState m_jointStateMsg; AZStd::vector m_jointNames; AZStd::vector m_jointInfos; }; } // namespace ROS2Controllers