Go to Post My opinion doesn't matter at inspection. - DonRotolo [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-01-2016, 12:39
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
Is RobotBuilder Broken [JAVA issues]

While readying myself with the new features of Robotbuilder to teach the programming students I have ran into some new issues.

1. I added a Constant to my Subsystem. I forgot to give it a value [errors in eclipse Mars]. When I corrected the error in Robot builder and regenerated code the values did not appear. I tried to add a new Constant and regenerate Java code it did not appear. I created a new command and it DID appear so I know the Preferences>General>Workspace>Refresh using native hooks or polling is correct.

A. Seems Robot builder is not rebuilding the Constants code on code Regenerate.
B. Robot builder should test these fields to assure they are populated before Code generation. Like it dose for IO port conflicts.

2. I was testing a hobby servo. I named my subsystem "Servo" = !BAD and the actuator "Servo" too. It understandably error because Eclipse did didn't know what Servo class to use edu.wpi.first.wpilibj.Servo or my Prodject Servo class.

C. Robot builder should test user names (Commands, Subsystems, IO devices) to assure they don't match edu.wpi.first.wpilibj classes and other common Java classes.
  #2   Spotlight this post!  
Unread 14-01-2016, 18:44
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: Is RobotBuilder Broken [JAVA issues]

Add button to smart dashboard not working as well. I have to manually add the code
  #3   Spotlight this post!  
Unread 14-01-2016, 19:05
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: 80
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: Is RobotBuilder Broken [JAVA issues]

Quote:
Originally Posted by cpapplefamily View Post
While readying myself with the new features of Robotbuilder to teach the programming students I have ran into some new issues.

1. I added a Constant to my Subsystem. I forgot to give it a value [errors in eclipse Mars]. When I corrected the error in Robot builder and regenerated code the values did not appear. I tried to add a new Constant and regenerate Java code it did not appear. I created a new command and it DID appear so I know the Preferences>General>Workspace>Refresh using native hooks or polling is correct.

A. Seems Robot builder is not rebuilding the Constants code on code Regenerate.
B. Robot builder should test these fields to assure they are populated before Code generation. Like it dose for IO port conflicts.

2. I was testing a hobby servo. I named my subsystem "Servo" = !BAD and the actuator "Servo" too. It understandably error because Eclipse did didn't know what Servo class to use edu.wpi.first.wpilibj.Servo or my Prodject Servo class.

C. Robot builder should test user names (Commands, Subsystems, IO devices) to assure they don't match edu.wpi.first.wpilibj classes and other common Java classes.
1. This will be fixed in the next update

2. The assumption here is that programmers should know that certain names will already be used by parts of WPILib or the Java standard libraries. This may get added in the future, but it's fairly low priority.

Quote:
Originally Posted by cpapplefamily View Post
Add button to smart dashboard not working as well. I have to manually add the code
Do you have parameter presets? If a command takes parameters, a button will be generated for each preset. If it doesn't, that's a bug
__________________
WPILib
GRIP, RobotBuilder

Last edited by SamCarlberg : 14-01-2016 at 19:16.
  #4   Spotlight this post!  
Unread 16-01-2016, 17:44
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: Is RobotBuilder Broken [JAVA issues]

Quote:
Originally Posted by SamCarlberg View Post

Do you have parameter presets? If a command takes parameters, a button will be generated for each preset. If it doesn't, that's a bug
No I did not have presets. This maybe why the buttons did not generate.


I have been testing the update and the issues I have expressed are fixed. Found a new one.

When adding a parameter to a command the private double m_? does not generate if the command already has been created.
ie.
1 create "my Command" with parameter a,b and presets 0,1
2 The myCommand is created with private double m_a; and m_b;.
Code:
public class myCommand extends Command {

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS
    private double m_a;
    private double m_b;
 
    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR
    public myCommand(double a, double b) {

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING
        m_a = a;
        m_b = b;

        // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
    }
3 The IO class created a new smartdashboard item adding the button with presets 0,1
Code:
SmartDashboard.putData("my Command: pre", new myCommand(0,1));
4 add a parameter to myCommand in robot builder [c] and a value to the presets for it [2]
5 The myCommand in eclipse does not add the private double m_c;
Still=
Code:
public class myCommand extends Command {

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS
    private double m_a;
    private double m_b;
 
    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR
    public myCommand(double a, double b) {

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING
        m_a = a;
        m_b = b;

        // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
    }
6 the IO class DOES have the preset added to the smartdashboard entery [0,1,2] but is errored because myCommand only has 2 parameters.
Code:
SmartDashboard.putData("my Command: pre", new myCommand(0,1,2));
Closed Thread


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 03:01.

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