mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Removed modules from the simulation infrastructure and refactored FRCPlugin.
Pneumatics still have CAN modules. The refactored code is now eight plugins for sensors and actuators. There is some code reuse that should be refactored out, but that level of abstraction will wait until we figure out how these plugins are integrating with gazebo proper. Change-Id: I357e695ef05af6dda83a39ba60380686bd57d11a Closes: artf2610, artf2623
This commit is contained in:
committed by
Alex Henning
parent
3b4718fc92
commit
8ae64a12ea
@@ -40,7 +40,7 @@ public class AnalogInput extends SensorBase implements PIDSource,
|
||||
*/
|
||||
public AnalogInput(final int channel) {
|
||||
m_channel = channel;
|
||||
m_impl = new SimFloatInput("simulator/analog/1/"+channel); // TODO: If module numbers cannot be specified, remove them from the communication system.
|
||||
m_impl = new SimFloatInput("simulator/analog/"+channel);
|
||||
|
||||
LiveWindow.addSensor("AnalogInput", channel, this);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class DigitalInput implements IInputOutput,
|
||||
* the port for the digital input
|
||||
*/
|
||||
public DigitalInput(int channel) {
|
||||
impl = new SimDigitalInput("simulator/dio/1/"+channel);
|
||||
impl = new SimDigitalInput("simulator/dio/"+channel);
|
||||
m_channel = channel;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class Encoder extends SensorBase implements CounterBase, PIDSource,
|
||||
} else {
|
||||
m_reverseDirection = reverseDirection;
|
||||
}
|
||||
impl = new SimEncoder("simulator/dio/1/"+aChannel+"/1/"+bChannel);
|
||||
impl = new SimEncoder("simulator/dio/"+aChannel+"/"+bChannel);
|
||||
setDistancePerPulse(1);
|
||||
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class Gyro extends SensorBase implements PIDSource, ISensor,
|
||||
* first turned on while it's sitting at rest before the competition starts.
|
||||
*/
|
||||
private void initGyro(int channel) {
|
||||
impl = new SimGyro("simulator/analog/1/"+channel);
|
||||
impl = new SimGyro("simulator/analog/"+channel);
|
||||
|
||||
reset();
|
||||
setPIDSourceParameter(PIDSourceParameter.kAngle);
|
||||
|
||||
@@ -25,7 +25,7 @@ public class Jaguar implements SpeedController, PIDOutput, MotorSafety, LiveWind
|
||||
*/
|
||||
private void initJaguar(final int channel) {
|
||||
this.channel = channel;
|
||||
impl = new SimSpeedController("simulator/pwm/1/"+channel);
|
||||
impl = new SimSpeedController("simulator/pwm/"+channel);
|
||||
|
||||
m_safetyHelper = new MotorSafetyHelper(this);
|
||||
m_safetyHelper.setExpiration(0.0);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class Talon implements SpeedController, PIDOutput, MotorSafety, LiveWindo
|
||||
*/
|
||||
private void initTalon(final int channel) {
|
||||
this.channel = channel;
|
||||
impl = new SimSpeedController("simulator/pwm/1/"+channel);
|
||||
impl = new SimSpeedController("simulator/pwm/"+channel);
|
||||
|
||||
m_safetyHelper = new MotorSafetyHelper(this);
|
||||
m_safetyHelper.setExpiration(0.0);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Victor implements SpeedController, PIDOutput, MotorSafety, LiveWind
|
||||
*/
|
||||
private void initVictor(final int channel) {
|
||||
this.channel = channel;
|
||||
impl = new SimSpeedController("simulator/pwm/1/"+channel);
|
||||
impl = new SimSpeedController("simulator/pwm/"+channel);
|
||||
|
||||
m_safetyHelper = new MotorSafetyHelper(this);
|
||||
m_safetyHelper.setExpiration(0.0);
|
||||
|
||||
Reference in New Issue
Block a user