View Single Post
  #10   Spotlight this post!  
Unread 03-01-2015, 20:34
dougwilliams's Avatar
dougwilliams dougwilliams is offline
Engineer - Controls, Electronics
FRC #2053 (TigerTronics)
Team Role: Mentor
 
Join Date: May 2013
Rookie Year: 2013
Location: Vestal, NY
Posts: 109
dougwilliams is on a distinguished road
Re: Command Based Auto - Windriver C++ Having trouble to add sequential auto commands

Quote:
Originally Posted by KPSch View Post
Doug,

...

printf("my X=%p", &speed_side);

This would tell you if there's a possibility that you have different DriveAuto command instances that are somehow sharing a common set of member variables. I don't see anything in the code that could accidentally allow this.
Just to close this one out in case anyone has a similar issue down the road- the problem we had was that the variables "in the class", were not actually in the class at all. They were in the file, but made global in scope because they were outside the class structure. When we called the same drive function multiple times in the same command group, it did construct them all, but each subsequent call overwrote the global variables with that set of parameters.

So, we wound up with 3 back to back commands doing the same thing, whatever the very last command issued was.

Thanks everyone for your help...
Reply With Quote