/* * 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 #include #include #include namespace ROS2Controllers { //! This component implements finger gripper functionality. class JointsPositionsComponent : public AZ::Component , public AZ::TickBus::Handler { public: JointsPositionsComponent() = default; JointsPositionsComponent(const ROS2::TopicConfiguration& topicConfiguration, const AZStd::vector& jointNames); ~JointsPositionsComponent() = default; AZ_COMPONENT(JointsPositionsComponent, JointsPositionsComponentTypeId, AZ::Component); // AZ::Component overrides... void Activate() override; void Deactivate() override; static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); static void Reflect(AZ::ReflectContext* context); private: // AZ::TickBus::Handler overrides... void OnTick(float delta, AZ::ScriptTimePoint timePoint) override; void ProcessPositionControlMessage(const std_msgs::msg::Float64MultiArray& message); AZStd::unique_ptr m_jointPositionsSubscriptionHandler; ROS2::TopicConfiguration m_topicConfiguration; //!< Configuration of the subscribed topic. AZStd::vector m_jointNames; //!< Ordered list of joint names that can be modified via subscriber AZ::EntityId m_rootOfArticulation; //!< The root of the articulation chain }; } // namespace ROS2Controllers