22 #ifndef TOPIC_HANDLE_H 23 #define TOPIC_HANDLE_H 26 #include <std_msgs/Bool.h> 27 #include <geometry_msgs/Twist.h> 32 #include <boost/utility.hpp> 33 #include <boost/scoped_ptr.hpp> 69 "Topic handler '" <<
name_ <<
"' subscribed to topic '" <<
topic_ <<
71 ", priority = " << static_cast<int>(
priority_)
151 : base_type(nh, name, topic, timeout, priority, mux)
161 void callback(
const geometry_msgs::TwistConstPtr& msg)
186 : base_type(nh, name, topic, timeout, priority, mux)
209 #endif // TOPIC_HANDLE_H bool hasPriority(const VelocityTopicHandle &twist)
const std::string & getTopic() const
LockTopicHandle(ros::NodeHandle &nh, const std::string &name, const std::string &topic, double timeout, priority_type priority, TwistMux *mux)
bool hasExpired() const
hasExpired
void callback(const geometry_msgs::TwistConstPtr &msg)
static T clamp(T x, T min, T max)
Clamp a value to the range [min, max].
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
const T & getMessage() const
const priority_type & getPriority() const
getPriority Priority getter
ros::Subscriber subscriber_
base_type::priority_type priority_type
const T & getStamp() const
TopicHandle_(ros::NodeHandle &nh, const std::string &name, const std::string &topic, double timeout, priority_type priority, TwistMux *mux)
TopicHandle_.
bool isLocked() const
isLocked
const double & getTimeout() const
TopicHandle_< std_msgs::Bool > base_type
The TwistMux class implements a top-level twist multiplexer module that priorize different velocity c...
#define ROS_INFO_STREAM(args)
TopicHandle_< geometry_msgs::Twist > base_type
const std::string & getName() const
base_type::priority_type priority_type
void publishTwist(const geometry_msgs::TwistConstPtr &msg)
bool isMasked(priority_type lock_priority) const
VelocityTopicHandle(ros::NodeHandle &nh, const std::string &name, const std::string &topic, double timeout, priority_type priority, TwistMux *mux)
void callback(const std_msgs::BoolConstPtr &msg)