Expand description
Serde helpers for const-generic fixed-size arrays.
This is the one shared set of fixed-array serde helpers for the workspace. Use a module with
#[serde(with = "repose_kinematics::serde_arrays::<module>")] on a [T; N] field; each module
provides serialize and deserialize, encodes the array as a tuple of exactly N elements,
and rejects sequences of any other length.
use repose_kinematics::CuJointPosition;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
struct Goal<const N: usize> {
#[serde(with = "repose_kinematics::serde_arrays::position_array")]
positions: [CuJointPosition; N],
}Modulesยง
- acceleration_
array - Serde
withmodule for[CuJointAcceleration; N]arrays. - angle_
array - Serde
withmodule for[Angle64; N]arrays. - angular_
velocity_ array - Serde
withmodule for[AngularVelocity64; N]arrays. - jerk_
array - Serde
withmodule for[CuJointJerk; N]arrays. - joint_
spec_ array - Serde
withmodule for[CuJointSpec; N]arrays. - position_
array - Serde
withmodule for[CuJointPosition; N]arrays. - velocity_
array - Serde
withmodule for[CuJointVelocity; N]arrays.