30 #include <edrone_client/edrone_services.h> 32 bool myFunction(edrone_client::edrone_services::Request &req,
33 edrone_client::edrone_services::Response &res)
35 ROS_INFO(
"Ax=%f, Ay=%f, Az=%f", req.accX, req.accY, req.accZ);
36 ROS_INFO(
"Gx=%f, Gy=%f, Gz=%f", req.gyroX, req.gyroY, req.gyroZ);
37 ROS_INFO(
"Mx=%f, My=%f, Mz=%f", req.magX, req.magY, req.magZ);
40 ROS_INFO(
"roll=%i, pitch=%i, yaw=%i", req.roll, req.pitch, req.yaw);
42 ROS_INFO(
"battery=%f rssi=%i", req.battery,req.rssi);
46 ROS_INFO(
"sending back response: [%ld]", (
long int)res.rcAUX1);
50 int main(
int argc,
char **argv)
56 printf(
"Ready to Provide Drone Service\n");
edrone_client::edrone_services service
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int main(int argc, char **argv)
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
ROSCPP_DECL void spin(Spinner &spinner)
bool myFunction(edrone_client::edrone_services::Request &req, edrone_client::edrone_services::Response &res)