how to send empty message?
Hey,
I'm working with an Ar Drone and i would like to send from my node a command to the helicopter to take off.
The command in terminal is given(works): rostopic pub /ardrone/takeoff std_msgs/Empty
I try to send an empty msg from my node but the drone does not take off and i do not get an echo of the msg. What am I missing? or what is wrong with my code? My code is:
#include <std_msgs/Empty.h>
int main(int argc, char **argv){
init(argc, argv, "takeoff_fly");
Nodehandle n;
std_msg::Empty myMsg;
Publisher takeOff=n.advertise<std_msgs::Empty>("/ardrone/takeoff",1);
takeOff.publish(myMsg);
spinOnce();
return 0;
}