Utility functions used in the pi3hat interface.
More...
|
using | Attitude = ::mjbots::pi3hat::Attitude |
| Attitude data type from the mjbots library.
|
|
Utility functions used in the pi3hat interface.
◆ get_angular_velocity()
Eigen::Vector3d upkie::cpp::actuation::pi3hat::get_angular_velocity |
( |
const Attitude & |
attitude | ) |
|
|
inlinenoexcept |
Get the body angular velocity of the IMU frame.
- Parameters
-
[in] | attitude | Attitude object from the pi3hat library. |
- Returns
- Body angular velocity of the IMU frame in [rad] / [s].
- Note
- This is the angular velocity \( {}_I \omega_{WI} \) from the IMU frame \( I \) to the world frame \( W \), expressed in the IMU frame.
◆ get_bias_dps()
Eigen::Vector3d upkie::cpp::actuation::pi3hat::get_bias_dps |
( |
const Attitude & |
attitude | ) |
|
|
inlinenoexcept |
Get the gyroscope bias in [deg] / [s].
- Parameters
-
[in] | attitude | Attitude object from the pi3hat library. |
- Returns
- Gyroscope bias of the IMU in [deg] / [s].
◆ get_linear_acceleration()
Eigen::Vector3d upkie::cpp::actuation::pi3hat::get_linear_acceleration |
( |
const Attitude & |
attitude | ) |
|
|
inlinenoexcept |
Get the body linear acceleration of the IMU.
- Parameters
-
[in] | attitude | Attitude object from the pi3hat library. |
- Returns
- Body linear acceleration of the IMU in [m] / [s]².
- Note
- This is the linear acceleration \( {}_I a_{WI} \) of the IMU frame \( I \) with respect to the world frame, expressed in the IMU frame.
◆ get_orientation_imu_in_ars()
Eigen::Quaterniond upkie::cpp::actuation::pi3hat::get_orientation_imu_in_ars |
( |
const Attitude & |
attitude | ) |
|
|
inlinenoexcept |
Get orientation from the IMU frame to the ARS frame.
- Parameters
-
[in] | attitude | Attitude object from the pi3hat library. |
- Returns
- Orientation from the IMU frame to the ARS frame.
This orientation is computed by the Unscented Kalman filter (UKF) in pi3hat/fw/attitude_reference.h.
◆ get_rate_dps()
Eigen::Vector3d upkie::cpp::actuation::pi3hat::get_rate_dps |
( |
const Attitude & |
attitude | ) |
|
|
inlinenoexcept |
Get the body angular velocity of the IMU frame in [deg] / [s].
- Parameters
-
[in] | attitude | Attitude object from the pi3hat library. |
- Returns
- Body angular velocity of the IMU frame in [deg] / [s].
◆ get_raw_angular_velocity()
Eigen::Vector3d upkie::cpp::actuation::pi3hat::get_raw_angular_velocity |
( |
const Eigen::Vector3d & |
rate_dps, |
|
|
const Eigen::Vector3d & |
bias_dps |
|
) |
| |
|
inlinenoexcept |
Get raw angular velocity measurement from the gyroscope.
- Parameters
-
[in] | rate_dps | Angular velocity in [deg] / [s] from the pi3hat. |
[in] | bias_dps | Gyroscope bias in [deg] / [s] from the pi3hat. |
- Returns
- Raw angular velocity of the IMU in [rad] / [s].
- Note
- We reverse filter outputs for now as (1) it avoids an extra call to ReadSpi, and more generally customizing the Pi3Hat::Impl from mjbots, and (2) the pi3hat filter's code has been stable for the last four years.
◆ get_raw_linear_acceleration()
Eigen::Vector3d upkie::cpp::actuation::pi3hat::get_raw_linear_acceleration |
( |
const Eigen::Quaterniond & |
orientation_imu_in_ars, |
|
|
const Eigen::Vector3d & |
accel_mps2 |
|
) |
| |
|
inlinenoexcept |
Recompute raw linear acceleration from UKF observations.
- Parameters
-
[in] | orientation_imu_in_ars | Rotation from the IMU to the ARS. |
[in] | accel_mps2 | UKF output linear acceleration, in [m] / [s]². |
- Returns
- Raw linear acceleration in [m] / [s]².
- Note
- We reverse filter outputs for now as (1) it avoids an extra call to ReadSpi, and more generally customizing the Pi3Hat::Impl from mjbots, and (2) the pi3hat filter's code has been stable for the last four years.
◆ kMjbotsGravity
constexpr double upkie::cpp::actuation::pi3hat::kMjbotsGravity = 9.81 |
|
constexpr |
Standard gravity constant used in the mjbots pi3hat firmware.
We should use the same value to recover raw measurements from filter outputs.