get_map_client.cpp
Go to the documentation of this file.
1 #include <ros/ros.h>
3 #include <nav2d_navigator/GetFirstMapAction.h>
4 #include <std_srvs/Trigger.h>
5 
7 
9 
11 
12 bool receiveCommand(std_srvs::Trigger::Request &req, std_srvs::Trigger::Response &res)
13 {
14  nav2d_navigator::GetFirstMapGoal goal;
15  gGetMapClient->sendGoal(goal);
16  res.success = true;
17  res.message = "Send GetFirstMapGoal to Navigator.";
18  return true;
19 }
20 
21 int main(int argc, char **argv)
22 {
23  ros::init(argc, argv, "GetFirstMap");
25 
27  gGetMapClient = new GetMapClient(NAV_GETMAP_ACTION, true);
28  gGetMapClient->waitForServer();
29 
30  ros::spin();
31 
32  delete gGetMapClient;
33  return 0;
34 }
bool waitForServer(const ros::Duration &timeout=ros::Duration(0, 0)) const
actionlib::SimpleActionClient< nav2d_navigator::GetFirstMapAction > GetMapClient
GetMapClient * gGetMapClient
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)
int main(int argc, char **argv)
#define NAV_GETMAP_ACTION
Definition: commands.h:14
bool receiveCommand(std_srvs::Trigger::Request &req, std_srvs::Trigger::Response &res)
void sendGoal(const Goal &goal, SimpleDoneCallback done_cb=SimpleDoneCallback(), SimpleActiveCallback active_cb=SimpleActiveCallback(), SimpleFeedbackCallback feedback_cb=SimpleFeedbackCallback())
#define NAV_GETMAP_SERVICE
Definition: commands.h:8


nav2d_navigator
Author(s): Sebastian Kasperski
autogenerated on Thu Jun 6 2019 19:20:43