Go to Post Honestly I'm looking forward to just seeing all my friends again, that's what FIRST is really about to me. - Barry Bonzack [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 25-02-2016, 19:10
schleprock's Avatar
schleprock schleprock is offline
Code Jockey
FRC #4905 (AndromedaOne)
Team Role: Mentor
 
Join Date: Feb 2015
Rookie Year: 2014
Location: massachusetts
Posts: 21
schleprock is an unknown quantity at this point
Exclamation robotbuilder overwrites parameters on commands that have parameters

i really like the new addition to commands in robotbuilder that supports parameters. the only problem is that when the kids regenerate the Java code, robotbuilder deletes the arguments in the constructor calls in OI.java that puts command buttons on the dashboard. for example we have a command:
TurnRobotWithGyro that takes a parameter: headingDegrees

in OI.java the robotbuilder generates the following for the dashboard button:

SmartDashboard.putData("TurnRobotWithGyro", new TurnRobotWithGyro());

we then add an argument:

SmartDashboard.putData("TurnRobotWithGyro", new TurnRobotWithGyro(90));

if we regenerate the code using robotbuilder, robotbuilder deletes the '90' in the constructor call. for commands that take parameters, i would very much like robotbuilder to ignore whatever is in the argument list when it regenerates the code.

Last edited by schleprock : 25-02-2016 at 19:11. Reason: better grammar
Reply With Quote
  #2   Spotlight this post!  
Unread 26-02-2016, 19:29
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: 45
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: robotbuilder overwrites parameters on commands that have parameters

RobotBuilder will create a button on the SmartDashboard for every preset for every command. So if you have a preset called 'Turn 90' that sets the parameter to 90, it will generate a button for that. It sounds like you're not creating any presets, or even setting the command to take parameters (it only generates a parameterless button on the SD if the command itself hasn't been set up to take parameters). I think it would be good to take a closer look at the Robotbuilder documentation.
__________________
WPILib
GRIP, RobotBuilder
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 08:19.

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