00001 /* -*- mode: C++ -*- 00002 * 00003 * Navigator "slow down for curves" controller 00004 * Copyright (C) 2007, 2010, Mickey Ristroph 00005 * 00006 * License: Modified BSD Software License Agreement 00007 * 00008 * $Id: slow_for_curves.h 872 2010-11-28 13:31:07Z jack.oquin $ 00009 */ 00010 00011 #ifndef __SLOW_FOR_CURVES_HH__ 00012 #define __SLOW_FOR_CURVES_HH__ 00013 00014 class SlowForCurves: public Controller 00015 { 00016 public: 00017 00018 SlowForCurves(Navigator *navptr, int _verbose): 00019 Controller(navptr, _verbose), current_limiting_id(0) {} 00020 ~SlowForCurves() {} 00021 result_t control(pilot_command_t &pcmd); 00022 void reset(void); 00023 00024 00025 private: 00026 00027 // state 00028 int current_limiting_id; 00029 00030 float max_safe_speed(const std::vector<poly>& polygons, 00031 const int& start_index, 00032 const int& stop_index, 00033 const float& max); 00034 }; 00035 00036 #endif // __SLOW_FOR_CURVES_HH__