example_05_kinematics_node.cpp
Go to the documentation of this file.
1 //TODO: Finish example
2 #include "ros/ros.h"
3 #include "hebiros/AddModelFromURDFSrv.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_05_kinematics_node");
13  ros::Rate loop_rate(200);
14 
15  std::string model_name = "my_model";
16 
17  ros::ServiceClient add_model_client = n.serviceClient<AddModelFromURDFSrv>(
18  "/hebiros/add_model_from_urdf");
19 
20  AddModelFromURDFSrv add_model_srv;
21 
22  add_model_srv.request.model_name = model_name;
23 
24  while(!add_model_client.call(add_model_srv)) {}
25 
26  //Spin
27  //The group will exist until the node is shutdown
28  while(ros::ok()) {
29  ros::spinOnce();
30  loop_rate.sleep();
31  }
32 
33  return 0;
34 }
35 
36 
37 
38 
39 
40 
41 
42 
43 
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)
ROSCPP_DECL bool ok()
bool sleep()
int main(int argc, char **argv)
ROSCPP_DECL void spinOnce()


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