|
state-observation 1.8.0
General implementation of observers.
|
Structure that implements all the necessary functions to perform legged odometry. More...
#include <legged-odometry-manager.hpp>
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 |
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.
| using stateObservation::odometry::LeggedOdometryManager::ContactsManager = measurements::ContactsManager<LoContact> |
Definition at line 159 of file legged-odometry-manager.hpp.
|
inline |
Returns a list of pointers to the contacts created on the current iteration.
Definition at line 427 of file legged-odometry-manager.hpp.
|
inline |
Returns a list of pointers to the contacts maintained during the current iteration.
Definition at line 436 of file legged-odometry-manager.hpp.
| void stateObservation::odometry::LeggedOdometryManager::init | ( | const Configuration & | odomConfig, |
| const Vector7 & | initPose ) |
Initializer for the odometry manager.
| odomConfig | Desired configuration of the odometry |
| initPose | Initial pose of the body |
| 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.
| latestContactList | List of every currently set contacts. |
| updateFunctions | Functions used when updating the contacts. |
| linVel | linear velocity of the body in the world. |
| angVel | angular velocity of the body in the world. |
| 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.
| kineParams | Kinematic parameters necessary for the estimation, either inputs or outputs to modify (please see the documentation of the KineParams class). |
| 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.
| newPose | New pose of the odometry robot. |
| 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.
| bodyTargetKine | Kinematics of the target frame in the body frame. |
| Kinematics stateObservation::odometry::LeggedOdometryManager::getAnchorKineInBody | ( | bool | withVel | ) |
Gives the kinematics (position and linear velocity) of the anchor point in the body frame.
| withVel | Indicates if the velocity of the anchor point in the body must be computed. |
| const Vector3 & stateObservation::odometry::LeggedOdometryManager::getWorldRefAnchorPos | ( | ) |
Returns the position of the anchor point in the world from the current contacts reference position.
| 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.
| 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.
| 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.
| newOdometryType | The string naming the new type of odometry to use. |
|
inline |
Definition at line 513 of file legged-odometry-manager.hpp.
|
inlinenoexcept |
Definition at line 518 of file legged-odometry-manager.hpp.
|
inlinenoexcept |
Definition at line 522 of file legged-odometry-manager.hpp.
|
inline |
Getter for the contacts manager.
Definition at line 528 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 583 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 586 of file legged-odometry-manager.hpp.
| Kinematics stateObservation::odometry::LeggedOdometryManager::bodyKine_ |
Definition at line 590 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 594 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 596 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 598 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 601 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 603 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 606 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 608 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 611 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 613 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 616 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 618 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 620 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 623 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 625 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 627 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 629 of file legged-odometry-manager.hpp.
|
protected |
Definition at line 631 of file legged-odometry-manager.hpp.
| OdometryType stateObservation::odometry::LeggedOdometryManager::odometryType_ = OdometryType::None |
Definition at line 635 of file legged-odometry-manager.hpp.