Go to Post Give me a week, and a lot of caffeine and I could have one made. Problem is the lack of a week and caffeine. - Mike [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Spotlight this post!  
Unread 13-03-2015, 18:47
cbf cbf is offline
Registered User
FRC #2877
 
Join Date: Feb 2012
Location: Newton, MA
Posts: 73
cbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nice
Re: HELP! CommandGroup not working

You're welcome to all of it: https://github.com/ligerbots/Recycle...ree/dartFriday

Specifically, if look at line 149 of Robot.cpp in AutonomousInit(). You'll see a commented out line:

Code:
autonomousCommand = (CommandGroup *)new DrivePID(100.0, 100.0);
Note that DrivePID is a command (i.e. derives from the WPILib Command class). The assignment above shouldn't work. But it does. It's the only thing we've gotten to work in autonomous -- running a single command.

When we assign a class that instead derives from CommandGroup (so we can do things like AddSequential and AddParallel), which is how we thought this was supposed to work the first call to Scheduler::GetInstance()->Run(); in AutonomousPeriodic goes away and never returns. I traced a couple of instruction into it, and it definitely looks like its been passed a class other than what it expects and is thus calling through a random vtable pointer. We don't get a segfault, but nothing in the program runs after that.

The code at that Git repository right now is the code that fails (but that might change if I can find a fix tonight).

John and I have been trying to find examples of a working Iterative Robot C++ autonomous without success so far, but we'd be very happy if someone can look at our code and tell us we've done thing stupid and obvious..
Reply With Quote
 


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 05:13.

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