pub struct TrajectoryPoint {
pub position: f64,
pub velocity: f64,
pub auxiliary_pos: f64,
pub profile_slot_select_0: u32,
pub profile_slot_select_1: u32,
pub is_last_point: bool,
pub zero_pos: bool,
pub time_dur: TrajectoryDuration,
/* private fields */
}Expand description
Motion Profile Trajectory Point This is simply a data transfer object.
Fields§
§position: f64The position to servo to.
velocity: f64The velocity to feed-forward.
auxiliary_pos: f64The position for auxiliary PID to target.
profile_slot_select_0: u32Which slot to get PIDF gains. PID is used for position servo. F is used as the Kv constant for velocity feed-forward. Typically this is hard-coded to a particular slot, but you are free to gain schedule if need be. gain schedule if need be. Choose from [0,3].
profile_slot_select_1: u32Which slot to get PIDF gains for auxiliary PID. This only has impact during MotionProfileArc Control mode. Choose from [0,1].
is_last_point: boolSet to true to signal Talon that this is the final point, so do not attempt to pop another trajectory point from out of the Talon buffer. Instead continue processing this way point. Typically the velocity member variable should be zero so that the motor doesn’t spin indefinitely.
zero_pos: boolSet to true to signal Talon to zero the selected sensor. When generating MPs, one simple method is to make the first target position zero, and the final target position the target distance from the current position. Then when you fire the MP, the current position gets set to zero. If this is the intent, you can set zeroPos on the first trajectory point.
Otherwise you can leave this false for all points, and offset the positions of all trajectory points so they are correct.
time_dur: TrajectoryDurationDuration to apply this trajectory pt. This time unit is ADDED to the existing base time set by ConfigMotionProfileTrajectoryPeriod().