Go to Post Wins = Attention Attention = Sponsors Sponsors = Money Money= being able to do more. a vicious cycle...but it is what it is - Protronie [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 02-05-2016, 00:04
cpapplefamily cpapplefamily is offline
Registered User
FRC #3244 (Granite City Gearheads)
Team Role: Mentor
 
Join Date: May 2015
Rookie Year: 2015
Location: Minnesota
Posts: 250
cpapplefamily has a spectacular aura aboutcpapplefamily has a spectacular aura about
Re: Run a command with conditions

In an effort to continue down this rabbit hole here is where I sit.

I have continued with one of the original ideas before I attempt to try the build the autonomousCommand just before running it. To better discusse the code here is a link to the Github repo
https://github.com/GraniteCiyGearhea...ntsABot_Talahi
If we drill to
Code:
FIRSTStronghold2016/Copy of SirAntsABot_Talahi/src/org/usfirst/frc3244/SirAntsABot/commands/Auto_22_Demo_03_Drive_N_Score
We can see we are driving the Bot with a few commands before we:
Code:
addSequential(new Auto_Score_Ball_In_Goal());
This Code is now executing as I desired by only shooting if the goalChooser is not zero. Thanks to kylelanman for pointing it out we need to start the commands.

Now the trouble I'm having is getting the next sequence to continue when
Code:
Auto_Score_Ball_In_Goal()
is done. I have inserted some prints to show me who's end() and interrupted() methods are being called. The time out was just a test in Auto_Score_Ball_In_Goal(). I have also tried to use !c.isRunning. If you look at what c is its a command group called "PinBall_Cycle". This group sets the claw and shoots the ball. I also put system.out.println in these end methods to see if they are completing. It seems to me that everything works as planed and completing, only I'm not returning to the Auto_22_Demo_03_Drive_N_Score to finish the last two commands in the group.

Maybe someone can point me to or explain to me the life cycle of a command and what is needed to move onto the next sequence in a command group.
Reply With Quote
  #2   Spotlight this post!  
Unread 07-05-2016, 22:53
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Run a command with conditions

Calling end() doesn't cause a command to end. Making isFinished() return true does.

I think the problem is that the commands you are starting are canceling Auto_22_Demo_03_Drive_N_Score because they require the same subsystems.
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 02:37.

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