phoenix6.controls.differential_follower#

Module Contents#

class phoenix6.controls.differential_follower.DifferentialFollower(master_id: int, oppose_master_direction: bool)#

Follow the differential motor output of another Talon.

If Talon is in torque control, the torque is copied - which will increase the total torque applied. If Talon is in percent supply output control, the duty cycle is matched. Motor direction either matches master’s configured direction or opposes it based on OpposeMasterDirection.

Parameters:
  • master_id (int) – Device ID of the differential master to follow.

  • oppose_master_direction (bool) – Set to false for motor invert to match the master’s configured Invert - which is typical when master and follower are mechanically linked and spin in the same direction. Set to true for motor invert to oppose the master’s configured Invert - this is typical where the the master and follower mechanically spin in opposite directions.

property name: str#

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict#

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

master_id#

Device ID of the differential master to follow.

oppose_master_direction#

Set to false for motor invert to match the master’s configured Invert - which is typical when master and follower are mechanically linked and spin in the same direction. Set to true for motor invert to oppose the master’s configured Invert - this is typical where the the master and follower mechanically spin in opposite directions.

with_master_id(new_master_id: int) DifferentialFollower#

Modifies this Control Request’s master_id parameter and returns itself for method-chaining and easier to use request API.

Device ID of the differential master to follow.

Parameters:

new_master_id (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialFollower

with_oppose_master_direction(new_oppose_master_direction: bool) DifferentialFollower#

Modifies this Control Request’s oppose_master_direction parameter and returns itself for method-chaining and easier to use request API.

Set to false for motor invert to match the master’s configured Invert - which is typical when master and follower are mechanically linked and spin in the same direction. Set to true for motor invert to oppose the master’s configured Invert - this is typical where the the master and follower mechanically spin in opposite directions.

Parameters:

new_oppose_master_direction (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialFollower

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialFollower#

Sets the period at which this control will update at. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms).

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.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialFollower