refactor(firmware): simplify configuration and diagnostics
This commit is contained in:
1 parent
ba9c97ed3b
commit
fdf82a5114
96 files changed
+1612
-2772
No files matched your search
@@ -9,5 +9,5 @@ version.workspace = true
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
kaptan-log = { path = "../kaptan-log" }
|
||||
kaptan-err-propagate = { path = "../kaptan-err-propagate" }
|
||||
kaptan-math = { path = "../kaptan-math" }
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#![no_std]
|
||||
|
||||
use kaptan_log::KaptanError;
|
||||
use kaptan_err_propagate::KaptanError;
|
||||
use kaptan_math::{Frd, Ned, UnitQuaternion, Vector3, sqrt};
|
||||
|
||||
/// Body-frame angular rate in radians per second.
|
||||
@@ -57,8 +57,10 @@ impl HeadingNed {
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, KaptanError)]
|
||||
pub enum AttitudeError {
|
||||
/// A zero or non-finite force has no defined thrust direction.
|
||||
#[kaptan_error(id = 7001)]
|
||||
ZeroForce,
|
||||
/// Requested heading is parallel to the thrust axis.
|
||||
#[kaptan_error(id = 7002)]
|
||||
SingularHeading,
|
||||
}
|
||||
|
||||
@@ -105,10 +107,13 @@ pub struct PidConfig {
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, KaptanError)]
|
||||
pub enum PidError {
|
||||
/// Static PID gains or limits were non-finite or contradictory.
|
||||
#[kaptan_error(id = 7101)]
|
||||
InvalidConfiguration,
|
||||
/// Time step was non-finite, non-positive, or exceeded the 100-ms integration bound.
|
||||
#[kaptan_error(id = 7102)]
|
||||
InvalidTime,
|
||||
/// Error input was non-finite.
|
||||
#[kaptan_error(id = 7103)]
|
||||
NonFinite,
|
||||
}
|
||||
|
||||
@@ -320,12 +325,16 @@ pub struct KinematicLimits {
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, KaptanError)]
|
||||
pub enum TrajectoryError {
|
||||
/// A static speed/acceleration constraint is invalid.
|
||||
#[kaptan_error(id = 7201)]
|
||||
InvalidLimits,
|
||||
/// A goal coordinate is non-finite.
|
||||
#[kaptan_error(id = 7202)]
|
||||
NonFiniteGoal,
|
||||
/// The service interval was non-finite, non-positive, or exceeded the 100-ms integration bound.
|
||||
#[kaptan_error(id = 7203)]
|
||||
InvalidTime,
|
||||
/// A finite input produced a non-finite intermediate or candidate state.
|
||||
#[kaptan_error(id = 7204)]
|
||||
NumericalOverflow,
|
||||
}
|
||||
|
||||
@@ -590,8 +599,10 @@ pub struct TranslationalControlConfig {
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, KaptanError)]
|
||||
pub enum TranslationalControlError {
|
||||
/// A gain or kinematic limit is invalid.
|
||||
#[kaptan_error(id = 7301)]
|
||||
InvalidConfiguration,
|
||||
/// A reference or estimator value is non-finite.
|
||||
#[kaptan_error(id = 7302)]
|
||||
NonFiniteState,
|
||||
}
|
||||
|
||||
@@ -685,9 +696,11 @@ pub struct ThrustEnvelope {
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, KaptanError)]
|
||||
pub enum ThrustEnvelopeError {
|
||||
/// A static physical parameter is invalid.
|
||||
#[kaptan_error(id = 7401)]
|
||||
InvalidConfiguration,
|
||||
/// A requested acceleration is non-finite or cannot be produced by
|
||||
/// positive multicopter thrust.
|
||||
#[kaptan_error(id = 7402)]
|
||||
InvalidAcceleration,
|
||||
}
|
||||
|
||||
@@ -825,14 +838,19 @@ pub struct BodyWrench {
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, KaptanError)]
|
||||
pub enum AllocatorError {
|
||||
/// One static allocation output has non-finite or contradictory limits.
|
||||
#[kaptan_error(id = 7501)]
|
||||
InvalidActuator,
|
||||
/// Mixer contains non-finite values.
|
||||
#[kaptan_error(id = 7502)]
|
||||
InvalidMixer,
|
||||
/// Time step was non-finite, non-positive, or exceeded the 100-ms integration bound.
|
||||
#[kaptan_error(id = 7503)]
|
||||
InvalidTime,
|
||||
/// Requested wrench contains a non-finite component.
|
||||
#[kaptan_error(id = 7504)]
|
||||
InvalidWrench,
|
||||
/// The requested actuator index is outside the static allocation map.
|
||||
#[kaptan_error(id = 7505)]
|
||||
UnknownActuator,
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user