Class TrajectoryPoint

java.lang.Object
com.ctre.phoenix.motion.TrajectoryPoint

public class TrajectoryPoint extends Object
Motion Profile Trajectory Point This is simply a data transfer object.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
    Added to the output of PID[0], should be within [-1,+1] where 0.01 = 1%.
    double
    Added to the output of PID[1], should be within [-1,+1] where 0.01 = 1%.
    double
    The position for auxiliary PID[1] to target (in sensor units).
    double
    The velocity for auxiliary PID[1] to target.
    double
    Not used.
    boolean
    Set 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.
    double
    The position to servo to (in sensor units).
    int
    Which slot to get PIDF gains.
    int
    Which slot to get PIDF gains for auxiliary PId.
    int
    Duration (ms) to apply this trajectory pt.
    boolean
    If using MotionProfileArc, this flag must be true on all points.
    double
    The velocity to feed-forward (in sensor-units per 100ms).
    boolean
    Set to true to signal Talon to zero the selected sensor.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • position

      public double position
      The position to servo to (in sensor units).
    • velocity

      public double velocity
      The velocity to feed-forward (in sensor-units per 100ms).
    • arbFeedFwd

      public double arbFeedFwd
      Added to the output of PID[0], should be within [-1,+1] where 0.01 = 1%.
    • headingDeg

      public double headingDeg
      Not used. Use auxiliaryPos instead. @see auxiliaryPos
    • auxiliaryPos

      public double auxiliaryPos
      The position for auxiliary PID[1] to target (in sensor units).
    • auxiliaryVel

      public double auxiliaryVel
      The velocity for auxiliary PID[1] to target. (in sensor-units per 100ms).
    • auxiliaryArbFeedFwd

      public double auxiliaryArbFeedFwd
      Added to the output of PID[1], should be within [-1,+1] where 0.01 = 1%.
    • profileSlotSelect0

      public int profileSlotSelect0
      Which 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. Choose from [0,3]
    • profileSlotSelect1

      public int profileSlotSelect1
      Which slot to get PIDF gains for auxiliary PId. This only has impact during MotionProfileArc Control mode. Choose from [0,3].
    • isLastPoint

      public boolean isLastPoint
      Set 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.
    • zeroPos

      public boolean zeroPos
      Set 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. If using multiple sensor sources (Arc modes) we recommend you manually set sensor positions before arming MP, instead of using this feature.
    • timeDur

      public int timeDur
      Duration (ms) to apply this trajectory pt. This time unit is ADDED to the existing base time set by ConfigMotionProfileTrajectoryPeriod().
    • useAuxPID

      public boolean useAuxPID
      If using MotionProfileArc, this flag must be true on all points. If using MotionProfile, this flag must be false on all points.
  • Constructor Details