Skip to content

Commit

Permalink
Enable phoenix6 simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
auscompgeek committed Jan 9, 2024
1 parent 481a093 commit b38996e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import math
import typing
import phoenix6

Check failure on line 5 in physics.py

View workflow job for this annotation

GitHub Actions / mypy

Skipping analyzing "phoenix6": module is installed, but missing library stubs or py.typed marker
import phoenix6.unmanaged

Check failure on line 6 in physics.py

View workflow job for this annotation

GitHub Actions / mypy

Skipping analyzing "phoenix6.unmanaged": module is installed, but missing library stubs or py.typed marker
import phoenix5
import wpilib

from pyfrc.physics.core import PhysicsInterface
from wpimath.kinematics import SwerveDrive4Kinematics
Expand Down Expand Up @@ -77,6 +79,11 @@ def __init__(self, physics_controller: PhysicsInterface, robot: MyRobot):
self.imu_yaw = self.imu.getDouble("Yaw")

def update_sim(self, now: float, tm_diff: float) -> None:
# Enable the Phoenix6 simulated devices
# TODO: delete when phoenix6 integrates with wpilib
if wpilib.DriverStation.isEnabled():
phoenix6.unmanaged.feed_enable(0.1)

for wheel in self.wheels:
wheel.update(tm_diff)
for steer in self.steer:
Expand Down

0 comments on commit b38996e

Please sign in to comment.