


Definition at line 69 of file BeobotControl.H.
Public Member Functions | |
| BeobotControl (nub::soft_ref< BeoChip > beoChip, OptionManager &mgr, const std::string &descrName="Beobot Controller", const std::string &tagName="BeobotControl") | |
| General constructor. | |
| ~BeobotControl () | |
| Constructor. | |
| void | calibrateSpeed (const byte neutralval, const byte minval, const byte maxval) |
| calibrate the speed SSC to new values | |
| void | calibrateSteer (const byte neutralval, const byte minval, const byte maxval) |
| calibrate the steering SSC to new values | |
| float | getSpeed () const |
| get speed value [-1.0 .. 1.0] | |
| float | getGear () const |
| get gear value [-1.0 .. 1.0] | |
| float | getSteer () const |
| get steer value [-1.0 .. 1.0] | |
| bool | setSpeed (const float newspeed) |
| set speed value: [-1.0 (full reverse) to 1.0 (full forward)] | |
| bool | setGear (const float newgear) |
| set gear: -1.0 (neutral) 0.0 (first gear, slow), 1.0 (second gear, fast) | |
| bool | setSteer (const float newsteer) |
| set steer angle: [-1.0 (full left) to 1.0 (full right)] | |
| bool | toSpeedLinear (const float newspeed, const int t) |
| linear ramp of speed from current speed to new speed | |
| bool | toSpeedSigmoid (const float newspeed, const int t) |
| sigmoid ramp of speed from current speed to new speed | |
| void | rampSpeed (const float newspeed, const int t, SpeedRampType behavior) |
| speed ramping function | |
| void | abortRamp (void) |
| aborts speed ramping | |
Friends | |
| void * | speedRampFunc (void *ptr) |
| routine for speed ramp thread | |
|
||||||||||||||||||||
|
General constructor.
Definition at line 132 of file BeobotControl.C. References BeobotConfig::gearMinVal, BeobotConfig::gearServoNum, BeobotConfig::speedNeutralVal, BeobotConfig::speedServoNum, BeobotConfig::steerNeutralVal, and BeobotConfig::steerServoNum. |
|
|
Constructor.
Definition at line 155 of file BeobotControl.C. |
|
|
aborts speed ramping Used to stop speed ramping thread so that main program has priority for setting speed. Definition at line 327 of file BeobotControl.C. |
|
||||||||||||||||
|
calibrate the speed SSC to new values The speed SSC is calibrated to the values defined in a car.conf file during construction. This function allows the SSC to be recalibrated to new min/neutral/max values. |
|
||||||||||||||||
|
calibrate the steering SSC to new values The steering SSC is calibrated to the values defined in a car.conf file during construction. This function allows the SSC to be recalibrated to new min/neutral/max values. |
|
|
get gear value [-1.0 .. 1.0]
Definition at line 166 of file BeobotControl.C. References BeobotConfig::gearServoNum. Referenced by setGear(). |
|
|
get speed value [-1.0 .. 1.0]
Definition at line 158 of file BeobotControl.C. References BeobotConfig::speedServoNum. Referenced by rampSpeed(), setSpeed(), toSpeedLinear(), and toSpeedSigmoid(). |
|
|
get steer value [-1.0 .. 1.0]
Definition at line 162 of file BeobotControl.C. References BeobotConfig::steerServoNum. Referenced by setSteer(). |
|
||||||||||||||||
|
speed ramping function This function is used for gradually increasing the speed with a certain behavior over a certain period of time. The ramping will be done in a separate thread so this function will return immediately. It is not necessary to wait until the new speed has been reached before calling this function to modify the ramping parameters again. The ramping function will be stopped if abortRamp() is called, or else if the thread continues other calls to setSpeed() may seem to have no effect.
Definition at line 302 of file BeobotControl.C. References getSpeed(), Timer::reset(), and speedRampFunc. |
|
|
set gear: -1.0 (neutral) 0.0 (first gear, slow), 1.0 (second gear, fast)
Definition at line 211 of file BeobotControl.C. References BeobotConfig::gearServoNum, getGear(), and MAX_SERVO_MOVE. |
|
|
set speed value: [-1.0 (full reverse) to 1.0 (full forward)]
Definition at line 170 of file BeobotControl.C. References getSpeed(), MAX_SERVO_MOVE, and BeobotConfig::speedServoNum. Referenced by speedRampFunc(), toSpeedLinear(), and toSpeedSigmoid(). |
|
|
set steer angle: [-1.0 (full left) to 1.0 (full right)]
Definition at line 193 of file BeobotControl.C. References getSteer(), MAX_SERVO_MOVE, and BeobotConfig::steerServoNum. |
|
||||||||||||
|
linear ramp of speed from current speed to new speed Speed will reach newspeed after t milliseconds Definition at line 241 of file BeobotControl.C. References Timer::get(), getSpeed(), i, and setSpeed(). |
|
||||||||||||
|
sigmoid ramp of speed from current speed to new speed Speed will reach newspeed after t milliseconds Definition at line 270 of file BeobotControl.C. References exp(), Timer::get(), getSpeed(), i, and setSpeed(). |
|
|
routine for speed ramp thread
Definition at line 46 of file BeobotControl.C. Referenced by rampSpeed(). |
1.4.4