59 bool init(rclcpp::Node::SharedPtr node,
const mjModel* model, mjData* data)
override;
60 void update_write(
const mjModel* model, mjData* data)
override;
64 using FreeJointStateArray = mujoco_ros2_control_msgs::msg::FreeJointStateArray;
70 std::string body_name;
77 bool collect_free_joint_entries(
const std::vector<std::string>& body_names);
80 int resolve_frame_id(
const std::string& frame_id)
const;
82 rclcpp::Node::SharedPtr node_;
83 rclcpp::Logger logger_{ rclcpp::get_logger(
"FreeJointStatePublisherPlugin") };
85 const mjModel* model_{
nullptr };
87 rclcpp::Publisher<FreeJointStateArray>::SharedPtr publisher_raw_;
88 std::unique_ptr<realtime_tools::RealtimePublisher<FreeJointStateArray>> publisher_;
90 std::vector<FreeJointEntry> entries_;
93 int frame_body_id_{ -1 };
94 std::string effective_frame_id_;
96 rclcpp::Duration publish_period_{ 0, 0 };
97 rclcpp::Time last_publish_time_{ 0, 0, RCL_ROS_TIME };
100 FreeJointStateArray message_;
void update_write(const mjModel *model, mjData *data) override
Called once per write() cycle, on the control thread, after the hardware interface has staged the con...
Definition free_joint_state_publisher_plugin.cpp:150