5 #include <std_srvs/Trigger.h> 6 #include <std_srvs/SetBool.h> 7 #include <robotican_msgs_srvs/switch_topic.h> 10 int main(
int argc,
char **argv) {
22 pick_client.waitForExistence();
23 sw_client.waitForExistence();
26 robotican_msgs_srvs::switch_topic sw_srv;
28 sw_client.call(sw_srv);
32 std_srvs::Trigger drive_srv;
33 if (drive_client.
call(drive_srv))
35 ROS_INFO(
"drive2object response: %s", drive_srv.response.message.c_str());
36 if (drive_srv.response.success) {
40 sw_client.call(sw_srv);
46 std_srvs::Trigger pick_srv;
47 if (pick_client.call(pick_srv)) {
48 ROS_INFO(
"pick response: %s", pick_srv.response.message.c_str());
49 if (pick_srv.response.success) ROS_INFO(
"Done!");
51 else ROS_ERROR(
"Failed to call pick service");
55 else ROS_ERROR(
"Failed to call drive2object service");
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
bool call(MReq &req, MRes &res)
int main(int argc, char **argv)
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))
ROSCPP_DECL void shutdown()