|
bitsim
Model, simulate, estimate and control robots in C++
|
Follow a dark line with a row of infrared elements. More...
#include <infrared_line_follower.h>
Classes | |
| struct | Parameters |
Public Member Functions | |
| InfraredLineFollower ()=default | |
| InfraredLineFollower (const Parameters ¶meters) | |
| DiffDriveCommand | command (const sensors::InfraredSensor &ir, real_t dt) |
| The command for the elements' last reading, dt [s] after the last command. | |
| bool | is_lost () const noexcept |
| True when no element saw the line at the last command. | |
| bool | has_given_up () const noexcept |
| True when no element has seen the line for longer than lost_time. | |
| const Parameters & | parameters () const noexcept |
Follow a dark line with a row of infrared elements.
The elements, left to right, say where the line is: +1 under the leftmost, 0 under the middle, -1 under the rightmost, the mean over the elements that see it. The robot turns towards the line, harder and slower the further out it is:
\[v = v_{cruise} (1 - |s| / 2), \qquad \omega = \omega_{line}\, s \]
With no element on the line it turns on the spot towards where it saw the line last, and after lost_time it gives up.
|
inlineexplicit |
| DiffDriveCommand bitsim::control::InfraredLineFollower::command | ( | const sensors::InfraredSensor & | ir, |
| real_t | dt ) |
The command for the elements' last reading, dt [s] after the last command.
|
inlinenoexcept |
True when no element has seen the line for longer than lost_time.
|
inlinenoexcept |
True when no element saw the line at the last command.
|
inlinenoexcept |