hebiros.cpp
Go to the documentation of this file.
1 #include "hebiros.h"
2 
3 
4 std::shared_ptr<ros::NodeHandle> HebirosNode::n_ptr;
13 
14 //Initialize the hebiros_node and advertise base level topics and services
15 //Loop in place allowing callback functions to be run
16 HebirosNode::HebirosNode (int argc, char **argv) {
17 
18  HebirosNode::n_ptr = std::make_shared<ros::NodeHandle>(n);
19 
20  use_gazebo = false;
21 
22  for (int i = 2; i < argc; i += 2) {
23  if (argv[i-1] == std::string("-use_gazebo")) {
24  if (argv[i] == std::string("true")) {
25  use_gazebo = true;
26  ROS_INFO("Using Gazebo");
27  }
28  }
29  }
30 
31  if (use_gazebo) {
32  HebirosParameters::setBool("use_sim_time", true);
35  }
36  else {
37  HebirosParameters::setBool("use_sim_time", false);
39  }
40 
42 
43  loop();
44 }
45 
47 }
48 
50  ros::Rate loop_rate(HebirosParameters::getInt("hebiros/node_frequency"));
51 
52  while(ros::ok()) {
53  ros::spinOnce();
54  loop_rate.sleep();
55  }
56 
57  cleanup();
58 }
59 
60 
static int getInt(std::string name)
static HebirosPublishersPhysical publishers_physical
Definition: hebiros.h:80
static HebirosPublishersGazebo publishers_gazebo
Definition: hebiros.h:79
void cleanup()
Definition: hebiros.cpp:46
static HebirosSubscribersGazebo subscribers_gazebo
Definition: hebiros.h:81
static std::shared_ptr< ros::NodeHandle > n_ptr
Definition: hebiros.h:78
HebirosNode(int argc, char **argv)
Definition: hebiros.cpp:16
void registerNodeClients()
static void setNodeParameters()
#define ROS_INFO(...)
static void setBool(std::string name, bool value)
ROSCPP_DECL bool ok()
void loop()
Definition: hebiros.cpp:49
static HebirosServicesGazebo services_gazebo
Definition: hebiros.h:83
bool sleep()
bool use_gazebo
Definition: hebiros.h:88
ros::NodeHandle n
Definition: hebiros.h:77
static HebirosSubscribersPhysical subscribers_physical
Definition: hebiros.h:82
static HebirosClients clients
Definition: hebiros.h:85
static HebirosActions actions
Definition: hebiros.h:86
static HebirosServicesPhysical services_physical
Definition: hebiros.h:84
ROSCPP_DECL void spinOnce()


hebiros
Author(s): Xavier Artache , Matthew Tesch
autogenerated on Thu Sep 3 2020 04:08:14