Go to Post Blasphemy! This is FRC we must over analyze everything! - Ginger Power [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-01-2017, 02:05
Thomas DeSilva's Avatar
Thomas DeSilva Thomas DeSilva is offline
Programming Fury
FRC #1983 (Skunkworks)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Des Moines, WA
Posts: 22
Thomas DeSilva is on a distinguished road
Re: CTRE Toolsuite with Command-Based C++

Your compiler output actually indicates that the build was successful. Important takeaway here: sometimes Eclipse gets it wrong. If it's giving you an error that doesn't make much sense, always check the console to verify that it's real and not just Eclipse being Eclipse.

The error showing up in the driver station log isn't directly related to the other problem you were having. The error says that MotorSafetyHelper is trying to check the FPGA time before the FPGA is initialized, which may be because you're calling CANTalon::SetSafetyEnabled() in the constructor for your subsystem. It may help to move that call to a later point in time, but I don't know how it works under the covers and I haven't seen the rest of your code, so I can't say for sure--maybe one of WPILib's maintainers could chime in on this. I don't think that should be blocking you, though; is your command running now?
__________________
Programmer 2009-2011
Driver 2011
WPI Class of 2015
Reply With Quote
  #2   Spotlight this post!  
Unread 16-01-2017, 02:54
CSkillet CSkillet is offline
Registered User
FRC #0135
 
Join Date: Jan 2016
Location: Indiana
Posts: 11
CSkillet is an unknown quantity at this point
Re: CTRE Toolsuite with Command-Based C++

No, that did not work unfortunately, I will see if maybe there is a way to either stop those functions from Timer and MotorSafetyControl to stop running before the initialize. But it doesn't make any sense because I'm not using timers at all.
Reply With Quote
  #3   Spotlight this post!  
Unread 16-01-2017, 16:16
jlindquist74's Avatar
jlindquist74 jlindquist74 is offline
WOPR Software Integration Lead
FRC #1622
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 1337
Location: Poway, CA
Posts: 51
jlindquist74 has a brilliant futurejlindquist74 has a brilliant futurejlindquist74 has a brilliant futurejlindquist74 has a brilliant futurejlindquist74 has a brilliant futurejlindquist74 has a brilliant futurejlindquist74 has a brilliant futurejlindquist74 has a brilliant futurejlindquist74 has a brilliant futurejlindquist74 has a brilliant futurejlindquist74 has a brilliant future
Re: CTRE Toolsuite with Command-Based C++

Quote:
Originally Posted by Thomas DeSilva View Post
The error says that MotorSafetyHelper is trying to check the FPGA time before the FPGA is initialized, which may be because you're calling CANTalon::SetSafetyEnabled() in the constructor for your subsystem. It may help to move that call to a later point in time, but I don't know how it works under the covers
I strongly discourage our programming team from making any calls that might communicate with hardware in their constructors. To do so assumes that the "under the covers" initialization done by WPILib is complete and the hardware can be reached at the time the constructor executes. That's the kind of thing that worries me, "it may work today, but it may change in the next update.

I advise them to put those calls in the Init methods. By the time the Init()s are called, the hardware *must* be configured for our use. (Otherwise, what's the point?)

If you give that a try, or if you find another solution, would you please let us know how it goes? Your experience will surely be helpful to other teams!
Reply With Quote
  #4   Spotlight this post!  
Unread 18-01-2017, 01:56
Thomas DeSilva's Avatar
Thomas DeSilva Thomas DeSilva is offline
Programming Fury
FRC #1983 (Skunkworks)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Des Moines, WA
Posts: 22
Thomas DeSilva is on a distinguished road
Re: CTRE Toolsuite with Command-Based C++

Quote:
Originally Posted by jlindquist74 View Post
I strongly discourage our programming team from making any calls that might communicate with hardware in their constructors. To do so assumes that the "under the covers" initialization done by WPILib is complete and the hardware can be reached at the time the constructor executes.
I agree. In this case, I was actually more worried about the EnableControl() call than the SetSafetyEnabled() call, but figured it was outside the scope of this question. You raise a good point, though.
__________________
Programmer 2009-2011
Driver 2011
WPI Class of 2015
Reply With Quote
  #5   Spotlight this post!  
Unread 18-01-2017, 21:24
CSkillet CSkillet is offline
Registered User
FRC #0135
 
Join Date: Jan 2016
Location: Indiana
Posts: 11
CSkillet is an unknown quantity at this point
Re: CTRE Toolsuite with Command-Based C++

I have moved all the functions associated with the Configuration of the Talon not into the constuctor if the subsystem, but of the Initialize() of the Command. However, this has not seemed to change anything in terms of the errors we are receiving.
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:31.

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