bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
ekf_sensor_fusion::InfraredLineFollower Class Reference

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 &parameters)
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

Detailed Description

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.

Constructor & Destructor Documentation

◆ InfraredLineFollower() [1/2]

◆ InfraredLineFollower() [2/2]

Member Function Documentation

◆ command()

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.

◆ has_given_up()

True when no element has seen the line for longer than lost_time.

◆ is_lost()

bool bitsim::control::InfraredLineFollower::is_lost ( ) const
inlinenoexcept

True when no element saw the line at the last command.

◆ parameters()


The documentation for this class was generated from the following files: