RSMNode.cpp
Go to the documentation of this file.
1 #include "ros/ros.h"
3 #include <rsm_core/BootState.h>
4 
6 
8  stateInterface->awake();
9 }
10 
11 int main(int argc, char **argv) {
12  ros::init(argc, argv, "rsmNode");
13  ros::NodeHandle private_nh("~");
14  double loop_rate;
15  private_nh.param("update_frequency", loop_rate, 20.0);
16  ros::Timer loop_timer = private_nh.createTimer(ros::Duration(1 / loop_rate),
17  loopCallback);
18  stateInterface.reset(new rsm::StateInterface());
19  stateInterface->awake();
20  stateInterface->transitionToVolatileState(
21  boost::make_shared<rsm::BootState>());
22  stateInterface->awake();
23  loop_timer.start();
24  ros::spin();
25  stateInterface.reset();
26  return 0;
27 }
28 
void loopCallback(const ros::TimerEvent &)
Definition: RSMNode.cpp:7
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void start()
ROSCPP_DECL void spin(Spinner &spinner)
bool param(const std::string &param_name, T &param_val, const T &default_val) const
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
boost::shared_ptr< rsm::StateInterface > stateInterface
Definition: RSMNode.cpp:5
Handles the RSM transitions between the different state classes and holds a reference to the current ...
int main(int argc, char **argv)
Definition: RSMNode.cpp:11


rsm_core
Author(s): Marco Steinbrink
autogenerated on Tue Mar 16 2021 02:44:31