|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
|||
|
|||
|
View scheduler in SmartDashboard
When I uncomment the line below my robot code crashses. Any suggestions?
Code:
virtual void RobotInit() {
CommandBase::init();
autonomousCommand = new ExampleCommand();
//SmartDashboard::GetInstance()->PutData("SchedulerData",Scheduler::GetInstance());
}
|
|
#2
|
||||
|
||||
|
Re: View scheduler in SmartDashboard
@jwakeman
I am experiencing the same symptom you are. It seems that any interaction with the SmartDashboard results in a robot crash. I have confirmed that the code I have works as expected (no watchdog issues) when SmartDashboard is not involved, but results in the dreaded "Watchdog Not Fed" symptom when even the simplest of lines is added (I went 1 level deeper to avoid using any of the code in the scheduler, just in case that was the problem - CommandBase::asp_accumulatorSubsystem is a sub-class of Subsystem and is therefore a subclass of SmartDashboardNamedData, so it fits the PutData() method signature): Code:
void
WsRobot::RobotInit(void)
{
this->GetWatchdog().SetExpiration(1.0);
this->GetWatchdog().SetEnabled(true);
SmartDashboard::GetInstance()->PutData(CommandBase::asp_accumulatorSubsystem);
}
TeleopPeriodic()
{
this->GetWatchdog().Feed();
}
As soon as I push even 1 button that causes the Accumulator subsystem to activate, the code crashes. Here are the errors I get on the Driver Station Diagnostics window (it appears that the errors are to be read from the bottom up): Code:
ERROR: A timeout has been exceeded: NetworkTables watchdog expired... disconnecting ...in WatchdogTaskRun() in C:/WindRiver/workspace/WPILib/NetworkTables/Connection.cpp at line 567 ERROR: A timeout has been exceeded: NetworkTables watchdog expired... disconnecting ...in WatchdogTaskRun() in C:/WindRiver/workspace/WPILib/NetworkTables/Connection.cpp at line 567 ERROR: Task error: Task already deleted.: FRC_NetworkTablesWriteTask ...in HandleError() in C:/WindRiver/workspace/WPILib/Task.cpp at line 190 ERROR: Error reading NetworkTables socket: errno=54 ...in Read() in C:/WindRiver/workspace/WPILib/NetworkTables/Reader.cpp at line 70 ERROR: NetworkTables data stream is corrupt: Unexpected ID ...in GetTable() in C:/WindRiver/workspace/WPILib/NetworkTables/Connection.cpp at line 534 I posted a FIRST-Forge bug/artifact here: |
|
#3
|
|||
|
|||
|
Re: View scheduler in SmartDashboard
Quote:
Code:
DriveSubsystem::DriveSubsystem() : Subsystem("DriveSubsystem") {
SmartDashboard::GetInstance()->PutData("DriveSubsystem",this);
SmartDashboard::GetInstance()->PutData("LeftSpeedCtl",pLeftSpeedControl);
SmartDashboard::GetInstance()->PutData("RightSpeedCtl",pRightSpeedControl);
}
Code:
void DriveSubsystem::UpdateStatus()
{
SmartDashboard::GetInstance()->PutDouble("Left Raw",pLeftEncoder->GetRaw());
SmartDashboard::GetInstance()->PutDouble("Right Raw",pRightEncoder->GetRaw());
SmartDashboard::GetInstance()->PutDouble("Left Speed",pLeftEncoder->GetRate());
SmartDashboard::GetInstance()->PutDouble("Right Speed",pRightEncoder->GetRate());
SmartDashboard::GetInstance()->PutDouble("Left Set Point",this->pLeftSpeedControl->GetSetpoint());
SmartDashboard::GetInstance()->PutDouble("Right Set Point",this->pRightSpeedControl->GetSetpoint());
}
|
|
#4
|
||||
|
||||
|
Re: View scheduler in SmartDashboard
We are using Button/Command/Subsystem architecture (5 subsystems, 12 commands, 6 buttons so far, more to come). I left those details out because I wanted to focus on the problem at hand - the scheduler.
I also see that individual data points are successfully sent to the Dashboard using the PutInt(), PutDouble() etc. methods. I believe we are observing exactly the same issue. |
|
#5
|
|||
|
|||
|
Re: View scheduler in SmartDashboard
We are having same issue with the robot crashing when we are trying to send Scheduler output to the SmartDashboard. I don't have the exact details in front of me, but we I believe we are getting a nul function pointer (or at least some other type of excecution at location zero) in the wpilib code on the main robot code and some timeouts on some of the NetworkTable worker tasks. I am not sure which comes first the crash or the dead threads. The problem can occur right away or after a few minutes.
All of our other output so far works fine to the SmartDashBoard other than the scheduler information. We have very little in the way of new code at this point (1 subsystem and a handful of commands) We are programming in C++. Any suggestions would be appreciated and we figure anything out, we will post some more information. |
|
#6
|
|||
|
|||
|
Re: View scheduler in SmartDashboard
We are having the same issue. I have a DriveWithJoysticksCmd command, that calls a Drive() method on our DriveTrainSubsystem whenever the Execute() method is called. Everything works great if I create and Start() the command in TeleopInit(). However, if I add the line
Code:
SmartDashboard::GetInstance()->PutData("SchedulerData", Scheduler::GetInstance());
Brian |
|
#7
|
|||
|
|||
|
Re: View scheduler in SmartDashboard
Have you tried the new wpilib release from yesterday? It should fix this issue.
|
|
#8
|
|||
|
|||
|
Re: View scheduler in SmartDashboard
I downloaded the update, and it got rid of some of the problems I was having, where GetTable() was returning null when NetworkTables were being initialized (I would get this error every time I put something to the SmartDashboard), however, adding the Scheduler to the SmartDashboard still triggers the watchdog timeout problem for us.
Brian |
|
#9
|
|||
|
|||
|
Re: View scheduler in SmartDashboard
Upon further experimentation, it appears that the SmartDashboard update on the cRIO side may be causing the watchdog timeouts. I added a couple of SD->PutDouble(...) calls in my drive subsystem whenever the drive motors were being set by either the joysticks or directly by a command. Sometimes this would work, and sometimes it would cause timeouts immediately, and sometimes it would timeout after a CommandGroup finished, but before the default command for the drive subsystem could start. If I remove the calls to SD->PutDouble(...) then the problem goes away, and everything functions normally.
I'm new to FIRST and FRC, so I'm still learning WPILib - is there another good way to log data? I can use the DS LCD, but that gets crowded and cumbersome for debugging. I'm using the NI NetConsole app - can I just log the values so they show up there? Thanks! Brian Team 2655 Programming Mentor |
|
#10
|
|||
|
|||
|
Re: View scheduler in SmartDashboard
Have you looked at the Dashboard class?
Joe |
|
#11
|
|||
|
|||
|
Re: View scheduler in SmartDashboard
Quote:
Thanks, -Joe |
|
#12
|
||||
|
||||
|
Re: View scheduler in SmartDashboard
Hey all,
We're getting similar errors, the whole "Network Tables" and watchdog problem with the scheduler. However, whenever we send Subsystem data to the dashboard, so that we can read what commands are running, the textbox displays the word "Command" followed by a string of random numbers and letters. Are these problems related? Or is there something just drastically wrong with our code? Any answers will be greatly appreciated! |
|
#13
|
|||
|
|||
|
Re: View scheduler in SmartDashboard
Quote:
In Java, the command is given a name automatically (using reflection). You can't do this in c++, so the commands are given "Command:" and then the pointer number as a name. If you want to give your commands readable names, just hand in a string with the name when you initialize them. |
|
#14
|
||||
|
||||
|
Re: View scheduler in SmartDashboard
Quote:
|
|
#15
|
|||
|
|||
|
Re: View scheduler in SmartDashboard
Same issues here. BTW - the cRIO does not seem able to re-establish comm with the SD - make sure to restart it every time. The entire Network Table concept looks like a nice idea, but the code is unfortunately half-baked and not quite tested.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|