mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
Minor fixes required to enable the simulated robots to run (#1181)
* Fix bugs in PacGoat Java example that prevent it from working. We have conflicting ports in use, each of which causes a crash at startup. These changes fix those issues. * Change to avoid a crash in Visual C++ when running simulated code. Without this change, we would get a crash in SendableRobotBase when constructing a Twine from the 'kOptions' constant string; we'd get an unable to access memory exception.
This commit is contained in:
committed by
Peter Johnson
parent
ae72c0b296
commit
85118a023d
@@ -9,8 +9,4 @@
|
||||
|
||||
using namespace frc;
|
||||
|
||||
const char* SendableChooserBase::kDefault = "default";
|
||||
const char* SendableChooserBase::kOptions = "options";
|
||||
const char* SendableChooserBase::kSelected = "selected";
|
||||
|
||||
SendableChooserBase::SendableChooserBase() : SendableBase(false) {}
|
||||
|
||||
@@ -27,9 +27,9 @@ class SendableChooserBase : public SendableBase {
|
||||
~SendableChooserBase() override = default;
|
||||
|
||||
protected:
|
||||
static const char* kDefault;
|
||||
static const char* kOptions;
|
||||
static const char* kSelected;
|
||||
static constexpr const char* kDefault = "default";
|
||||
static constexpr const char* kOptions = "options";
|
||||
static constexpr const char* kSelected = "selected";
|
||||
|
||||
std::string m_defaultChoice;
|
||||
nt::NetworkTableEntry m_selectedEntry;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class DriveTrain extends Subsystem {
|
||||
private final DifferentialDrive m_drive;
|
||||
private final Encoder m_rightEncoder = new Encoder(1, 2, true, EncodingType.k4X);
|
||||
private final Encoder m_leftEncoder = new Encoder(3, 4, false, EncodingType.k4X);
|
||||
private final AnalogGyro m_gyro = new AnalogGyro(2);
|
||||
private final AnalogGyro m_gyro = new AnalogGyro(0);
|
||||
|
||||
/**
|
||||
* Create a new drive train subsystem.
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Shooter extends Subsystem {
|
||||
DigitalInput m_piston1ReedSwitchFront = new DigitalInput(9);
|
||||
DigitalInput m_piston1ReedSwitchBack = new DigitalInput(11);
|
||||
//NOTE: currently ignored in simulation
|
||||
DigitalInput m_hotGoalSensor = new DigitalInput(3);
|
||||
DigitalInput m_hotGoalSensor = new DigitalInput(7);
|
||||
|
||||
/**
|
||||
* Create a new shooter subsystem.
|
||||
|
||||
Reference in New Issue
Block a user