21 "Idle timer duration must be longer than unstuck timer duration, setting the former to the latter + 1s!");
27 nh.
serviceClient<rsm_msgs::GetNavigationGoal>(
"getNavigationGoal");
29 rsm_msgs::GoalCompleted>(
"navigationGoalCompleted");
37 "getExplorationMode");
59 rsm_msgs::GetNavigationGoal srv;
66 _name =
"E: Navigation";
69 _name =
"W: Navigation";
72 _name =
"G: Navigation";
79 ROS_ERROR(
"Failed to call Get Navigation Goal service");
83 std_srvs::Trigger srv2;
93 ROS_ERROR(
"Failed to call Get Reverse Mode service");
98 std_srvs::Trigger srv2;
107 ROS_ERROR(
"Failed to call Get Exploration Mode service");
130 rsm_msgs::GoalStatus::REACHED;
152 "Try to unstuck robot by using reversed move base");
170 rsm_msgs::GoalStatus::FAILED;
194 move_base_msgs::MoveBaseGoal goal;
195 goal.target_pose.header.frame_id =
"map";
200 rsm_msgs::GetRobotPose srv;
205 double roll, pitch, yaw;
206 m.
getRPY(roll, pitch, yaw);
221 rsm_msgs::GoalCompleted srv;
223 srv.request.navigation_status =
true;
225 ROS_ERROR(
"Failed to call Complete Navigation Goal service");
234 message =
"Exploration running";
238 message =
"Waypoint following running";
242 message =
"Simple Goal running";
246 message =
"Nothing running";
255 message =
"Exploration stopped";
260 message =
"Waypoint following running";
264 message =
"Simple Goal running";
268 message =
"Nothing running";
274 std::string &message) {
278 message =
"Exploration running";
281 message =
"Waypoint following running";
284 message =
"Simple Goal running";
287 message =
"Nothing running";
293 std::string &message) {
297 message =
"Exploration running";
301 message =
"Waypoint following stopped";
306 message =
"Simple Goal running";
310 message =
"Nothing running";
320 boost::make_shared<EmergencyStopState>());
325 boost::make_shared<TeleoperationState>());
336 boost::make_shared<IdleState>());
350 ROS_WARN(
"Try to unstuck robot by using reversed move base");
365 ROS_WARN(
"Navigation aborted because robot appears to be stuck");
379 boost::make_shared<WaypointFollowingState>());
408 rsm_msgs::GetRobotPose srv;
412 double roll, pitch, yaw;
413 m.
getRPY(roll, pitch, yaw);
428 ROS_ERROR(
"Failed to call Get Robot Pose service");
435 const std_msgs::Bool::ConstPtr &msg) {
446 const std_msgs::Bool::ConstPtr &reverse_mode) {
463 const rsm_msgs::OperationMode::ConstPtr &operation_mode) {
471 boost::make_shared<IdleState>());
void onWaypointFollowingStart(bool &success, std::string &message)
double _unstuck_timer_duration
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
static void poseMsgToTF(const geometry_msgs::Pose &msg, Pose &bt)
void goalObsoleteCallback(const std_msgs::Bool::ConstPtr &msg)
ros::Subscriber _get_goal_obsolete_subscriber
void onExplorationStart(bool &success, std::string &message)
int _navigation_completed_status
ros::Subscriber _operation_mode_subscriber
boost::shared_ptr< rsm::BaseState > getPluginState(int plugin_type, std::string routine="")
ros::ServiceClient _get_reverse_mode_service
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ros::ServiceClient _get_navigation_goal_service
#define SIMPLE_GOAL_STOP_INTERRUPT
State being active when the robot should move to a previously set goal. First obtains the goal and th...
bool call(MReq &req, MRes &res)
void onWaypointFollowingStop(bool &success, std::string &message)
geometry_msgs::Pose _nav_goal
void transitionToVolatileState(boost::shared_ptr< rsm::BaseState > next_state)
#define WAYPOINT_FOLLOWING
#define TELEOPERATION_INTERRUPT
void onInterrupt(int interrupt)
Called when an operation mode interrupt was received.
void unstuckTimerCallback(const ros::TimerEvent &event)
Callback for switched mode navigation to unstuck robot.
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
tf::Vector3 _last_position
ros::ServiceClient _get_robot_pose_service
#define CALCULATEGOAL_STATE
void idleTimerCallback(const ros::TimerEvent &event)
Callback for idle timer.
StateInterface * _stateinterface
#define EMERGENCY_STOP_INTERRUPT
double _idle_timer_duration
void onExplorationStop(bool &success, std::string &message)
#define ROS_WARN_STREAM(args)
ros::ServiceClient _get_exploration_mode_service
void operationModeCallback(const rsm_msgs::OperationMode::ConstPtr &operation_mode)
ros::ServiceClient _navigation_goal_completed_service
actionlib::SimpleActionClient< move_base_msgs::MoveBaseAction > MoveBaseClient
void getRPY(tfScalar &roll, tfScalar &pitch, tfScalar &yaw, unsigned int solution_number=1) const
void reverseModeCallback(const std_msgs::Bool::ConstPtr &reverse_mode)
bool _unstucking_executed
#define SIMPLE_GOAL_INTERRUPT
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
boost::shared_ptr< MoveBaseClient > _move_base_client
ros::Timer _unstuck_timer
bool _idle_timer_behavior
ros::Subscriber _reverse_mode_subscriber