Maurice 2025
Team 668's robot for Reefscape
Loading...
Searching...
No Matches
TunerConstants Class Reference

Static Public Attributes

tuple back_left
 
tuple back_right
 
 canbus = CANBus("Drivetrain", "./logs/example.hoot")
 
tuple drivetrain_constants
 
tuple front_left
 
tuple front_right
 
units speed_at_12_volts = 4.73
 

Static Protected Attributes

int _back_left_drive_motor_id = 1
 
int _back_left_encoder_id = 9
 
bool _back_left_encoder_inverted = False
 
float _back_left_encoder_offset = 0.416259765625
 
int _back_left_steer_motor_id = 2
 
bool _back_left_steer_motor_inverted = True
 
units _back_left_x_pos = inchesToMeters(-11.5)
 
units _back_left_y_pos = inchesToMeters(11.5)
 
int _back_right_drive_motor_id = 5
 
int _back_right_encoder_id = 11
 
bool _back_right_encoder_inverted = False
 
float _back_right_encoder_offset = -0.228515625
 
int _back_right_steer_motor_id = 6
 
bool _back_right_steer_motor_inverted = True
 
units _back_right_x_pos = inchesToMeters(-11.5)
 
units _back_right_y_pos = inchesToMeters(-11.5)
 
tuple _constants_creator
 
float _couple_ratio = 3.5714285714285716
 
 _drive_closed_loop_output = swerve.ClosedLoopOutputType.VOLTAGE
 
units _drive_friction_voltage = 0.2
 
tuple _drive_gains
 
float _drive_gear_ratio = 8.14
 
units _drive_inertia = 0.01
 
 _drive_initial_configs = configs.TalonFXConfiguration()
 
 _drive_motor_type = swerve.DriveMotorArrangement.TALON_FX_INTEGRATED
 
 _encoder_initial_configs = configs.CANcoderConfiguration()
 
int _front_left_drive_motor_id = 3
 
int _front_left_encoder_id = 10
 
bool _front_left_encoder_inverted = False
 
float _front_left_encoder_offset = -0.075439453125
 
int _front_left_steer_motor_id = 4
 
bool _front_left_steer_motor_inverted = True
 
units _front_left_x_pos = inchesToMeters(11.5)
 
units _front_left_y_pos = inchesToMeters(11.5)
 
int _front_right_drive_motor_id = 7
 
int _front_right_encoder_id = 12
 
bool _front_right_encoder_inverted = False
 
float _front_right_encoder_offset = 0.356689453125
 
int _front_right_steer_motor_id = 8
 
bool _front_right_steer_motor_inverted = True
 
units _front_right_x_pos = inchesToMeters(11.5)
 
units _front_right_y_pos = inchesToMeters(-11.5)
 
bool _invert_left_side = False
 
bool _invert_right_side = True
 
configs _pigeon_configs = None
 
int _pigeon_id = 20
 
units _slip_current = 120.0
 
 _steer_closed_loop_output = swerve.ClosedLoopOutputType.VOLTAGE
 
 _steer_feedback_type = swerve.SteerFeedbackType.FUSED_CANCODER
 
units _steer_friction_voltage = 0.2
 
tuple _steer_gains
 
float _steer_gear_ratio = 21.428571428571427
 
units _steer_inertia = 0.01
 
 _steer_initial_configs
 
 _steer_motor_type = swerve.SteerMotorArrangement.TALON_FX_INTEGRATED
 
units _wheel_radius = inchesToMeters(2)
 

Detailed Description

Generated by the Tuner X Swerve Project Generator
https://v6.docs.ctr-electronics.com/en/stable/docs/tuner/tuner-swerve/index.html

Member Data Documentation

◆ _back_left_drive_motor_id

int _back_left_drive_motor_id = 1
staticprotected

◆ _back_left_encoder_id

int _back_left_encoder_id = 9
staticprotected

◆ _back_left_encoder_inverted

bool _back_left_encoder_inverted = False
staticprotected

◆ _back_left_encoder_offset

float _back_left_encoder_offset = 0.416259765625
staticprotected

◆ _back_left_steer_motor_id

int _back_left_steer_motor_id = 2
staticprotected

◆ _back_left_steer_motor_inverted

bool _back_left_steer_motor_inverted = True
staticprotected

◆ _back_left_x_pos

units _back_left_x_pos = inchesToMeters(-11.5)
staticprotected

◆ _back_left_y_pos

units _back_left_y_pos = inchesToMeters(11.5)
staticprotected

