View Single Post
  #4   Spotlight this post!  
Unread 28-01-2013, 02:04
jmullins16's Avatar
jmullins16 jmullins16 is offline
Registered User
AKA: Jeff Mullins
FRC #2135 (Presentation Invasion)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2011
Location: San Jose, CA
Posts: 23
jmullins16 is an unknown quantity at this point
Re: Tweaks to be able to build C++ code from Robot Builder

For lack of a better place for adding RobotBuilder tweaks, I'm going to pile onto this thread. I'd love to see a dedicated forum for this since it spans Java and C++.

First, RobotBuilder is a fantastic tool, and I hope that teams--especially rookie teams--recognize the value of the software foundation that RobotBuilder can provide. Here are some C++ quirks we found (starting with version r619) that might be avoided by others:

1) Make subsystem names start with capital letters and preferably single words. We initially used lower case names (like chassis) and the default C++ code seemed to use lower case for type names which conflicted with the auto-generated instances of these types.

2) Don't bother to create a battery subsystem for analog input 8--it's already built in somewhere. An error message at runtime will tell you that you are reallocating an existing analog input.

3) When creating a PID subsystem, we got a malformed function name. It can be hand edited as a workaround (each time an export is done).

generated:
return entryShooterEncoder->PidGet();

should be:
return entryShooterEncoder->PIDGet();

4) When adding an initial default command, they must have the "requires" field set to point at the proper subsystem.

5) We were able to working generate C++ from the base .yml config file successfully, but when moving the config file to a new computer it would not generate the exact same set of code. The #include line in subsystems that have an initial default command would not be inserted. Probably due to the fact that that the #include line is outside of the auto-generation markers. In order to work around this, the #includes need to be entered manually (or just copy the exported source code instead of the .yml file).

I will try to enter these on the first forge project for RobotBuilder. Note that the current version is now r623.

Jeff