3#include <geometry_msgs/msg/accel_stamped.hpp>
4#include <geometry_msgs/msg/pose_stamped.hpp>
5#include <geometry_msgs/msg/transform_stamped.hpp>
6#include <geometry_msgs/msg/twist_stamped.hpp>
7#include <geometry_msgs/msg/wrench_stamped.hpp>
8#include <rclcpp/time.hpp>
9#include <sensor_msgs/msg/joint_state.hpp>
10#include <std_msgs/msg/bool.hpp>
11#include <std_msgs/msg/float64.hpp>
12#include <std_msgs/msg/float64_multi_array.hpp>
13#include <std_msgs/msg/int32.hpp>
14#include <std_msgs/msg/string.hpp>
15#include <tf2_msgs/msg/tf_message.hpp>
18#include <state_representation/parameters/Parameter.hpp>
19#include <state_representation/space/cartesian/CartesianState.hpp>
20#include <state_representation/space/joint/JointState.hpp>
22#include "modulo_core/EncodedState.hpp"
23#include "modulo_core/exceptions.hpp"
35 geometry_msgs::msg::Accel& message,
const state_representation::CartesianState& state,
const rclcpp::Time& time);
45 geometry_msgs::msg::AccelStamped& message,
const state_representation::CartesianState& state,
46 const rclcpp::Time& time);
56 geometry_msgs::msg::Pose& message,
const state_representation::CartesianState& state,
const rclcpp::Time& time);
66 geometry_msgs::msg::PoseStamped& message,
const state_representation::CartesianState& state,
67 const rclcpp::Time& time);
77 geometry_msgs::msg::Transform& message,
const state_representation::CartesianState& state,
78 const rclcpp::Time& time);
88 geometry_msgs::msg::TransformStamped& message,
const state_representation::CartesianState& state,
89 const rclcpp::Time& time);
99 geometry_msgs::msg::Twist& message,
const state_representation::CartesianState& state,
const rclcpp::Time& time);
109 geometry_msgs::msg::TwistStamped& message,
const state_representation::CartesianState& state,
110 const rclcpp::Time& time);
120 geometry_msgs::msg::Wrench& message,
const state_representation::CartesianState& state,
const rclcpp::Time& time);
130 geometry_msgs::msg::WrenchStamped& message,
const state_representation::CartesianState& state,
131 const rclcpp::Time& time);
141 sensor_msgs::msg::JointState& message,
const state_representation::JointState& state,
const rclcpp::Time& time);
151 tf2_msgs::msg::TFMessage& message,
const state_representation::CartesianState& state,
const rclcpp::Time& time);
162template<
typename U,
typename T>
163void write_message(U& message,
const state_representation::Parameter<T>& state,
const rclcpp::Time&);
171void write_message(std_msgs::msg::Bool& message,
const bool& state,
const rclcpp::Time& time);
179void write_message(std_msgs::msg::Float64& message,
const double& state,
const rclcpp::Time& time);
188 std_msgs::msg::Float64MultiArray& message,
const std::vector<double>& state,
const rclcpp::Time& time);
196void write_message(std_msgs::msg::Int32& message,
const int& state,
const rclcpp::Time& time);
204void write_message(std_msgs::msg::String& message,
const std::string& state,
const rclcpp::Time& time);
215inline void write_message(EncodedState& message,
const T& state,
const rclcpp::Time&) {
217 std::string tmp = clproto::encode<T>(state);
218 message.data = std::vector<unsigned char>(tmp.begin(), tmp.end());
219 }
catch (
const std::exception& ex) {
An exception class to notify that the translation of a ROS message failed.
Modulo Core translation module for converting between ROS2 and state_representation data types.
void write_message(geometry_msgs::msg::Accel &message, const state_representation::CartesianState &state, const rclcpp::Time &time)
Convert a CartesianState to a ROS geometry_msgs::msg::Accel.