state-observation 1.8.0
General implementation of observers.
Loading...
Searching...
No Matches
stateObservation::odometry::LeggedOdometryManager Struct Reference

Structure that implements all the necessary functions to perform legged odometry. More...

#include <legged-odometry-manager.hpp>

Collaboration diagram for stateObservation::odometry::LeggedOdometryManager:
[legend]

Classes

struct  KineParams
struct  ContactInputData
struct  ContactUpdateFunctions
struct  LeggedOdometryContactsManager
 ---------------------—Contacts Manager------------------------— More...
struct  Configuration
 ---------------------—Configuration------------------------— More...

Public Types

using ContactsManager = measurements::ContactsManager<LoContact>

Public Member Functions

const std::vector< LoContact * > & newContacts ()
 Returns a list of pointers to the contacts created on the current iteration.
const std::vector< LoContact * > & maintainedContacts () const
 Returns a list of pointers to the contacts maintained during the current iteration.
void init (const Configuration &odomConfig, const Vector7 &initPose)
 Initializer for the odometry manager.
template<typename OnNewContactObserver = std::nullptr_t, typename OnMaintainedContactObserver = std::nullptr_t, typename OnRemovedContactObserver = std::nullptr_t, typename OnAddedContactObserver = std::nullptr_t>
bool initLoop (const std::set< std::string > &latestContactList, const ContactUpdateFunctions< OnNewContactObserver, OnMaintainedContactObserver, OnRemovedContactObserver, OnAddedContactObserver > &updateFunctions, const Vector3 *linVel=nullptr, const Vector3 *angVel=nullptr)
 Function that initializes the loop of the legged odometry. To be called at the beginning of each iteration.
void run (KineParams &kineParams)
 Function that runs the legged odometry loop. Using the input orientation and the current contacts, it estimates the new state of the robot.
void replaceOdomBodyPose (const Vector7 &newPose)
 Replaces the current pose of the odometry robot (that of the body used for the odometry !) by the given one.
Kinematics getAnchorKineIn (Kinematics &bodyTargetKine)
 Gives the kinematics (position and linear velocity) of the anchor point in the desired frame.
Kinematics getAnchorKineInBody (bool withVel)
 Gives the kinematics (position and linear velocity) of the anchor point in the body frame.
const Vector3 & getWorldRefAnchorPos ()
 Returns the position of the anchor point in the world from the current contacts reference position.
Kinematics getWorldBodyKineFromAnchor (bool withPos, bool withOri)
 Updates the kinematics of the body in the world.
LocalKinematics getWorldBodyLocalKineFromAnchor ()
 Updates the local kinematics of the body in the world.
void setOdometryType (OdometryType newOdometryType)
 Changes the type of the odometry.
void setSamplingTime (double dt)
void kappa (double kappa) noexcept
void lambdaInf (double lambdaInf) noexcept
LeggedOdometryContactsManager & contactsManager ()
 Getter for the contacts manager.

Public Attributes

Kinematics bodyKine_
OdometryType odometryType_ = OdometryType::None

Protected Attributes

std::string category_
LeggedOdometryContactsManager contactsManager_
std::vector< LoContact * > newContacts_
std::vector< LoContact * > maintainedContacts_
double kappa_ = 10
double lambdaInf_ = 0.001
double ctl_dt_ = 0.0
bool withYawEstimation_
bool correctContacts_ = true
Vector3 worldRefAnchorPosition_
Vector3 bodyAnchorPos_
bool prevAnchorFromContacts_ = true
bool currAnchorFromContacts_ = true
bool posUpdatable_ = false
TimeIndex k_iter_ = 0
TimeIndex k_data_ = 0
TimeIndex k_est_ = 0
TimeIndex k_correct_ = 0
TimeIndex k_anchor_ = 0

Detailed Description

Structure that implements all the necessary functions to perform legged odometry.

Handles the odometry from the contacts detection to the final pose estimation of the body. Also allows to compute the position and/or velocity of an anchor point linked to the robot.

Definition at line 156 of file legged-odometry-manager.hpp.

Member Typedef Documentation

◆ ContactsManager

using stateObservation::odometry::LeggedOdometryManager::ContactsManager = measurements::ContactsManager<LoContact>

Definition at line 159 of file legged-odometry-manager.hpp.

Member Function Documentation

◆ newContacts()

const std::vector< LoContact * > & stateObservation::odometry::LeggedOdometryManager::newContacts ( )
inline

Returns a list of pointers to the contacts created on the current iteration.

Returns
const std::vector<LoContact *>&

Definition at line 427 of file legged-odometry-manager.hpp.

◆ maintainedContacts()

