#include <run.h>
Public Member Functions | |
result_t | control (pilot_command_t &pcmd) |
void | reset (void) |
Run (Navigator *navptr, int _verbose) | |
~Run () | |
Private Types | |
enum | state_t { Continue, Escape, Replan } |
Private Member Functions | |
void | begin_escape (void) |
Controller::result_t | go (pilot_command_t &pcmd) |
Controller::result_t | initialize (pilot_command_t &pcmd) |
void | set_go_state (state_t) |
ElementID | starting_waypt (void) |
Private Attributes | |
MapPose | blockage_pose |
float | blockage_waypt_dist |
state_t | go_state |
Halt * | halt |
int | last_replan |
Road * | road |
enum Run::state_t [private] |
void Run::begin_escape | ( | void | ) | [private] |
Controller::result_t Run::control | ( | pilot_command_t & | pcmd | ) | [virtual] |
Main controller whenever E-stop is in the Run state.
Each order contains a behavior which determines the navigator run state for this cycle.
Reimplemented from Controller.
Controller::result_t Run::go | ( | pilot_command_t & | pcmd | ) | [private] |
controller for Go behavior.
Blockage handling:
Set obstacle blockage timer when car stops.
Restart timer in observer_clear() and in follow_lane when waiting for an obstacle in a stop line (not intersection) safety area.
When the blockage timer expires, remember the current pose, stop calling the road controller, and instead call the unstuck controller (VoronoiZone). When it has gone 10m, run the starting_waypt() algorithm to determine a new replan_waypt. When Commander sees replan_waypt set without the roadblock flag, it will make a new plan. When the new plan is received, reset the road controller and attempt to continue.
While blocked, mark waypt[1] reached whenever the front bumper is within zone_waypoint_radius. TODO: configure a larger radius.
Commander looks at both the roadblock flag and the replan_waypt. If replan_waypt is set it makes a new plan from there. If the roadblock flag is also set, it marks a blockage in the RNDF after last_waypt. Commander marks every order with a replan_num that is incremented every time replan route runs, so Navigator can detect when that has been done.
Controller::result_t Run::initialize | ( | pilot_command_t & | pcmd | ) | [private] |
void Run::reset | ( | void | ) | [virtual] |
Reimplemented from Controller.
void Run::set_go_state | ( | state_t | newstate | ) | [private] |
ElementID Run::starting_waypt | ( | void | ) | [private] |
MapPose Run::blockage_pose [private] |
float Run::blockage_waypt_dist [private] |
state_t Run::go_state [private] |
int Run::last_replan [private] |