mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Fixed crash in wpilibj SampleRobot (#753)
robotInit() and HAL.observeUserProgramStarting() should be called in startCompetition() rather than the constructor. Fixes #752.
This commit is contained in:
committed by
Peter Johnson
parent
c73dd807e1
commit
05e581f409
@@ -31,11 +31,6 @@ public class SampleRobot extends RobotBase {
|
||||
* Create a new SampleRobot.
|
||||
*/
|
||||
public SampleRobot() {
|
||||
robotInit();
|
||||
|
||||
// Tell the DS that the robot is ready to be enabled
|
||||
HAL.observeUserProgramStarting();
|
||||
|
||||
HAL.report(tResourceType.kResourceType_Framework, tInstances.kFramework_Simple);
|
||||
}
|
||||
|
||||
@@ -115,7 +110,13 @@ public class SampleRobot extends RobotBase {
|
||||
* for the robot to be enabled again.
|
||||
*/
|
||||
public void startCompetition() {
|
||||
robotInit();
|
||||
|
||||
// Tell the DS that the robot is ready to be enabled
|
||||
HAL.observeUserProgramStarting();
|
||||
|
||||
robotMain();
|
||||
|
||||
if (!m_robotMainOverridden) {
|
||||
while (true) {
|
||||
if (isDisabled()) {
|
||||
|
||||
Reference in New Issue
Block a user