Go to Post I want to see the [game] animation robot with the plunger to pick up balls and the boots that spin to kick them. Could you do that please. It would be very awesome. :D - the man [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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
  #2   Spotlight this post!  
Unread 04-02-2016, 19:02
SamCarlberg's Avatar
SamCarlberg SamCarlberg is offline
GRIP, WPILib. 2084 alum
AKA: Sam Carlberg
no team
Team Role: Mentor
 
Join Date: Nov 2015
Rookie Year: 2009
Location: MA
Posts: 42
SamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to behold
Re: Java Paramter Type

Quick recap on command parameters:

Parameters are there so you can have one command perform multiple actions (rather than one command per action).

For example: there's a mechanism on your robot to kick boulders into the low goal, powered by a pneumatic piston and solenoid. In previous years, you would need a command for kicking and another for retracting the kicker, with their constructors looking something like this:

Code:
public KickCommand() {
    // constructor code
}
...
public RetractKickerCommand() {
    // constructor code
}
With parameters, you can have one command perform either action based on the parameter you give it

Code:
private final boolean m_extending;
public ControlKickerCommand(boolean extending) {
    m_extending = extending;
    // other constructor code
}


If a command sets one of two states, you would use a boolean parameter, like in the example above.

If a command needs a certain setpoint (like a PIDCommand), that should be a double or int

Strings don't have much use for robot control, but may see use in logging/debugging
__________________
WPILib
GRIP, RobotBuilder
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 23:30.

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