Skip to content

Refactoring drive train swerve module to batch update signals and use…#32

Open
Kython89 wants to merge 1 commit into
mainfrom
swerve_latency_comp
Open

Refactoring drive train swerve module to batch update signals and use…#32
Kython89 wants to merge 1 commit into
mainfrom
swerve_latency_comp

Conversation

@Kython89
Copy link
Copy Markdown
Contributor

@Kython89 Kython89 commented Mar 8, 2024

… latency comp

Docs driving these changes are here. Untested on an actual robot.
https://v6.docs.ctr-electronics.com/en/stable/docs/api-reference/api-usage/status-signals.html

@Kython89 Kython89 requested a review from dellwoodbu March 8, 2024 13:01
Copy link
Copy Markdown

@akrose6114 akrose6114 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me a minute to find the creation of the new values in the update func but i think this makes sense and is an improvement.

We will want I think to declare/initialize all of the values we use in update in the init function so that they have an allocation and don't cause a crash if read before they are instantiated in update function.

Comment thread subsystems/drivetrain.py Outdated
def distance(self):
return wpimath.units.inchesToMeters(self.driveMotor.get_position().value * self.wheel_circumference)


Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dexter: should be self.state_drive_pos

Comment thread subsystems/drivetrain.py Outdated
def get_state(self):
return SwerveModuleState(
speed=wpimath.units.inchesToMeters(self.driveMotor.get_velocity().value * (self.wheel_circumference)),
speed=wpimath.units.inchesToMeters(state_drive_vel * (self.wheel_circumference)),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dexter: needs self. prefix

@Kython89 Kython89 force-pushed the swerve_latency_comp branch from 57916c2 to fdfcecf Compare March 9, 2024 16:04
@Kython89 Kython89 force-pushed the swerve_latency_comp branch from fdfcecf to 5e6fe88 Compare March 30, 2024 15:06
… latency comp

Fix paths with events on C++ (#603)
@Kython89 Kython89 force-pushed the swerve_latency_comp branch from 5e6fe88 to e7bae99 Compare April 1, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants