001/* Copyright (C) Cross The Road Electronics 2024 */
002package com.ctre.phoenix.motion;
003
004/**
005 * Motion Profile Status This is simply a data transer object.
006 */
007public class MotionProfileStatus {
008        /**
009         * The available empty slots in the trajectory buffer.
010         *
011         * The robot API holds a "top buffer" of trajectory points, so your
012         * applicaion can dump several points at once. The API will then stream them
013         * into the Talon's low-level buffer, allowing the Talon to act on them.
014         */
015        public int topBufferRem;
016        /**
017         * The number of points in the top trajectory buffer.
018         */
019        public int topBufferCnt;
020        /**
021         * The number of points in the low level Talon/Victor buffer.
022         */
023        public int btmBufferCnt;
024        /**
025         * Set if isUnderrun ever gets set. Only is cleared by
026         * clearMotionProfileHasUnderrun() to ensure robot logic can react or
027         * instrument it.
028         *
029         * @see com.ctre.phoenix.motorcontrol.can.BaseMotorController#clearMotionProfileHasUnderrun(int)
030         */
031        public boolean hasUnderrun;
032        /**
033         * This is set if Talon/Victor needs to shift a point from its buffer into the
034         * active trajectory point however the buffer is empty. This gets cleared
035         * automatically when is resolved.
036         */
037        public boolean isUnderrun;
038        /**
039         * True if the active trajectory point is not empty, false otherwise. The
040         * members in activePoint are only valid if this signal is set.
041         */
042        public boolean activePointValid;
043
044        /**
045         * True if the active trajectory point is the last point of the profile
046         */
047        public boolean isLast;
048
049        /**
050         * The selected PID[0] profile slot of current profile
051         */
052        public int profileSlotSelect;
053        /**
054         * The current output mode of the motion profile executer (disabled,
055         * enabled, or hold). When changing the set() value in MP mode, it's
056         * important to check this signal to confirm the change takes effect before
057         * interacting with the top buffer.
058         */
059        public SetValueMotionProfile outputEnable;
060        
061        /**
062         * The duration in ms of current trajectory point
063         */
064        public int timeDurMs;
065        
066        /**
067         * The selected auxiliary PID[1] profile slot of current profile
068         */
069        public int profileSlotSelect1;
070}