upkie 6.1.0
Open-source wheeled biped robots
Loading...
Searching...
No Matches
upkie::cpp::observers::FloorContact Class Reference

Observe contact between the wheels and the floor. More...

#include <FloorContact.h>

Classes

struct  Parameters
 Parameters to the floor contact observer. More...
 

Public Member Functions

 FloorContact (const Parameters &params)
 Initialize observer. More...
 
std::string prefix () const noexcept final
 Prefix of outputs in the observation dictionary. More...
 
void reset (const Dictionary &config) override
 Reset observer. More...
 
void read (const Dictionary &observation) final
 Read inputs from other observations. More...
 
void write (Dictionary &observation) final
 Write outputs, called if reading was successful. More...
 
- Public Member Functions inherited from upkie::cpp::observers::Observer
virtual ~Observer ()
 Destructor is virtual to deallocate lists of observers properly.
 
virtual std::string prefix () const noexcept
 Prefix of outputs in the observation dictionary. More...
 
virtual void reset (const Dictionary &config)
 Reset observer. More...
 
virtual void read (const Dictionary &observation)
 Read inputs from other observations. More...
 
virtual void write (Dictionary &observation)
 Write outputs, called if reading was successful. More...
 

Detailed Description

Observe contact between the wheels and the floor.

This observer makes two assumptions:

  1. The floor is a plane.
  2. The robot's head plane is parallel to the floor.

The two planes are depicted in this overview figure:

It determines whether contact is established based on:

  • WheelContact observers associated with each wheel.
  • Hip and knee torques, whose norm is a good indicator of contact when the floor is not orthogonal to gravity, or the legs are bent, but is an unreliable indicator when the floor is horizontal and the legs are stretched.

The latter is an incremental improvement to filter out outliers from the former.

Constructor & Destructor Documentation

◆ FloorContact()

upkie::cpp::observers::FloorContact::FloorContact ( const Parameters params)
explicit

Initialize observer.

Parameters
[in]paramsObserver parameters.

Member Function Documentation

◆ prefix()

std::string upkie::cpp::observers::FloorContact::prefix ( ) const
inlinefinalvirtualnoexcept

Prefix of outputs in the observation dictionary.

Reimplemented from upkie::cpp::observers::Observer.

◆ read()

void upkie::cpp::observers::FloorContact::read ( const Dictionary &  observation)
finalvirtual

Read inputs from other observations.

Parameters
[in]observationDictionary to read other observations from.

Reimplemented from upkie::cpp::observers::Observer.

◆ reset()

void upkie::cpp::observers::FloorContact::reset ( const Dictionary &  config)
overridevirtual

Reset observer.

Parameters
[in]configOverall configuration dictionary.

Reimplemented from upkie::cpp::observers::Observer.

◆ write()

void upkie::cpp::observers::FloorContact::write ( Dictionary &  observation)
finalvirtual

Write outputs, called if reading was successful.

Parameters
[out]observationDictionary to write observations to.

Reimplemented from upkie::cpp::observers::Observer.


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