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

Public Member Functions

 __init__ (self, units.meters_per_second max_speed)
 
 telemeterize (self, swerve.SwerveDrivetrain.SwerveDriveState state)
 

Protected Attributes

 _drive_module_positions = self._drive_state_table.getStructArrayTopic("ModulePositions", SwerveModulePosition).publish()
 
 _drive_module_states = self._drive_state_table.getStructArrayTopic("ModuleStates", SwerveModuleState).publish()
 
 _drive_module_targets = self._drive_state_table.getStructArrayTopic("ModuleTargets", SwerveModuleState).publish()
 
 _drive_odometry_frequency = self._drive_state_table.getDoubleTopic("OdometryFrequency").publish()
 
 _drive_pose = self._drive_state_table.getStructTopic("Pose", Pose2d).publish()
 
 _drive_speeds = self._drive_state_table.getStructTopic("Speeds", ChassisSpeeds).publish()
 
 _drive_state_table = self._inst.getTable("DriveState")
 
 _drive_timestamp = self._drive_state_table.getDoubleTopic("Timestamp").publish()
 
 _field_pub = self._table.getDoubleArrayTopic("robotPose").publish()
 
 _field_type_pub = self._table.getStringTopic(".type").publish()
 
 _inst = NetworkTableInstance.getDefault()
 
 _max_speed = max_speed
 
list _module_directions
 
list _module_mechanisms
 
list _module_speeds
 
 _table = self._inst.getTable("Pose")
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
units.meters_per_second max_speed )
Construct a telemetry object with the specified max speed of the robot.

:param max_speed: Maximum speed
:type max_speed: units.meters_per_second

Member Function Documentation

◆ telemeterize()

telemeterize ( self,
swerve.SwerveDrivetrain.SwerveDriveState state )
Accept the swerve drive state and telemeterize it to SmartDashboard and SignalLogger.

Member Data Documentation

◆ _drive_module_positions

_drive_module_positions = self._drive_state_table.getStructArrayTopic("ModulePositions", SwerveModulePosition).publish()
protected

◆ _drive_module_states

_drive_module_states = self._drive_state_table.getStructArrayTopic("ModuleStates", SwerveModuleState).publish()
protected

◆ _drive_module_targets

_drive_module_targets = self._drive_state_table.getStructArrayTopic("ModuleTargets", SwerveModuleState).publish()
protected

◆ _drive_odometry_frequency

_drive_odometry_frequency = self._drive_state_table.getDoubleTopic("OdometryFrequency").publish()
protected

◆ _drive_pose

_drive_pose = self._drive_state_table.getStructTopic("Pose", Pose2d).publish()
protected

◆ _drive_speeds

_drive_speeds = self._drive_state_table.getStructTopic("Speeds", ChassisSpeeds).publish()
protected

◆ _drive_state_table

_drive_state_table = self._inst.getTable("DriveState")
protected

◆ _drive_timestamp

_drive_timestamp = self._drive_state_table.getDoubleTopic("Timestamp").publish()
protected

◆ _field_pub

_field_pub = self._table.getDoubleArrayTopic("robotPose").publish()
protected

◆ _field_type_pub

_field_type_pub = self._table.getStringTopic(".type").publish()
protected

◆ _inst

_inst = NetworkTableInstance.getDefault()
protected

◆ _max_speed

_max_speed = max_speed
protected

◆ _module_directions

list _module_directions
protected
Initial value:
= [
self._module_mechanisms[0]
.getRoot("RootDirection", 0.5, 0.5)
.appendLigament("Direction", 0.1, 0, 0, Color8Bit(Color.kWhite)),
self._module_mechanisms[1]
.getRoot("RootDirection", 0.5, 0.5)
.appendLigament("Direction", 0.1, 0, 0, Color8Bit(Color.kWhite)),
self._module_mechanisms[2]
.getRoot("RootDirection", 0.5, 0.5)
.appendLigament("Direction", 0.1, 0, 0, Color8Bit(Color.kWhite)),
self._module_mechanisms[3]
.getRoot("RootDirection", 0.5, 0.5)
.appendLigament("Direction", 0.1, 0, 0, Color8Bit(Color.kWhite)),
]

◆ _module_mechanisms

list _module_mechanisms
protected
Initial value:
= [
Mechanism2d(1, 1),
Mechanism2d(1, 1),
Mechanism2d(1, 1),
Mechanism2d(1, 1),
]

◆ _module_speeds

list _module_speeds
protected
Initial value:
= [
self._module_mechanisms[0]
.getRoot("RootSpeed", 0.5, 0.5)
.appendLigament("Speed", 0.5, 0),
self._module_mechanisms[1]
.getRoot("RootSpeed", 0.5, 0.5)
.appendLigament("Speed", 0.5, 0),
self._module_mechanisms[2]
.getRoot("RootSpeed", 0.5, 0.5)
.appendLigament("Speed", 0.5, 0),
self._module_mechanisms[3]
.getRoot("RootSpeed", 0.5, 0.5)
.appendLigament("Speed", 0.5, 0),
]

◆ _table

_table = self._inst.getTable("Pose")
protected

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