◆ _back_right_drive_motor_id

int _back_right_drive_motor_id = 5
staticprotected

◆ _back_right_encoder_id

int _back_right_encoder_id = 11
staticprotected

◆ _back_right_encoder_inverted

bool _back_right_encoder_inverted = False
staticprotected

◆ _back_right_encoder_offset

float _back_right_encoder_offset = -0.228515625
staticprotected

◆ _back_right_steer_motor_id

int _back_right_steer_motor_id = 6
staticprotected

◆ _back_right_steer_motor_inverted

bool _back_right_steer_motor_inverted = True
staticprotected

◆ _back_right_x_pos

units _back_right_x_pos = inchesToMeters(-11.5)
staticprotected

◆ _back_right_y_pos

units _back_right_y_pos = inchesToMeters(-11.5)
staticprotected

◆ _constants_creator

tuple _constants_creator
staticprotected
Initial value:
= (
swerve.SwerveModuleConstantsFactory()
.with_drive_motor_gear_ratio(_drive_gear_ratio)
.with_steer_motor_gear_ratio(_steer_gear_ratio)
.with_coupling_gear_ratio(_couple_ratio)
.with_wheel_radius(_wheel_radius)
.with_steer_motor_gains(_steer_gains)
.with_drive_motor_gains(_drive_gains)
.with_steer_motor_closed_loop_output(_steer_closed_loop_output)
.with_drive_motor_closed_loop_output(_drive_closed_loop_output)
.with_slip_current(_slip_current)
.with_speed_at12_volts(speed_at_12_volts)
.with_drive_motor_type(_drive_motor_type)
.with_steer_motor_type(_steer_motor_type)
.with_feedback_source(_steer_feedback_type)
.with_drive_motor_initial_configs(_drive_initial_configs)
.with_steer_motor_initial_configs(_steer_initial_configs)
.with_encoder_initial_configs(_encoder_initial_configs)
.with_steer_inertia(_steer_inertia)
.with_drive_inertia(_drive_inertia)
.with_steer_friction_voltage(_steer_friction_voltage)
.with_drive_friction_voltage(_drive_friction_voltage)
)

◆ _couple_ratio

float _couple_ratio = 3.5714285714285716
staticprotected

◆ _drive_closed_loop_output

_drive_closed_loop_output = swerve.ClosedLoopOutputType.VOLTAGE
staticprotected

◆ _drive_friction_voltage

units _drive_friction_voltage = 0.2
staticprotected

◆ _drive_gains

tuple _drive_gains
staticprotected
Initial value:
= (
configs.Slot0Configs()
.with_k_p(0.1)
.with_k_i(0)
.with_k_d(0)
.with_k_s(0)
.with_k_v(0.124)
)

◆ _drive_gear_ratio

float _drive_gear_ratio = 8.14
staticprotected

◆ _drive_inertia

units _drive_inertia = 0.01
staticprotected

◆ _drive_initial_configs

_drive_initial_configs = configs.TalonFXConfiguration()
staticprotected

◆ _drive_motor_type

_drive_motor_type = swerve.DriveMotorArrangement.TALON_FX_INTEGRATED
staticprotected

◆ _encoder_initial_configs

_encoder_initial_configs = configs.CANcoderConfiguration()
staticprotected

◆ _front_left_drive_motor_id

int _front_left_drive_motor_id = 3
staticprotected

◆ _front_left_encoder_id

int _front_left_encoder_id = 10
staticprotected

◆ _front_left_encoder_inverted

bool _front_left_encoder_inverted = False
staticprotected

◆ _front_left_encoder_offset

float _front_left_encoder_offset = -0.075439453125
staticprotected

◆ _front_left_steer_motor_id

int _front_left_steer_motor_id = 4
staticprotected

◆ _front_left_steer_motor_inverted

bool _front_left_steer_motor_inverted = True
staticprotected

◆ _front_left_x_pos

units _front_left_x_pos = inchesToMeters(11.5)
staticprotected

◆ _front_left_y_pos

units _front_left_y_pos = inchesToMeters(11.5)
staticprotected

◆ _front_right_drive_motor_id

int _front_right_drive_motor_id = 7
staticprotected

◆ _front_right_encoder_id

int _front_right_encoder_id = 12
staticprotected

◆ _front_right_encoder_inverted

bool _front_right_encoder_inverted = False
staticprotected

◆ _front_right_encoder_offset

float _front_right_encoder_offset = 0.356689453125
staticprotected

