31 #include <sensor_msgs/Joy.h> 52 void cbJoy(
const sensor_msgs::Joy::Ptr msg)
54 if (static_cast<size_t>(interrupt_button_) >= msg->buttons.size())
57 "Out of range: number of buttons (%lu) must be greater than interrupt_button (%d).",
63 if (msg->buttons[interrupt_button_])
83 "Use %s (%s%s) topic instead of %s (%s%s)",
90 pub_topic_ = msg->advertise(pnh_,
"output", 1,
false);
94 pub_topic_ = msg->advertise(nh_,
"mux_output", 1,
false);
115 sub_topics_[0] = neonavigation_common::compat::subscribe<topic_tools::ShapeShifter>(
118 sub_topics_[1] = neonavigation_common::compat::subscribe<topic_tools::ShapeShifter>(
122 pnh_.param(
"interrupt_button", interrupt_button_, 5);
123 pnh_.param(
"timeout", timeout_, 0.5);
133 int main(
int argc,
char* argv[])
std::string getSimplifiedNamespace(ros::NodeHandle &nh)
void cbTimer(const ros::TimerEvent &e)
void publish(const boost::shared_ptr< M > &message) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
std::string resolveName(const std::string &name, bool remap=true) const
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ros::Subscriber sub_topics_[2]
void cbJoy(const sensor_msgs::Joy::Ptr msg)
ros::Publisher pub_topic_
void cbTopic(const boost::shared_ptr< topic_tools::ShapeShifter const > &msg, int id)
int main(int argc, char *argv[])