How to subscribe a topic in action_client?

asked 2017-02-19 20:02:48 -0500

mxl592 gravatar image

I am currently working on a action server for the turtlebot. The client needs to subscribe a node so that if the node generate a message the server will halt the action regardless the current action. I tried to do Void alarm(const std_msgs::Float64& message_holder){ Ros::Subscriber alarm n.subscribe("Lidar_alarm",1, alarm); } Lidar alarm is my node, and I wanted to subscribe the info to the callback function alarm so that I could call it when lidar_alarm receives a number. However i couldn't do so. Anyone has an idea about how to solve this issue? Thank you.

edit retag flag offensive close merge delete