View Single Post
  #1   Spotlight this post!  
Unread 13-03-2015, 18:12
jfitz0807 jfitz0807 is offline
Registered User
FRC #2877 (Ligerbots)
Team Role: Parent
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Newton, MA
Posts: 65
jfitz0807 is an unknown quantity at this point
HELP! CommandGroup not working

We're at competition. We had a number of autonomous command groups coded, but we didn't get to test them on the competition bot until this morning. We're using the SmartDashboard chooser to select one for each match. At least, that was the plan.

It turns out that no matter what we try, even defining just a single commandGroup and not using the chooser, our robot runs through autonomousInit() and then goes into autonomousPeriodic(), but it never returns form the call to Scheduler::GetInstance()->Run(); We can't figure out what's going wrong. A printf right after the call never appears in the log, but the code is still running. The DriverStation still shows "Robot Code" green and we can still transition into and out of Teleop and even back into Auto. It's just that nothing happens on the robot. None of our Teleop commands from the joystick work and our camera feed doesn't work either.

If we change our autonomousCommand from a CommandGroup to a Command, it works.

Full disclosure: We used java last year and switched to C++ this year since we had more C++ mentors and our java programmers graduated last year. Since we didn't use C++ last year, we don't have a CommandBase class from which our Commands inherit. According to the documentation, this is not necessary this year.

I'm going to try to make a number of commands that explicitly chain other commands together by having one call the next it it's end() method as a workaround, but if anyone has any thoughts on how to make the CommandGroups work, that would be greatly appreciated.
Reply With Quote