10 #ifndef ROS_ROBOT_STATE_PUBLISHER_HPP 11 #define ROS_ROBOT_STATE_PUBLISHER_HPP 18 #include <dynamic-graph/all-commands.h> 19 #include <dynamic-graph/all-signals.h> 20 #include <dynamic-graph/entity.h> 21 #include <dynamic-graph/factory.h> 22 #include <dynamic-graph/linear-algebra.h> 24 #include <realtime_tools/realtime_publisher.h> 26 #include <sensor_msgs/JointState.h> 27 #include <tf2_msgs/TFMessage.h> 28 #include <real_time_tools/spinner.hpp> 29 #include <real_time_tools/thread.hpp> 39 typedef dynamicgraph::SignalTimeDependent<int, int>
SignalOUT;
43 typedef dynamicgraph::SignalPtr<dynamicgraph::Vector, int>
SignalIN;
52 typedef realtime_tools::RealtimePublisher<tf2_msgs::TFMessage>
TfRtPublisher;
57 typedef realtime_tools::RealtimePublisher<sensor_msgs::JointState>
62 std::shared_ptr<TfRtPublisher> base_tf_publisher_;
63 std::shared_ptr<JointStateRtPublisher> joint_state_publisher_;
64 std::shared_ptr<SignalIN> robot_state_input_signal_;
65 callback_t callback_function_;
67 real_time_tools::Spinner spinner_;
70 dynamicgraph::Vector robot_state_;
99 void add(
const std::string& base_link_name,
100 const std::string& joint_names,
101 const std::string& tf_prefix,
102 const std::string& signal_name,
103 const std::string& joint_state_topic_name);
110 int& trigger(
int&,
int);
118 void copy_data_internally(
119 std::shared_ptr<RosRobotStatePublisherMtInternal> publisher,
148 void set_tf_msg_to_identity(geometry_msgs::TransformStamped& msg);
155 void normalize_tf_msg_quaternion(geometry_msgs::TransformStamped& msg);
175 std::map<std::string, std::shared_ptr<RosRobotStatePublisherMtInternal>>
200 namespace ros_state_publish
202 using ::dynamicgraph::command::Command;
203 using ::dynamicgraph::command::Value;
210 #define ROS_PUBLISH_MAKE_COMMAND(CMD) \ 211 class CMD : public Command \ 214 CMD(dynamic_graph::RosRobotStatePublisherMt& entity, \ 215 const std::string& docstring); \ 216 virtual Value doExecute(); \ 222 #undef ROS_PUBLISH_MAKE_COMMAND 227 #endif // ROS_ROBOT_STATE_PUBLISHER_HPP ros::Time last_time_of_publication_
Check at what time the publication was done.
Definition: ros_robot_state_publisher_mt.hpp:186
boost::function< void(int)> callback_t
Simple shortcut for code writing convenience.
Definition: ros_robot_state_publisher.hpp:43
This class define a dynamic graph wrapper around the vicon client.
Definition: ros_robot_state_publisher_mt.hpp:82
std::map< std::string, std::shared_ptr< RosRobotStatePublisherMtInternal > > publishers_
This is the list of publishers registered for this class.
Definition: ros_robot_state_publisher_mt.hpp:176
dynamicgraph::SignalPtr< dynamicgraph::Vector, int > SignalIN
Simple shortcut for code writing convenience.
Definition: ros_robot_state_publisher.hpp:39
realtime_tools::RealtimePublisher< sensor_msgs::JointState > JointStateRtPublisher
Renaming of the joint position publisher type.
Definition: ros_robot_state_publisher.hpp:54
#define ROS_PUBLISH_MAKE_COMMAND(CMD)
Declare here a couple of python command used for the ros_state publisher.
Definition: ros_robot_state_publisher_mt.hpp:210
realtime_tools::RealtimePublisher< tf2_msgs::TFMessage > TfRtPublisher
Renaming of the tf publisher type.
Definition: ros_robot_state_publisher.hpp:48
this is this package namespace in order to avoid naming conflict
Definition: device.hh:22
static const std::string CLASS_NAME
The class name used to identify it in the dynamic graph pool.
Definition: ros_robot_state_publisher_mt.hpp:131
ros::Duration rate_
manage the rate data publication in topics
Definition: ros_robot_state_publisher_mt.hpp:181
ros::NodeHandle & ros_node_handle_
Ros node handle corresponding to the dynamic graph process node handle.
Definition: ros_robot_state_publisher_mt.hpp:168
Definition: ros_robot_state_publisher_mt.hpp:60
SignalOUT trigger_signal_
Create an internal output signal which should be call periodically in the device in order to publish ...
Definition: ros_robot_state_publisher_mt.hpp:162
virtual const std::string & getClassName(void) const
Get the CLASS_NAME object.
Definition: ros_robot_state_publisher_mt.hpp:138
Definition of the command.
Definition: ros_robot_state_publisher.hpp:164
dynamicgraph::SignalTimeDependent< int, int > SignalOUT
Simple shortcut for code writing convenience.
Definition: ros_robot_state_publisher.hpp:35