10 #ifndef DYNAMIC_GRAPH_ROS_PUBLISH_HH 11 #define DYNAMIC_GRAPH_ROS_PUBLISH_HH 15 #include <boost/interprocess/sync/interprocess_mutex.hpp> 16 #include <boost/shared_ptr.hpp> 17 #include <boost/tuple/tuple.hpp> 19 #include <dynamic-graph/command.h> 20 #include <dynamic-graph/entity.h> 21 #include <dynamic-graph/signal-time-dependent.h> 25 #include <realtime_tools/realtime_publisher.h> 38 using ::dynamicgraph::command::Command;
39 using ::dynamicgraph::command::Value;
41 #define ROS_PUBLISH_MAKE_COMMAND(CMD) \ 42 class CMD : public Command \ 45 CMD(RosPublish& entity, const std::string& docstring); \ 46 virtual Value doExecute(); \ 49 ROS_PUBLISH_MAKE_COMMAND(Add);
50 ROS_PUBLISH_MAKE_COMMAND(Clear);
51 ROS_PUBLISH_MAKE_COMMAND(List);
52 ROS_PUBLISH_MAKE_COMMAND(Rm);
54 #undef ROS_PUBLISH_MAKE_COMMAND 62 DYNAMIC_GRAPH_ENTITY_DECL();
67 typedef boost::tuple<boost::shared_ptr<dynamicgraph::SignalBase<int> >,
71 static const double ROS_JOINT_STATE_PUBLISHER_RATE;
76 virtual std::string getDocString()
const;
77 void display(std::ostream& os)
const;
79 void add(
const std::string& signal,
const std::string& topic);
80 void rm(
const std::string& signal);
81 std::string list()
const;
84 int& trigger(
int&,
int);
87 void sendData(boost::shared_ptr<realtime_tools::RealtimePublisher<
93 void add(
const std::string& signal,
const std::string& topic);
96 static const std::string docstring_;
98 std::map<std::string, bindedSignal_t> bindedSignal_;
99 dynamicgraph::SignalTimeDependent<int, int> trigger_;
101 ros::Time lastPublicated_;
102 boost::interprocess::interprocess_mutex mutex_;
boost::function< void(int)> callback_t
Simple shortcut for code writing convenience.
Definition: ros_robot_state_publisher.hpp:43
this is this package namespace in order to avoid naming conflict
Definition: device.hh:22
DgToRos trait type.
Definition: dg_to_ros.hh:64
Publish dynamic-graph information into ROS.
Definition: ros_publish.hh:60