Go to Post Some of them look like phone numbers... LETS START CALLING THEM ALL! - akoscielski3 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 02-02-2012, 10:22
jwakeman jwakeman is offline
Registered User
FRC #0063 (Red Barons)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: 16510
Posts: 182
jwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nice
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());
}
Reply With Quote
  #2   Spotlight this post!  
Unread 03-02-2012, 01:25
grantf's Avatar
grantf grantf is offline
Software Engineering Mentor
FRC #4061 (SciBorgs)
Team Role: Engineer
 
Join Date: Feb 2007
Rookie Year: 2005
Location: Pullman, WA
Posts: 16
grantf has a spectacular aura aboutgrantf has a spectacular aura about
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
Then it seems like the timeout error occurs repeatedly - because the Robot Task is dead due to the watchdog issue.

I posted a FIRST-Forge bug/artifact here:
Reply With Quote
  #3   Spotlight this post!  
Unread 03-02-2012, 10:18
jwakeman jwakeman is offline
Registered User
FRC #0063 (Red Barons)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: 16510
Posts: 182
jwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nice
Re: View scheduler in SmartDashboard

Quote:
Originally Posted by grantf View Post
It seems that any interaction with the SmartDashboard results in a robot crash.
I only have the problem when trying to send the Scheduler to the SmartDashboard. I am having no problem putting other data including subsystem objects, PID controllers and just raw doubles. All of this works fine:

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());
}
I'm not sure how your code works since you are not using the scheduler in TeleopPeriodic(). There is probably not much reason to use the Command Based architecture if you are not going to use the scheduler. And that may also be leading to the crashes you are seeing..
Reply With Quote
  #4   Spotlight this post!  
Unread 03-02-2012, 12:58
grantf's Avatar
grantf grantf is offline
Software Engineering Mentor
FRC #4061 (SciBorgs)
Team Role: Engineer
 
Join Date: Feb 2007
Rookie Year: 2005
Location: Pullman, WA
Posts: 16
grantf has a spectacular aura aboutgrantf has a spectacular aura about
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.
Reply With Quote
  #5   Spotlight this post!  
Unread 03-02-2012, 21:32
tbricknell tbricknell is offline
Registered User
FRC #1768 (Robochiefs)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2010
Location: United States
Posts: 1
tbricknell is an unknown quantity at this point
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 05-02-2012, 23:35
PlayfulPlatypus PlayfulPlatypus is offline
Registered User
FRC #2655
 
Join Date: Feb 2012
Location: United States
Posts: 3
PlayfulPlatypus is an unknown quantity at this point
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());
Then I get the same timeout errors.

Brian
Reply With Quote
  #7   Spotlight this post!  
Unread 06-02-2012, 00:27
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: View scheduler in SmartDashboard

Have you tried the new wpilib release from yesterday? It should fix this issue.
Reply With Quote
  #8   Spotlight this post!  
Unread 06-02-2012, 11:08
PlayfulPlatypus PlayfulPlatypus is offline
Registered User
FRC #2655
 
Join Date: Feb 2012
Location: United States
Posts: 3
PlayfulPlatypus is an unknown quantity at this point
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
Reply With Quote
  #9   Spotlight this post!  
Unread 06-02-2012, 12:38
PlayfulPlatypus PlayfulPlatypus is offline
Registered User
FRC #2655
 
Join Date: Feb 2012
Location: United States
Posts: 3
PlayfulPlatypus is an unknown quantity at this point
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
Reply With Quote
  #10   Spotlight this post!  
Unread 06-02-2012, 13:03
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: View scheduler in SmartDashboard

Have you looked at the Dashboard class?

Joe
Reply With Quote
  #11   Spotlight this post!  
Unread 08-02-2012, 00:19
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: View scheduler in SmartDashboard

Quote:
Originally Posted by PlayfulPlatypus View Post
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.
If you can come up with a concise example that causes the failure with the 3111 release, please create a tracker at firstforge.wpi.edu in the WPILib project.

Thanks,
-Joe
Reply With Quote
  #12   Spotlight this post!  
Unread 08-02-2012, 16:07
SpikeyBot293's Avatar
SpikeyBot293 SpikeyBot293 is offline
Registered User
AKA: Liz Tarantino
FRC #0293 (S.P.I.K.E.)
Team Role: Leadership
 
Join Date: Jan 2012
Rookie Year: 2008
Location: Hopewell
Posts: 6
SpikeyBot293 is an unknown quantity at this point
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!
__________________
Owen's Problem is....

EVERYTHING.
Reply With Quote
  #13   Spotlight this post!  
Unread 08-02-2012, 17:55
Sunstroke Sunstroke is offline
Programmer
AKA: Joe Grinstead
FRC #3504 (Girls of Steel)
Team Role: Mentor
 
Join Date: Apr 2009
Rookie Year: 2009
Location: New England
Posts: 49
Sunstroke is an unknown quantity at this point
Re: View scheduler in SmartDashboard

Quote:
Originally Posted by SpikeyBot293 View Post
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!
When you put a Subsystem in SmartDashboard, it will pop-up with a text box saying the name of the command that is running.

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.
Reply With Quote
  #14   Spotlight this post!  
Unread 08-02-2012, 18:36
SpikeyBot293's Avatar
SpikeyBot293 SpikeyBot293 is offline
Registered User
AKA: Liz Tarantino
FRC #0293 (S.P.I.K.E.)
Team Role: Leadership
 
Join Date: Jan 2012
Rookie Year: 2008
Location: Hopewell
Posts: 6
SpikeyBot293 is an unknown quantity at this point
Re: View scheduler in SmartDashboard

Quote:
Originally Posted by Sunstroke View Post
When you put a Subsystem in SmartDashboard, it will pop-up with a text box saying the name of the command that is running.

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.
Thank you so much; this really helps. This may be a stupid question, but where exactly would you hand in the string? When you initialize the Subsystem with the SmartDashboard or when you initialize the Command itself?
__________________
Owen's Problem is....

EVERYTHING.
Reply With Quote
  #15   Spotlight this post!  
Unread 09-02-2012, 01:04
pavie pavie is offline
Registered User
AKA: Paul Bieganski
FRC #3630 (Stampede)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Minneapolis
Posts: 11
pavie is an unknown quantity at this point
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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 13:39.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi