00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "navigator_internal.h"
00011 #include "Controller.h"
00012 #include "course.h"
00013 #include "obstacle.h"
00014 #include "road.h"
00015
00016
00017 #include "follow_lane.h"
00018 #include "follow_safely.h"
00019 #include "halt.h"
00020
00021
00022 #include "ntimer.h"
00023 #include "uturn.h"
00024
00025
00026 Road::Road(Navigator *navptr, int _verbose):
00027 Controller(navptr, _verbose)
00028 {
00029 passing_first=true;
00030
00031
00032 for (int event = 0; event < (int) NavRoadEvent::N_events; ++event)
00033 for (int state = 0; state < (int) NavRoadState::N_states; ++state)
00034 {
00035 transtion_t *xp = &ttable[event][state];
00036 xp->action = &Road::ActionError;
00037 xp->next = (NavRoadState::state_t) state;
00038 }
00039
00040
00041
00042 Add(NavRoadEvent::Collision, &Road::ActionToEvade,
00043 NavRoadState::Block, NavRoadState::Evade);
00044 Add(NavRoadEvent::FollowLane, &Road::ActionToFollow,
00045 NavRoadState::Block, NavRoadState::Follow);
00046 Add(NavRoadEvent::None, &Road::ActionInBlock,
00047 NavRoadState::Block, NavRoadState::Block);
00048 Add(NavRoadEvent::Uturn, &Road::ActionToUturn,
00049 NavRoadState::Block, NavRoadState::Uturn);
00050
00051 #if 0 // JOQ: I don't think this is possible
00052 Add(NavRoadEvent::Block, &Road::ActionInEvade,
00053 NavRoadState::Evade, NavRoadState::Evade);
00054 #endif
00055 Add(NavRoadEvent::FollowLane, &Road::ActionEvadeToFollow,
00056 NavRoadState::Evade, NavRoadState::Follow);
00057 Add(NavRoadEvent::None, &Road::ActionInEvade,
00058 NavRoadState::Evade, NavRoadState::Evade);
00059 Add(NavRoadEvent::Pass, &Road::ActionToPass,
00060 NavRoadState::Evade, NavRoadState::Pass);
00061
00062 Add(NavRoadEvent::WaitPass, &Road::ActionInEvade,
00063 NavRoadState::Evade, NavRoadState::Evade);
00064
00065 Add(NavRoadEvent::Block, &Road::ActionToBlock,
00066 NavRoadState::Follow, NavRoadState::Block);
00067 Add(NavRoadEvent::ChangeLane, &Road::ActionToWaitLane,
00068 NavRoadState::Follow, NavRoadState::WaitLane);
00069 Add(NavRoadEvent::Collision, &Road::ActionToEvade,
00070 NavRoadState::Follow, NavRoadState::Evade);
00071 Add(NavRoadEvent::FollowLane, &Road::ActionInFollow,
00072 NavRoadState::Follow, NavRoadState::Follow);
00073 Add(NavRoadEvent::Merge, &Road::ActionToWaitCross,
00074 NavRoadState::Follow, NavRoadState::WaitCross);
00075 Add(NavRoadEvent::None, &Road::ActionInFollow,
00076 NavRoadState::Follow, NavRoadState::Follow);
00077 Add(NavRoadEvent::Perimeter, &Road::ActionToZone,
00078 NavRoadState::Follow, NavRoadState::Zone);
00079 Add(NavRoadEvent::StopLine, &Road::ActionToWaitStop,
00080 NavRoadState::Follow, NavRoadState::WaitStop);
00081 Add(NavRoadEvent::Uturn, &Road::ActionToUturn,
00082 NavRoadState::Follow, NavRoadState::Uturn);
00083 Add(NavRoadEvent::WaitPass, &Road::ActionToWaitPass,
00084 NavRoadState::Follow, NavRoadState::WaitPass);
00085
00086 Add(NavRoadEvent::FollowLane, &Road::ActionToFollow,
00087 NavRoadState::Init, NavRoadState::Follow);
00088 Add(NavRoadEvent::Merge, &Road::ActionToWaitCross,
00089 NavRoadState::Init, NavRoadState::WaitCross);
00090 Add(NavRoadEvent::None, &Road::ActionInInit,
00091 NavRoadState::Init, NavRoadState::Init);
00092 Add(NavRoadEvent::Perimeter, &Road::ActionToZone,
00093 NavRoadState::Init, NavRoadState::Zone);
00094
00095 Add(NavRoadEvent::Block, &Road::ActionPassToBlock,
00096 NavRoadState::Pass, NavRoadState::Block);
00097 Add(NavRoadEvent::Collision, &Road::ActionPassToEvade,
00098 NavRoadState::Pass, NavRoadState::Evade);
00099 Add(NavRoadEvent::FollowLane, &Road::ActionPassToFollow,
00100 NavRoadState::Pass, NavRoadState::Follow);
00101 Add(NavRoadEvent::None, &Road::ActionInPass,
00102 NavRoadState::Pass, NavRoadState::Pass);
00103 Add(NavRoadEvent::Pass, &Road::ActionInPass,
00104 NavRoadState::Pass, NavRoadState::Pass);
00105
00106 Add(NavRoadEvent::FollowLane, &Road::ActionToFollow,
00107 NavRoadState::Uturn, NavRoadState::Follow);
00108 Add(NavRoadEvent::None, &Road::ActionInUturn,
00109 NavRoadState::Uturn, NavRoadState::Uturn);
00110
00111 Add(NavRoadEvent::FollowLane, &Road::ActionToFollow,
00112 NavRoadState::WaitCross, NavRoadState::Follow);
00113 Add(NavRoadEvent::None, &Road::ActionInWaitCross,
00114 NavRoadState::WaitCross, NavRoadState::WaitCross);
00115 Add(NavRoadEvent::Merge, &Road::ActionInWaitCross,
00116 NavRoadState::WaitCross, NavRoadState::WaitCross);
00117
00118 Add(NavRoadEvent::FollowLane, &Road::ActionToFollow,
00119 NavRoadState::WaitLane, NavRoadState::Follow);
00120 Add(NavRoadEvent::None, &Road::ActionInWaitLane,
00121 NavRoadState::WaitLane, NavRoadState::WaitLane);
00122 Add(NavRoadEvent::ChangeLane, &Road::ActionInWaitLane,
00123 NavRoadState::WaitLane, NavRoadState::WaitLane);
00124
00125 Add(NavRoadEvent::Block, &Road::ActionToBlock,
00126 NavRoadState::WaitPass, NavRoadState::Block);
00127 Add(NavRoadEvent::Collision, &Road::ActionToEvade,
00128 NavRoadState::WaitPass, NavRoadState::Evade);
00129 Add(NavRoadEvent::FollowLane, &Road::ActionWaitPassToFollow,
00130 NavRoadState::WaitPass, NavRoadState::Follow);
00131 Add(NavRoadEvent::None, &Road::ActionInWaitPass,
00132 NavRoadState::WaitPass, NavRoadState::WaitPass);
00133 Add(NavRoadEvent::Pass, &Road::ActionToPass,
00134 NavRoadState::WaitPass, NavRoadState::Pass);
00135 Add(NavRoadEvent::WaitPass, &Road::ActionInWaitPass,
00136 NavRoadState::WaitPass, NavRoadState::WaitPass);
00137
00138 Add(NavRoadEvent::Merge, &Road::ActionToWaitCross,
00139 NavRoadState::WaitStop, NavRoadState::WaitCross);
00140 Add(NavRoadEvent::None, &Road::ActionInWaitStop,
00141 NavRoadState::WaitStop, NavRoadState::WaitStop);
00142 Add(NavRoadEvent::StopLine, &Road::ActionInWaitStop,
00143 NavRoadState::WaitStop, NavRoadState::WaitStop);
00144
00145 Add(NavRoadEvent::None, &Road::ActionInZone,
00146 NavRoadState::Zone, NavRoadState::Zone);
00147 Add(NavRoadEvent::Perimeter, &Road::ActionZoneToWaitCross,
00148 NavRoadState::Zone, NavRoadState::WaitCross);
00149
00150
00151
00152 follow_lane = new FollowLane(navptr, _verbose);
00153 follow_safely = new FollowSafely(navptr, _verbose);
00154 halt = new Halt(navptr, _verbose);
00155
00156 uturn = new Uturn(navptr, _verbose);
00157
00158
00159
00160 passing_timer = new NavTimer();
00161 precedence_timer = new NavTimer();
00162 roadblock_timer = new NavTimer();
00163 stop_line_timer = new NavTimer();
00164
00165
00166 reset_me();
00167 }
00168
00169 Road::~Road()
00170 {
00171
00172 delete follow_lane;
00173 delete follow_safely;
00174 delete halt;
00175
00176 delete uturn;
00177
00178
00179 delete passing_timer;
00180 delete precedence_timer;
00181 delete roadblock_timer;
00182 delete stop_line_timer;
00183 };
00184
00185
00186 void Road::Add(NavRoadEvent::event_t event, action_t action,
00187 NavRoadState::state_t from_state,
00188 NavRoadState::state_t to_state)
00189 {
00190 transtion_t *xp = &ttable[event][from_state];
00191 xp->action = action;
00192 xp->next = to_state;
00193 }
00194
00195 void Road::cancel_all_timers(void)
00196 {
00197 passing_timer->Cancel();
00198 precedence_timer->Cancel();
00199 roadblock_timer->Cancel();
00200 stop_line_timer->Cancel();
00201 }
00202
00203 Controller::result_t Road::control(pilot_command_t &pcmd)
00204 {
00205
00206 event = pending_event;
00207 pending_event = NavRoadEvent::None;
00208
00209
00210 transtion_t *xp = &ttable[event.Value()][state.Value()];
00211
00212
00213 prev = state;
00214 state = xp->next;
00215 if (state != prev)
00216 {
00217 if (verbose)
00218 ART_MSG(4, "Navigator road state changing from %s to %s, event = %s",
00219 prev.Name(), state.Name(), event.Name());
00220 navdata->road.state = state.Value();
00221 }
00222 else
00223 {
00224 if (verbose >= 4)
00225 ART_MSG(4, "Navigator road state is %s, event = %s",
00226 state.Name(), event.Name());
00227 }
00228
00229
00230 action_t action = xp->action;
00231 return (this->*action)(pcmd);
00232 }
00233
00234
00235 void Road::reset(void)
00236 {
00237 trace_reset("Road");
00238 reset_me();
00239
00240 follow_lane->reset();
00241 follow_safely->reset();
00242 halt->reset();
00243
00244 uturn->reset();
00245
00246 }
00247
00248
00249 void Road::reset_me(void)
00250 {
00251 state = NavRoadState();
00252 event = NavRoadEvent::None;
00253 pending_event = NavRoadEvent::None;
00254 cancel_all_timers();
00255 }
00256
00257 void Road::set_waypt_event(void)
00258 {
00259 if (ElementID(navdata->last_waypt) == ElementID(order->waypt[1].id))
00260 {
00261
00262 if (order->waypt[1].is_perimeter)
00263 pending_event = NavRoadEvent::Perimeter;
00264 else if (order->waypt[1].is_stop)
00265 pending_event = NavRoadEvent::StopLine;
00266 else if (course->uturn_waypt(1))
00267 pending_event = NavRoadEvent::Uturn;
00268 else if (order->waypt[1].is_lane_change)
00269 pending_event = NavRoadEvent::ChangeLane;
00270 else if (order->waypt[1].is_exit
00271 && !course->same_lane(order->waypt[1].id,
00272 order->waypt[2].id)) {
00273 if (course->nqe_special(1,2))
00274 ART_MSG(3, "Not going to merge for special case");
00275 else
00276 pending_event = NavRoadEvent::Merge;
00277 }
00278 }
00279 }
00280
00282
00284
00285 Controller::result_t Road::ActionError(pilot_command_t &pcmd)
00286 {
00287 ART_MSG(4, "Invalid Navigator event %s in road state %s",
00288 event.Name(), prev.Name());
00289 halt->control(pcmd);
00290 return NotApplicable;
00291 }
00292
00293 Controller::result_t Road::ActionFail(pilot_command_t &pcmd)
00294 {
00295 ART_MSG(4, "Navigator road FSM failure!");
00296 halt->control(pcmd);
00297 return NotImplemented;
00298 }
00299
00300
00301
00302 Controller::result_t Road::ActionInBlock(pilot_command_t &pcmd)
00303 {
00304 result_t result = Blocked;
00305 if (course->new_waypts())
00306 {
00307
00308
00309 if (course->uturn_waypt(0))
00310 {
00311 pending_event = NavRoadEvent::Uturn;
00312 ART_MSG(1, "Doing U-turn after road block");
00313 }
00314 else
00315 {
00316 pending_event = NavRoadEvent::FollowLane;
00317 ART_MSG(1, "Following lane (NOT U-turn) after road block");
00318 }
00319 navdata->road_blocked = false;
00320 navdata->replan_waypt = ElementID().toMapID();
00321 halt->control(pcmd);
00322 }
00323 else
00324 {
00325
00326
00327 result = follow_lane->control(pcmd);
00328 if (result == Collision)
00329 {
00330
00331 pending_event = NavRoadEvent::Collision;
00332 }
00333 else if (result != Blocked)
00334 {
00335 ART_MSG(1, "No longer blocked, following lane again.");
00336 pending_event = NavRoadEvent::FollowLane;
00337
00338
00339 set_waypt_event();
00340
00341
00342 navdata->road_blocked = false;
00343 navdata->replan_waypt = ElementID().toMapID();
00344
00345 }
00346 }
00347 return result;
00348 }
00349
00350 Controller::result_t Road::ActionInEvade(pilot_command_t &pcmd)
00351 {
00353
00354 result_t result = halt->control(pcmd);
00355 if (result == Finished)
00356 {
00357 pending_event = NavRoadEvent::FollowLane;
00358 result = OK;
00359 }
00360 return result;
00361 }
00362
00363 Controller::result_t Road::ActionInFollow(pilot_command_t &pcmd)
00364 {
00365
00366 if (!navdata->stopped)
00367 passing_timer->Cancel();
00368
00369 result_t result = follow_lane->control(pcmd);
00370 if (result == Blocked)
00371 {
00372 pending_event = NavRoadEvent::WaitPass;
00373 result = OK;
00374 }
00375 else if (result == Collision)
00376 {
00377
00378 pending_event = NavRoadEvent::Collision;
00379 }
00380 else
00381 {
00382
00383 set_waypt_event();
00384 result = OK;
00385 }
00386 return result;
00387 }
00388
00389 Controller::result_t Road::ActionInInit(pilot_command_t &pcmd)
00390 {
00391 if (order->waypt[0].is_perimeter || order->waypt[0].is_spot)
00392 pending_event = NavRoadEvent::Perimeter;
00393 else
00394
00395 pending_event = NavRoadEvent::FollowLane;
00396 return halt->control(pcmd);
00397 }
00398
00399 Controller::result_t Road::ActionInPass(pilot_command_t &pcmd)
00400 {
00401
00402 result_t result = Finished;
00403 if (result == Finished)
00404 {
00405 pending_event = NavRoadEvent::FollowLane;
00406 roadblock_timer->Cancel();
00407 result = OK;
00408 }
00409 else if (result == Blocked)
00410 {
00411
00412
00413 if (roadblock_timer->Check())
00414 {
00415 pending_event = NavRoadEvent::Block;
00416 roadblock_timer->Cancel();
00417 }
00418 else
00419 {
00420 if (passing_first)
00421 {
00422 passing_first=false;
00423
00424 obstacle->blocked();
00425 roadblock_timer->Restart(config_->roadblock_delay);
00426 result = Unsafe;
00427 }
00428 }
00429 }
00430 else if (result == Collision)
00431 {
00432
00433 pending_event = NavRoadEvent::Collision;
00434 roadblock_timer->Cancel();
00435 }
00436 return result;
00437 }
00438
00439 Controller::result_t Road::ActionInUturn(pilot_command_t &pcmd)
00440 {
00441 result_t result = uturn->control(pcmd);
00442 if (result == Finished)
00443 {
00444 pending_event = NavRoadEvent::FollowLane;
00445 result = OK;
00446 }
00447 return result;
00448 }
00449
00450 Controller::result_t Road::ActionInWaitCross(pilot_command_t &pcmd)
00451 {
00452 result_t result = halt->control(pcmd);
00453
00454 if (obstacle->observer_clear(crossing_observer))
00455 {
00456 pending_event = NavRoadEvent::FollowLane;
00457 }
00458 return result;
00459 }
00460
00461 Controller::result_t Road::ActionInWaitLane(pilot_command_t &pcmd)
00462 {
00463 result_t result = halt->control(pcmd);
00464 if (lane_direction == Course::Straight)
00465 {
00466 ART_MSG(1, "Not waiting for lane to clear -- polygons missing.");
00467 pending_event = NavRoadEvent::FollowLane;
00468 }
00469 else
00470 {
00471
00472 Observation::_oid_type lane_observer;
00473 if (lane_direction == Course::Left)
00474 {
00475 ART_MSG(1, "Waiting for nearest left lane to clear.");
00476 lane_observer = Observers::Adjacent_left;
00477 }
00478 else
00479 {
00480 ART_MSG(1, "Waiting for nearest right lane to clear.");
00481 lane_observer = Observers::Adjacent_right;
00482 }
00483
00484 if (obstacle->observer_clear(lane_observer))
00485 {
00486 pending_event = NavRoadEvent::FollowLane;
00487 }
00488 }
00489 return result;
00490 }
00491
00492 Controller::result_t Road::ActionInWaitPass(pilot_command_t &pcmd)
00493 {
00494
00495 if (passing_timer->Check()
00496 && obstacle->passing_lane_clear())
00497 {
00498
00499 pending_event = NavRoadEvent::Pass;
00500 }
00501
00502
00503
00504 result_t result = follow_safely->control(pcmd);
00505 if (result == OK)
00506 {
00507 pending_event = NavRoadEvent::FollowLane;
00508 }
00509 else if (result == Collision)
00510 {
00511 pending_event = NavRoadEvent::Collision;
00512 }
00513
00514
00515 halt->control(pcmd);
00516 return result;
00517 }
00518
00519 Controller::result_t Road::ActionInWaitStop(pilot_command_t &pcmd)
00520 {
00521 halt->control(pcmd);
00522
00523
00524 if (stop_line_timer->Check()
00525 && obstacle->observer_clear(Observers::Intersection))
00526 {
00527 ART_MSG(1, "Our turn to cross intersection.");
00528 stop_line_timer->Cancel();
00529 precedence_timer->Cancel();
00530 pending_event = NavRoadEvent::Merge;
00531 }
00532
00533
00534 Observation obs = obstacle->observation(Observers::Intersection);
00535 if (obs.applicable && obs.nobjects != prev_nobjects)
00536 {
00537 prev_nobjects = obs.nobjects;
00538 ART_MSG(1, "Cars having precedence at this intersection: %d.",
00539 prev_nobjects);
00540 precedence_timer->Start(config_->precedence_delay);
00541 }
00542
00543
00544 if (precedence_timer->Check())
00545 {
00546 ART_MSG(1, "Intersection precedence %.1f second timeout, go ahead.",
00547 config_->precedence_delay);
00548 stop_line_timer->Cancel();
00549 precedence_timer->Cancel();
00550 pending_event = NavRoadEvent::Merge;
00551 }
00552 return OK;
00553 }
00554
00555 Controller::result_t Road::ActionInZone(pilot_command_t &pcmd)
00556 {
00557
00558 result_t result = NotApplicable;
00559 if (ElementID(navdata->last_waypt) == ElementID(order->waypt[1].id)
00560 && order->waypt[1].is_perimeter)
00561 {
00562
00563 pending_event = NavRoadEvent::Perimeter;
00564 }
00565 else if (result == NotApplicable)
00566 {
00567 pending_event = NavRoadEvent::Perimeter;
00568 result = OK;
00569 }
00570 #if 1
00571 else
00572
00573 obstacle->blocked();
00574 #endif
00575
00576 return result;
00577 }
00578
00579
00580
00581 Controller::result_t Road::ActionEvadeToFollow(pilot_command_t &pcmd)
00582 {
00583 ART_MSG(1, "Collision evasion done, continue in original lane");
00584 course->reset();
00585 return ActionToFollow(pcmd);
00586 }
00587
00588 Controller::result_t Road::ActionPassToBlock(pilot_command_t &pcmd)
00589 {
00590 ART_MSG(1, "passing blocked, replan route from here");
00591 course->reset();
00592 course->plan = course->passed_lane;
00593 return ActionToBlock(pcmd);
00594 }
00595
00596 Controller::result_t Road::ActionPassToEvade(pilot_command_t &pcmd)
00597 {
00598 ART_MSG(1, "danger while passing, try to evade");
00599 course->reset();
00600 course->plan = course->passed_lane;
00601 return ActionToEvade(pcmd);
00602 }
00603
00604 Controller::result_t Road::ActionPassToFollow(pilot_command_t &pcmd)
00605 {
00606 ART_MSG(1, "passing completed, returning to original lane");
00607 course->reset();
00608 course->signal_pass_return();
00609 return ActionToFollow(pcmd);
00610 }
00611
00612 Controller::result_t Road::ActionToBlock(pilot_command_t &pcmd)
00613 {
00614 ART_MSG(1, "Road blocked!");
00615 course->turn_signals_off();
00616 navdata->road_blocked = true;
00617 navdata->replan_waypt = course->replan_roadblock().toMapID();
00618 follow_lane->reset();
00619 return ActionInBlock(pcmd);
00620 }
00621
00622 Controller::result_t Road::ActionToEvade(pilot_command_t &pcmd)
00623 {
00624 #if 0 // don't try to pass for now, easier to unit test Evade logic
00625
00626 if (course->find_passing_lane())
00627 {
00628
00629 if (obstacle->passing_lane_clear())
00630 {
00631
00632 pending_event = NavRoadEvent::Pass;
00633 return halt->control(pcmd);
00634 }
00635 }
00636
00637 evade->reset();
00638 #endif
00639 return ActionInEvade(pcmd);
00640 }
00641
00642 Controller::result_t Road::ActionToFollow(pilot_command_t &pcmd)
00643 {
00644
00645
00646 #if 0
00647 cancel_all_timers();
00648 #endif
00649 follow_lane->reset();
00650 return ActionInFollow(pcmd);
00651 }
00652
00653 Controller::result_t Road::ActionToPass(pilot_command_t &pcmd)
00654 {
00655
00656
00657 if (course->switch_to_passing_lane())
00658 {
00659 passing_timer->Cancel();
00660
00661 return ActionInPass(pcmd);
00662 }
00663 else
00664 {
00665
00666
00667 pending_event = NavRoadEvent::Block;
00668 return halt->control(pcmd);
00669 }
00670 }
00671
00672 Controller::result_t Road::ActionToUturn(pilot_command_t &pcmd)
00673 {
00674 ART_MSG(1, "Start U-turn.");
00675 course->turn_signal_on(true);
00676 uturn->reset();
00677 return ActionInUturn(pcmd);
00678 }
00679
00680 Controller::result_t Road::ActionToWaitCross(pilot_command_t &pcmd)
00681 {
00682 Course::direction_t crossing_direction = course->intersection_direction();
00683 #if 0 // always use Merge_across_all, Merge_into_nearest is broken
00684 if (crossing_direction == Course::Right)
00685 {
00686
00687
00688 ART_MSG(1, "Waiting for nearest intersection lane to clear.");
00689 crossing_observer = Observers::Merge_into_nearest;
00690 }
00691 else
00692 #endif
00693 {
00694
00695 ART_MSG(1, "Waiting for all intersection lanes to clear.");
00696 crossing_observer = Observers::Merge_across_all;
00697 }
00698 course->signal_for_direction(crossing_direction);
00699 return ActionInWaitCross(pcmd);
00700 }
00701
00702 Controller::result_t Road::ActionToWaitLane(pilot_command_t &pcmd)
00703 {
00704 lane_direction = course->lane_change_direction();
00705 course->signal_for_direction(lane_direction);
00706 return ActionInWaitLane(pcmd);
00707 }
00708
00709 Controller::result_t Road::ActionToWaitPass(pilot_command_t &pcmd)
00710 {
00711 passing_first=true;
00712
00713
00714 if (course->find_passing_lane())
00715 {
00716
00717 course->signal_pass();
00718 passing_timer->Restart(config_->passing_delay);
00719 return ActionInWaitPass(pcmd);
00720 }
00721 else
00722 {
00723
00724 pending_event = NavRoadEvent::Block;
00725 halt->control(pcmd);
00726 return Blocked;
00727 }
00728 }
00729
00730 Controller::result_t Road::ActionToWaitStop(pilot_command_t &pcmd)
00731 {
00732 ART_MSG(1, "Waiting for intersection precedence.");
00733 course->signal_for_direction(course->intersection_direction());
00734 stop_line_timer->Start(config_->stop_line_delay);
00735 precedence_timer->Start(config_->precedence_delay);
00736 prev_nobjects = -1;
00737 return ActionInWaitStop(pcmd);
00738 }
00739
00740 Controller::result_t Road::ActionToZone(pilot_command_t &pcmd)
00741 {
00742 ART_MSG(1, "Entering zone");
00743
00744 return ActionInZone(pcmd);
00745 }
00746
00747 Controller::result_t Road::ActionWaitPassToFollow(pilot_command_t &pcmd)
00748 {
00749 ART_MSG(1, "no need to pass, continue in this lane");
00750 course->reset();
00751 course->turn_signals_off();
00752 return ActionToFollow(pcmd);
00753 }
00754
00755 Controller::result_t Road::ActionZoneToWaitCross(pilot_command_t &pcmd)
00756 {
00757 ART_MSG(1, "Leaving zone");
00758 return ActionToWaitCross(pcmd);
00759 }