MappingDummyState.cpp
Go to the documentation of this file.
2 
3 namespace rsm {
4 
6 }
7 
9 }
10 
12  ros::NodeHandle nh("rsm");
14  rsm_msgs::GoalCompleted>("navigationGoalCompleted");
15  _name = "E: Mapping Dummy";
16  _navigation_completed_status = rsm_msgs::GoalStatus::ABORTED;
17 }
18 
20 }
21 
23  //do mapping stuff
24  if (!_interrupt_occured) {
25  _navigation_completed_status = rsm_msgs::GoalStatus::REACHED;
28  }
29 }
30 
32  rsm_msgs::GoalCompleted srv;
33  srv.request.status.goal_status = _navigation_completed_status;
34  srv.request.navigation_status = false;
36  ROS_ERROR("Failed to call Complete Navigation Goal service");
37  }
38 }
39 
41  std::string &message) {
42  success = false;
43  message = "Exploration running";
44 }
45 
46 void MappingDummyState::onExplorationStop(bool &success, std::string &message) {
47  success = true;
48  message = "Exploration stopped";
49  _stateinterface->transitionToVolatileState(boost::make_shared<IdleState>());
50 }
51 
53  std::string &message) {
54  success = false;
55  message = "Exploration running";
56 }
57 
59  std::string &message) {
60  success = false;
61  message = "Exploration running";
62 }
63 
64 void MappingDummyState::onInterrupt(int interrupt) {
65  switch (interrupt) {
68  boost::make_shared<EmergencyStopState>());
69  _interrupt_occured = true;
70  break;
73  boost::make_shared<TeleoperationState>());
74  _interrupt_occured = true;
75  break;
79  _interrupt_occured = true;
80  break;
81  }
82 }
83 
84 }
85 
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
void onInterrupt(int interrupt)
Called when an operation mode interrupt was received.
Dummy state for mapping at a reached goal during exploration. Only initiates transition to CalculateG...
boost::shared_ptr< rsm::BaseState > getPluginState(int plugin_type, std::string routine="")
void onWaypointFollowingStart(bool &success, std::string &message)
#define NAVIGATION_STATE
void onExplorationStart(bool &success, std::string &message)
bool call(MReq &req, MRes &res)
void onWaypointFollowingStop(bool &success, std::string &message)
void transitionToVolatileState(boost::shared_ptr< rsm::BaseState > next_state)
bool _interrupt_occured
#define TELEOPERATION_INTERRUPT
ros::ServiceClient _navigation_goal_completed_service
#define CALCULATEGOAL_STATE
std::string _name
StateInterface * _stateinterface
#define EMERGENCY_STOP_INTERRUPT
#define SIMPLE_GOAL_INTERRUPT
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
#define ROS_ERROR(...)
void onExplorationStop(bool &success, std::string &message)


rsm_additions
Author(s): Marco Steinbrink
autogenerated on Mon Feb 28 2022 23:28:21