const std::vector< LoContact * > & stateObservation::odometry::LeggedOdometryManager::maintainedContacts ( ) const
inline

Returns a list of pointers to the contacts maintained during the current iteration.

Returns
const std::vector<LoContact *>&

Definition at line 436 of file legged-odometry-manager.hpp.

◆ init()

void stateObservation::odometry::LeggedOdometryManager::init ( const Configuration & odomConfig,
const Vector7 & initPose )

Initializer for the odometry manager.

Parameters
odomConfigDesired configuration of the odometry
initPoseInitial pose of the body

◆ initLoop()

template<typename OnNewContactObserver = std::nullptr_t, typename OnMaintainedContactObserver = std::nullptr_t, typename OnRemovedContactObserver = std::nullptr_t, typename OnAddedContactObserver = std::nullptr_t>
bool stateObservation::odometry::LeggedOdometryManager::initLoop ( const std::set< std::string > & latestContactList,
const ContactUpdateFunctions< OnNewContactObserver, OnMaintainedContactObserver, OnRemovedContactObserver, OnAddedContactObserver > & updateFunctions,
const Vector3 * linVel = nullptr,
const Vector3 * angVel = nullptr )

Function that initializes the loop of the legged odometry. To be called at the beginning of each iteration.

Updates the the contacts, and sets the velocity and acceleration of the odometry if necessary.

Parameters
latestContactListList of every currently set contacts.
updateFunctionsFunctions used when updating the contacts.
linVellinear velocity of the body in the world.
angVelangular velocity of the body in the world.

◆ run()

void stateObservation::odometry::LeggedOdometryManager::run ( KineParams & kineParams)

Function that runs the legged odometry loop. Using the input orientation and the current contacts, it estimates the new state of the robot.

Parameters
kineParamsKinematic parameters necessary for the estimation, either inputs or outputs to modify (please see the documentation of the KineParams class).

◆ replaceOdomBodyPose()

void stateObservation::odometry::LeggedOdometryManager::replaceOdomBodyPose ( const Vector7 & newPose)

Replaces the current pose of the odometry robot (that of the body used for the odometry !) by the given one.

Also changes the reference pose of the contacts. Updates the velocity and acceleration with the new orientation if required.

Parameters
newPoseNew pose of the odometry robot.

◆ getAnchorKineIn()

Kinematics stateObservation::odometry::LeggedOdometryManager::getAnchorKineIn ( Kinematics & bodyTargetKine)

Gives the kinematics (position and linear velocity) of the anchor point in the desired frame.

If the velocity of the target frame in the world frame is given, the velocity of the anchor point in the target frame will also be contained in the returned Kinematics object.

Parameters
bodyTargetKineKinematics of the target frame in the body frame.

◆ getAnchorKineInBody()

Kinematics stateObservation::odometry::LeggedOdometryManager::getAnchorKineInBody ( bool withVel)

Gives the kinematics (position and linear velocity) of the anchor point in the body frame.

Parameters
withVelIndicates if the velocity of the anchor point in the body must be computed.

◆ getWorldRefAnchorPos()

const Vector3 & stateObservation::odometry::LeggedOdometryManager::getWorldRefAnchorPos ( )

Returns the position of the anchor point in the world from the current contacts reference position.

Returns
Vector3&

◆ getWorldBodyKineFromAnchor()

Kinematics stateObservation::odometry::LeggedOdometryManager::getWorldBodyKineFromAnchor ( bool withPos,
bool withOri )

Updates the kinematics of the body in the world.

For each maintained contact, we compute the position of the body in the contact frame, we then compute their weighted average and obtain the estimated translation from the anchor point to the body. We apply this translation to the reference position of the anchor frame in the world to obtain the new position of the body in the word. We do the same for the orientation.

◆ getWorldBodyLocalKineFromAnchor()

LocalKinematics stateObservation::odometry::LeggedOdometryManager::getWorldBodyLocalKineFromAnchor ( )

Updates the local kinematics of the body in the world.

For each maintained contact, we compute the position of the body in the contact frame, we then compute their weighted average and obtain the estimated translation from the anchor point to the body. We apply this translation to the reference position of the anchor frame in the world to obtain the new position of the body in the word. We do the same for the orientation.

◆ setOdometryType()

void stateObservation::odometry::LeggedOdometryManager::setOdometryType ( OdometryType newOdometryType)

Changes the type of the odometry.

Version meant to be called by the observer using the odometry during the run through the gui.

Parameters
newOdometryTypeThe string naming the new type of odometry to use.

◆ setSamplingTime()

void stateObservation::odometry::LeggedOdometryManager::setSamplingTime ( double dt)
inline

Definition at line 513 of file legged-odometry-manager.hpp.

