example_rviz_node.cpp
Go to the documentation of this file.
1 #include "ros/ros.h"
2 #include "hebiros/FeedbackMsg.h"
3 #include "hebiros/AddGroupFromURDFSrv.h"
4 
5 using namespace hebiros;
6 
7 
8 int main(int argc, char **argv) {
9 
10  //Initialize ROS node
11  ros::init(argc, argv, "example_rviz_node");
13  ros::Rate loop_rate(200);
14 
15  std::string group_name = "x_demo";
16 
17  //Create a client which uses the service to create a group
18  ros::ServiceClient add_group_client = n.serviceClient<AddGroupFromURDFSrv>(
19  "/hebiros/add_group_from_urdf");
20 
21  AddGroupFromURDFSrv add_group_srv;
22 
23  //Construct a group using a urdf
24  add_group_srv.request.group_name = group_name;
25  //Call the add_group_from_urdf service to create a group until it succeeds
26  //Specific topics and services will now be available under this group's namespace
27  while(!add_group_client.call(add_group_srv)) {}
28 
29  return 0;
30 }
31 
32 
33 
34 
35 
36 
37 
38 
39 
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
int n
Definition: key_read.py:85
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)


hebiros_advanced_examples
Author(s): Xavier Artache , Matthew Tesch
autogenerated on Thu Sep 3 2020 04:13:22