Go to Post We were all rookies once, and we really have two ways to go about things: either take a page from the powerhouses and emulate their style, or complain about not having anything and risk falling into oblivion. - George A. [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-12-2013, 22:13
Kyle Chan's Avatar
Kyle Chan Kyle Chan is offline
Registered User
FRC #0368 (Kika Mana)
Team Role: Programmer
 
Join Date: May 2013
Rookie Year: 2012
Location: Honolulu
Posts: 7
Kyle Chan is an unknown quantity at this point
Passing Parameters with Command-Based Robot Structure

This year our team just switched over from LabVIEW to Windriver and we've decided to go with a Command-Based structure. After looking through various guides, we were able to get the Teleop part of the program going but the Autonomous portion is giving us problems. How do we pass through parameters to specify how far we want the robot to drive (for example)? If anyone could help us out with this, it would be greatly appreciated.
Attached Files
File Type: zip Paikman.zip (3.05 MB, 5 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 18-12-2013, 22:44
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,557
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: Passing Parameters with Command-Based Robot Structure

Where do you want to pass parameters from?

You can make command constructors that take parameters and use those. Have you see WPI's GearsBot videos? They lead you through a complete command based program (albeit in java). https://www.youtube.com/playlist?lis...F26A88C6D16C8F

Last edited by Joe Ross : 18-12-2013 at 23:41.
Reply With Quote
  #3   Spotlight this post!  
Unread 19-12-2013, 02:12
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,168
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Passing Parameters with Command-Based Robot Structure

Our autonomous code reads the desired motions from a text file and executes them. We make up our own command language each year, build a parser and call functions/methods to execute a series of motions or actions. That way we do not have to change the code for each match or before playoffs, we just FTP a new command file to the robot.

HTH
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #4   Spotlight this post!  
Unread 19-12-2013, 03:22
Kyle Chan's Avatar
Kyle Chan Kyle Chan is offline
Registered User
FRC #0368 (Kika Mana)
Team Role: Programmer
 
Join Date: May 2013
Rookie Year: 2012
Location: Honolulu
Posts: 7
Kyle Chan is an unknown quantity at this point
Re: Passing Parameters with Command-Based Robot Structure

Thanks for the quick responses! We'll look into constructors and also reading commands in from a text file.
Reply With Quote
  #5   Spotlight this post!  
Unread 30-12-2013, 18:43
Kyle Chan's Avatar
Kyle Chan Kyle Chan is offline
Registered User
FRC #0368 (Kika Mana)
Team Role: Programmer
 
Join Date: May 2013
Rookie Year: 2012
Location: Honolulu
Posts: 7
Kyle Chan is an unknown quantity at this point
Re: Passing Parameters with Command-Based Robot Structure

Update: We got the autonomous up and running. Had to use a "this" pointer and make it equal to a variable of with a different name from the parameter. In our code we used power, leftdistance, and rightdistance parameters/local variables. Format: "this->localvariable = parameter"
Attached Files
File Type: zip Paikman.zip (3.02 MB, 13 views)
Reply With Quote
  #6   Spotlight this post!  
Unread 05-01-2014, 11:44
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
You can also choose which command, and therefore which autonomous program runs during autonomous using some radio buttons or combo box on the driver station.

http://wpilib.screenstepslive.com/s/...smartdashboard.

Hope this helps.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
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:44.

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