◆ kappa()

void stateObservation::odometry::LeggedOdometryManager::kappa ( double kappa)
inlinenoexcept

Definition at line 518 of file legged-odometry-manager.hpp.

◆ lambdaInf()

void stateObservation::odometry::LeggedOdometryManager::lambdaInf ( double lambdaInf)
inlinenoexcept

Definition at line 522 of file legged-odometry-manager.hpp.

◆ contactsManager()

LeggedOdometryContactsManager & stateObservation::odometry::LeggedOdometryManager::contactsManager ( )
inline

Getter for the contacts manager.

Definition at line 528 of file legged-odometry-manager.hpp.

Member Data Documentation

◆ category_

std::string stateObservation::odometry::LeggedOdometryManager::category_
protected

Definition at line 583 of file legged-odometry-manager.hpp.

◆ contactsManager_

LeggedOdometryContactsManager stateObservation::odometry::LeggedOdometryManager::contactsManager_
protected

Definition at line 586 of file legged-odometry-manager.hpp.

◆ bodyKine_

Kinematics stateObservation::odometry::LeggedOdometryManager::bodyKine_

Definition at line 590 of file legged-odometry-manager.hpp.

◆ newContacts_

std::vector<LoContact *> stateObservation::odometry::LeggedOdometryManager::newContacts_
protected

Definition at line 594 of file legged-odometry-manager.hpp.

◆ maintainedContacts_

std::vector<LoContact *> stateObservation::odometry::LeggedOdometryManager::maintainedContacts_
protected

Definition at line 596 of file legged-odometry-manager.hpp.

◆ kappa_

double stateObservation::odometry::LeggedOdometryManager::kappa_ = 10
protected

Definition at line 598 of file legged-odometry-manager.hpp.

◆ lambdaInf_

double stateObservation::odometry::LeggedOdometryManager::lambdaInf_ = 0.001
protected

Definition at line 601 of file legged-odometry-manager.hpp.

◆ ctl_dt_

double stateObservation::odometry::LeggedOdometryManager::ctl_dt_ = 0.0
protected

Definition at line 603 of file legged-odometry-manager.hpp.

◆ withYawEstimation_

bool stateObservation::odometry::LeggedOdometryManager::withYawEstimation_
protected

Definition at line 606 of file legged-odometry-manager.hpp.

◆ correctContacts_

bool stateObservation::odometry::LeggedOdometryManager::correctContacts_ = true
protected

Definition at line 608 of file legged-odometry-manager.hpp.

◆ worldRefAnchorPosition_

Vector3 stateObservation::odometry::LeggedOdometryManager::worldRefAnchorPosition_
protected

Definition at line 611 of file legged-odometry-manager.hpp.

◆ bodyAnchorPos_

Vector3 stateObservation::odometry::LeggedOdometryManager::bodyAnchorPos_
protected

Definition at line 613 of file legged-odometry-manager.hpp.

◆ prevAnchorFromContacts_

bool stateObservation::odometry::LeggedOdometryManager::prevAnchorFromContacts_ = true
protected

Definition at line 616 of file legged-odometry-manager.hpp.

◆ currAnchorFromContacts_

bool stateObservation::odometry::LeggedOdometryManager::currAnchorFromContacts_ = true
protected

Definition at line 618 of file legged-odometry-manager.hpp.

◆ posUpdatable_

bool stateObservation::odometry::LeggedOdometryManager::posUpdatable_ = false
protected

Definition at line 620 of file legged-odometry-manager.hpp.

◆ k_iter_

TimeIndex stateObservation::odometry::LeggedOdometryManager::k_iter_ = 0
protected

Definition at line 623 of file legged-odometry-manager.hpp.

◆ k_data_

TimeIndex stateObservation::odometry::LeggedOdometryManager::k_data_ = 0
protected

Definition at line 625 of file legged-odometry-manager.hpp.

◆ k_est_

TimeIndex stateObservation::odometry::LeggedOdometryManager::k_est_ = 0
protected

Definition at line 627 of file legged-odometry-manager.hpp.

◆ k_correct_

TimeIndex stateObservation::odometry::LeggedOdometryManager::k_correct_ = 0
protected

Definition at line 629 of file legged-odometry-manager.hpp.

◆ k_anchor_

TimeIndex stateObservation::odometry::LeggedOdometryManager::k_anchor_ = 0
protected

Definition at line 631 of file legged-odometry-manager.hpp.

◆ odometryType_

OdometryType stateObservation::odometry::LeggedOdometryManager::odometryType_ = OdometryType::None

Definition at line 635 of file legged-odometry-manager.hpp.


The documentation for this struct was generated from the following file: