Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

band-aid solution to updating rev sim to 2025 #1118

Open
wants to merge 20 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions simulation/SyntheSimJava/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ repositories {

// KAUAI
maven {
url "https://dev.studica.com/maven/release/2024/"
url "https://dev.studica.com/maven/release/2025/"
}
}

def WPI_Version = '2024.3.2'
def REV_Version = '2024.2.4'
def CTRE_Version = '24.3.0'
def KAUAI_Version = '2024.1.0'
def WPI_Version = '2025.1.1'
def REV_Version = '2025.0.0'
def CTRE_Version = '25.1.0'
def KAUAI_Version = '2025.1.1-beta-1'

dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
Expand All @@ -52,6 +52,7 @@ dependencies {
// WPILib
implementation "edu.wpi.first.wpilibj:wpilibj-java:$WPI_Version"
implementation "edu.wpi.first.wpiutil:wpiutil-java:$WPI_Version"
implementation "edu.wpi.first.wpiunits:wpiunits-java:$WPI_Version"
implementation "edu.wpi.first.hal:hal-java:$WPI_Version"

// REVRobotics
Expand All @@ -61,7 +62,7 @@ dependencies {
implementation "com.ctre.phoenix6:wpiapi-java:$CTRE_Version"

// KAUAI
implementation "com.kauailabs.navx.frc:navx-frc-java:$KAUAI_Version"
implementation "com.kauailabs.navx.frc:navx_frc-java:$KAUAI_Version"
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public CANEncoder(String name, int deviceId) {
m_init = m_device.createBoolean("init", Direction.kOutput, true);
m_position = m_device.createDouble("position", Direction.kInput, 0.0);
m_velocity = m_device.createDouble("velocity", Direction.kInput, 0.0);

m_init.set(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.autodesk.synthesis.CANEncoder;
import com.autodesk.synthesis.CANMotor;
import com.ctre.phoenix6.signals.NeutralModeValue;
import com.ctre.phoenix6.StatusSignal;
import com.ctre.phoenix6.StatusCode;
import com.ctre.phoenix6.configs.TalonFXConfigurator;
import com.ctre.phoenix6.hardware.DeviceIdentifier;

Expand All @@ -23,35 +23,18 @@ public TalonFX(int deviceNumber) {
this.m_encoder = new CANEncoder("SYN TalonFX", deviceNumber);
}

/**
* Sets the torque of the real and simulated motors
*
* @param percentOutput The torque
*/
@Override
public void set(double percentOutput) {
super.set(percentOutput);
this.m_motor.setPercentOutput(percentOutput);
}

/**
* Sets both the real and simulated motors to neutral mode
*
* @param mode The neutral mode value
*
*/
@Override
public void setNeutralMode(NeutralModeValue mode) {
super.setNeutralMode(mode);

public StatusCode setNeutralMode(NeutralModeValue mode) {
this.m_motor.setBrakeMode(mode == NeutralModeValue.Brake);
return super.setNeutralMode(mode);
}

/**
* Gets and internal configurator for both the simulated and real motors
*
* @return The internal configurator for this Talon motor
*/
@Override
public TalonFXConfigurator getConfigurator() {
DeviceIdentifier id = this.deviceIdentifier;
Expand All @@ -63,27 +46,11 @@ public void setNeutralDeadband(double deadband) {
this.m_motor.setNeutralDeadband(deadband);
}

/**
* Gets the position of the simulated encoder
*
* @return The motor position in revolutions
*/
@Override
public StatusSignal<Double> getPosition() {
Double pos = this.m_encoder.getPosition();
super.setPosition(pos);
return super.getPosition();
public double getPositionSim() {
return this.m_encoder.getPosition();
}

/**
* Gets the velocity of the simulated motor according to the simulated encoder
*
* @return The motor velocity in revolutions per second
*/
@Override
public StatusSignal<Double> getVelocity() {
Double velocity = this.m_encoder.getVelocity();
super.set(velocity);
return super.getVelocity();
public double getVelocitySim() {
return this.m_encoder.getVelocity();
}
}

This file was deleted.

This file was deleted.

Loading