◆ _front_right_steer_motor_id

int _front_right_steer_motor_id = 8
staticprotected

◆ _front_right_steer_motor_inverted

bool _front_right_steer_motor_inverted = True
staticprotected

◆ _front_right_x_pos

units _front_right_x_pos = inchesToMeters(11.5)
staticprotected

◆ _front_right_y_pos

units _front_right_y_pos = inchesToMeters(-11.5)
staticprotected

◆ _invert_left_side

bool _invert_left_side = False
staticprotected

◆ _invert_right_side

bool _invert_right_side = True
staticprotected

◆ _pigeon_configs

configs _pigeon_configs = None
staticprotected

◆ _pigeon_id

int _pigeon_id = 20
staticprotected

◆ _slip_current

units _slip_current = 120.0
staticprotected

◆ _steer_closed_loop_output

_steer_closed_loop_output = swerve.ClosedLoopOutputType.VOLTAGE
staticprotected

◆ _steer_feedback_type

_steer_feedback_type = swerve.SteerFeedbackType.FUSED_CANCODER
staticprotected

◆ _steer_friction_voltage

units _steer_friction_voltage = 0.2
staticprotected

◆ _steer_gains

tuple _steer_gains
staticprotected
Initial value:
= (
configs.Slot0Configs()
.with_k_p(100)
.with_k_i(0)
.with_k_d(0.5)
.with_k_s(0.1)
.with_k_v(2.66)
.with_k_a(0)
.with_static_feedforward_sign(signals.StaticFeedforwardSignValue.USE_CLOSED_LOOP_SIGN)
)

◆ _steer_gear_ratio

float _steer_gear_ratio = 21.428571428571427
staticprotected

◆ _steer_inertia

units _steer_inertia = 0.01
staticprotected

◆ _steer_initial_configs

_steer_initial_configs
staticprotected
Initial value:
= configs.TalonFXConfiguration().with_current_limits(
configs.CurrentLimitsConfigs()
# Swerve azimuth does not require much torque output, so we can set a relatively low
# stator current limit to help avoid brownouts without impacting performance.
.with_stator_current_limit(60).with_stator_current_limit_enable(True)
)

◆ _steer_motor_type

_steer_motor_type = swerve.SteerMotorArrangement.TALON_FX_INTEGRATED
staticprotected

◆ _wheel_radius

units _wheel_radius = inchesToMeters(2)
staticprotected

◆ back_left

tuple back_left
static
Initial value:
= _constants_creator.create_module_constants(
_back_left_steer_motor_id,
_back_left_drive_motor_id,
_back_left_encoder_id,
_back_left_encoder_offset,
_back_left_x_pos,
_back_left_y_pos,
_invert_left_side,
_back_left_steer_motor_inverted,
_back_left_encoder_inverted,
)

◆ back_right

tuple back_right
static
Initial value:
= _constants_creator.create_module_constants(
_back_right_steer_motor_id,
_back_right_drive_motor_id,
_back_right_encoder_id,
_back_right_encoder_offset,
_back_right_x_pos,
_back_right_y_pos,
_invert_right_side,
_back_right_steer_motor_inverted,
_back_right_encoder_inverted,
)

◆ canbus

canbus = CANBus("Drivetrain", "./logs/example.hoot")
static

◆ drivetrain_constants

tuple drivetrain_constants
static
Initial value:
= (
swerve.SwerveDrivetrainConstants()
.with_can_bus_name(canbus.name)
.with_pigeon2_id(_pigeon_id)
.with_pigeon2_configs(_pigeon_configs)
)

◆ front_left

tuple front_left
static
Initial value:
= _constants_creator.create_module_constants(
_front_left_steer_motor_id,
_front_left_drive_motor_id,
_front_left_encoder_id,
_front_left_encoder_offset,
_front_left_x_pos,
_front_left_y_pos,
_invert_left_side,
_front_left_steer_motor_inverted,
_front_left_encoder_inverted,
)

◆ front_right

tuple front_right
static
Initial value:
= _constants_creator.create_module_constants(
_front_right_steer_motor_id,
_front_right_drive_motor_id,
_front_right_encoder_id,
_front_right_encoder_offset,
_front_right_x_pos,
_front_right_y_pos,
_invert_right_side,
_front_right_steer_motor_inverted,
_front_right_encoder_inverted,
)

◆ speed_at_12_volts

units speed_at_12_volts = 4.73
static

The documentation for this class was generated from the following file: