17 rsm_msgs::SetWaypointFollowingMode>(
18 "setWaypointFollowingMode");
22 rsm_msgs::WaypointVisited>(
"waypointVisited");
24 rsm_msgs::SetNavigationGoal>(
"setNavigationGoal");
26 _name =
"W: Waypoint Following";
35 int next_reachable_unvisited_waypoint_position = -1;
40 next_reachable_unvisited_waypoint_position = i;
48 next_reachable_unvisited_waypoint_position = i;
53 if (next_reachable_unvisited_waypoint_position != -1) {
75 rsm_msgs::SetWaypointFollowingMode srv2;
79 ROS_ERROR(
"Failed to call Set Waypoint Following Mode service");
96 rsm_msgs::SetNavigationGoal srv;
101 srv.request.routine =
105 ROS_ERROR(
"Failed to call Set Navigation Goal service");
111 std::string &message) {
113 message =
"Waypoint following running";
117 std::string &message) {
119 message =
"Waypoint following running";
123 std::string &message) {
125 message =
"Waypoint following running";
129 std::string &message) {
131 message =
"Waypoint following stopped";
139 boost::make_shared<EmergencyStopState>());
144 boost::make_shared<TeleoperationState>());
158 boost::make_shared<IdleState>());
163 rsm_msgs::GetWaypoints srv;
168 "Waypoint Following stopped because no waypoints are available");
172 ROS_ERROR(
"Failed to call Get Waypoints service");
179 rsm_msgs::WaypointVisited srv;
181 srv.request.position = 0;
186 ROS_ERROR(
"Failed to call Waypoint Visited service");
191 std_srvs::Trigger srv;
193 ROS_ERROR(
"Failed to call Reset Waypoints service");
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
~WaypointFollowingState()
ros::ServiceClient _set_waypoint_following_mode_service
boost::shared_ptr< rsm::BaseState > getPluginState(int plugin_type, std::string routine="")
Returns a plugin-state corresponding to the given type.
void onInterrupt(int interrupt)
Called when an operation mode interrupt was received.
void onWaypointFollowingStart(bool &success, std::string &message)
void onExplorationStop(bool &success, std::string &message)
bool call(MReq &req, MRes &res)
ros::ServiceClient _waypoint_visited_service
rsm_msgs::WaypointArray _waypoint_array
void transitionToVolatileState(boost::shared_ptr< rsm::BaseState > next_state)
bool _interrupt_occured
Shows if an interupt occured.
#define WAYPOINT_FOLLOWING
#define TELEOPERATION_INTERRUPT
void onExplorationStart(bool &success, std::string &message)
void abortWaypointFollowing()
std::string _name
Name of the state.
int _next_waypoint_position
StateInterface * _stateinterface
Pointer to State Interface handling all state transitions.
void setCurrentWaypointVisited()
#define EMERGENCY_STOP_INTERRUPT
ros::ServiceClient _reset_waypoints_service
ros::ServiceClient _get_waypoints_service
void onWaypointFollowingStop(bool &success, std::string &message)
ros::ServiceClient _set_navigation_goal_service
#define SIMPLE_GOAL_INTERRUPT