choreo_output_processor_node.cpp
Go to the documentation of this file.
1 //
2 // Created by yijiangh on 9/10/17.
3 //
4 
5 #include <ros/ros.h>
6 #include <ros/console.h>
7 
8 // srv
9 #include <choreo_msgs/OutputProcessing.h>
10 
12 
13 const static std::string OUTPUT_PROCESSING_SERVICE = "output_processing";
14 
15 bool outputProcessingCallback(choreo_msgs::OutputProcessingRequest& req,
16  choreo_msgs::OutputProcessingResponse& res)
17 {
19  op.setSaveFilePath(req.file_path);
20 
21  if(op.outputJson(req.plans))
22  {
23  res.succeeded = true;
24  return true;
25  }
26  else
27  {
28  res.succeeded = false;
29  return false;
30  }
31 }
32 
33 int main(int argc, char** argv)
34 {
35 
36  ros::init(argc, argv, "choreo_output_processor");
37  ros::NodeHandle nh;
38 
39  ros::ServiceServer output_processing_server =
40  nh.advertiseService<choreo_msgs::OutputProcessingRequest, choreo_msgs::OutputProcessingResponse>(
42 
43  ROS_INFO("%s server ready to service requests.", output_processing_server.getService().c_str());
44  ros::spin();
45 
46  return 0;
47 }
bool outputProcessingCallback(choreo_msgs::OutputProcessingRequest &req, choreo_msgs::OutputProcessingResponse &res)
static const std::string OUTPUT_PROCESSING_SERVICE
int main(int argc, char **argv)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
ROSCPP_DECL void spin(Spinner &spinner)
#define ROS_INFO(...)
std::string getService() const
bool outputJson(std::vector< choreo_msgs::UnitProcessPlan > &plans)


choreo_output_processor
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:59:18