Class StrictFollower
- All Implemented Interfaces:
ControlRequest,Cloneable
The follower will atomically change its output type when it receives the leader's latest output status signal (DutyCycle, MotorVoltage, TorqueCurrent). If Talon is in torque control, the torque is copied - which will increase the total torque applied. If Talon is in duty cycle output control, the duty cycle is matched. If Talon is in voltage output control, the motor voltage is matched. Motor direction is strictly determined by the configured invert and not the leader. If you want motor direction to match or oppose the leader, use Follower instead.
The leader must ensure the status signal corresponding to its control output type (DutyCycle, MotorVoltage, TorqueCurrent) is enabled. The update rate of the status signal determines the update rate of the follower's output and should be no slower than 20 Hz.
-
Field Summary
FieldsModifier and TypeFieldDescriptionintDevice ID of the leader to follow.doubleThe frequency at which this control will update. -
Constructor Summary
ConstructorsConstructorDescriptionStrictFollower(int LeaderID) Follow the motor output of another Talon while ignoring the leader's invert setting. -
Method Summary
Modifier and TypeMethodDescriptionclone()Gets information about this control request.getName()Gets the name of this control request.sendRequest(CANBus network, int deviceHash) toString()withLeaderID(int newLeaderID) Modifies this Control Request's LeaderID parameter and returns itself for method-chaining and easier to use request API.withUpdateFreqHz(double newUpdateFreqHz) Sets the frequency at which this control will update.withUpdateFreqHz(Frequency newUpdateFreqHz) Sets the frequency at which this control will update.
-
Field Details
-
LeaderID
Device ID of the leader to follow. -
UpdateFreqHz
The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.
-
-
Constructor Details
-
StrictFollower
Follow the motor output of another Talon while ignoring the leader's invert setting.The follower will atomically change its output type when it receives the leader's latest output status signal (DutyCycle, MotorVoltage, TorqueCurrent). If Talon is in torque control, the torque is copied - which will increase the total torque applied. If Talon is in duty cycle output control, the duty cycle is matched. If Talon is in voltage output control, the motor voltage is matched. Motor direction is strictly determined by the configured invert and not the leader. If you want motor direction to match or oppose the leader, use Follower instead.
The leader must ensure the status signal corresponding to its control output type (DutyCycle, MotorVoltage, TorqueCurrent) is enabled. The update rate of the status signal determines the update rate of the follower's output and should be no slower than 20 Hz.
- Parameters:
LeaderID- Device ID of the leader to follow.
-
-
Method Details
-
getName
Description copied from interface:ControlRequestGets the name of this control request.- Specified by:
getNamein interfaceControlRequest- Returns:
- Name of the control request
-
toString
-
sendRequest
- Specified by:
sendRequestin interfaceControlRequest
-
getControlInfo
Gets information about this control request.- Specified by:
getControlInfoin interfaceControlRequest- Returns:
- Map of control parameter names and corresponding applied values
-
withLeaderID
Modifies this Control Request's LeaderID parameter and returns itself for method-chaining and easier to use request API.Device ID of the leader to follow.
- Parameters:
newLeaderID- Parameter to modify- Returns:
- Itself
-
withUpdateFreqHz
Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.
- Specified by:
withUpdateFreqHzin interfaceControlRequest- Parameters:
newUpdateFreqHz- Parameter to modify- Returns:
- Itself
-
withUpdateFreqHz
Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.
- Specified by:
withUpdateFreqHzin interfaceControlRequest- Parameters:
newUpdateFreqHz- Parameter to modify- Returns:
- Itself
-
clone
-