mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[sim] Update sim match time to match real robot (#4024)
The real robot has match time set to -1.0 until it's enabled, and then counts down. Disabling the robot sets the time to -1.0. The sim GUI has been updated to add preset buttons for auto and teleop match times. The enable match timing checkbox has been removed as it's no longer required. The DS socket plugin has also been fixed to properly initialize matchTime to -1.0 and reset it to -1.0 on disable.
This commit is contained in:
@@ -310,6 +310,10 @@ void DSCommPacket::SetupJoystickTag(wpi::raw_uv_ostream& buf) {
|
||||
void DSCommPacket::SendUDPToHALSim(void) {
|
||||
SendJoysticks();
|
||||
|
||||
if (!m_control_word.enabled) {
|
||||
m_match_time = -1;
|
||||
}
|
||||
|
||||
HALSIM_SetDriverStationMatchTime(m_match_time);
|
||||
HALSIM_SetDriverStationEnabled(m_control_word.enabled);
|
||||
HALSIM_SetDriverStationAutonomous(m_control_word.autonomous);
|
||||
|
||||
Reference in New Issue
Block a user