|
Re: ASAP Code giving outOfMemory error
Quote:
Originally Posted by ahwhitley
Thank you very much for the detailed reply! It helped a lot to understand how the command/subsystem framework works. I should have realized that the commands were suppose to be recursion based (that's what it looks like is happening) based on some sample code I was using.
Either way thanks for the reply again. This should definitely be enough info to finish the code up.
Andrew
|
Commands shouldn't be recursion based if you are using the strict computer science definition of recursion (a function/method which calls itself).
Commands should be seen as instructions to control the hardware tied to a subsystem. A command can do one thing and finish such as set a solenoid in a subsystem and complete, or a command can run forever, and only close when interrupted, such as driving with Joysticks, which will run forever, and if you hit a button to run another command on that subsystem it will stop.
Take a look at the screensteps live wpi site for an overview of commandbase if its still unclear or post questions here.
If you are getting an outOfMemory message, you have a memory leak somewhere. I haven't looked at your code, but look for anywhere you use the new operator in a loop. That is probably not something you want to do.
Hope this helps,
Kevin
__________________
Controls Engineer, Team 2168 - The Aluminum Falcons
[2016 Season] - World Championship Controls Award, District Controls Award, 3rd BlueBanner
-World Championship- #45 seed in Quals, World Championship Innovation in Controls Award - Curie
-NE Championship- #26 seed in Quals, winner(195,125,2168)
[2015 Season] - NE Championship Controls Award, 2nd Blue Banner
-NE Championship- #26 seed in Quals, NE Championship Innovation in Controls Award
-MA District Event- #17 seed in Quals, Winner(2168,3718,3146)
[2014 Season] - NE Championship Controls Award & Semi-finalists, District Controls Award, Creativity Award, & Finalists
-NE Championship- #36 seed in Quals, SemiFinalist(228,2168,3525), NE Championship Innovation in Controls Award
-RI District Event- #7 seed in Quals, Finalist(1519,2168,5163), Innovation in Controls Award
-Groton District Event- #9 seed in Quals, QuarterFinalist(2168, 125, 5112), Creativity Award
[2013 Season] - WPI Regional Winner - 1st Blue Banner
Last edited by NotInControl : 14-03-2014 at 17:09.
|