When you're around my motors redline.
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 04-01-2013, 12:43
sophiad68's Avatar
sophiad68 sophiad68 is offline
Registered User
AKA: Sophia Doerr
FRC #4478 (Materia Oscura)
Team Role: Student
 
Join Date: Nov 2012
Rookie Year: 2004
Location: Milford, Michigan
Posts: 3
sophiad68 is a jewel in the roughsophiad68 is a jewel in the roughsophiad68 is a jewel in the roughsophiad68 is a jewel in the rough
FRC Team 4478 Code

Hello all,
I am attaching my team’s practice code generated by Robot builder. There are two attached files; the C++ file generated by robot builder, and the Java file generated by robot builder. I would attach the Robot builder file and the wiring file, but Chief Delphi won't allow me to. The robot that was modeled with the Robot builder has a two motor drivetrain, along with a pneumatic shifter, and a manipulator with a double actuated cylinder, a navigation subsystem with two encoders and a gyro.

The pneumatic subsystem contains a compressor. We have decided to use gamepads instead of joysticks under the Operator Interface, one for the driver and one for the manipulator, and this required creating our own gamepad class, as it is not provided in the wpilib. Under commands, we have included a generic drive with gamepad command for teleoperated mode and an autonomous command for autonomous mode. We have also decided to include two commands to operate the manipulator, Cylinder In and Cylinder Out.

We also modified the Iterative Robot class for Java, so that periodic loops can follow a timer instead of the driver station packets, like C++.

RobotBuilder can be found on firstforge and I assume on http://wpilib.screestepslive.com tomorrow.
Attached Files
File Type: zip FRC4478_Cpp_2012.zip (100.5 KB, 30 views)
File Type: zip FRC4478_Java_2012.zip (253.6 KB, 62 views)
  #2   Spotlight this post!  
Unread 04-01-2013, 14:23
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: FRC Team 4478 Code

Your Java code looks very good, apart from some formatting problems (I assume from RobotBuilder). Was that all from RobotBuilder? If it is (especially your PID code), I might take a second look at it if it gives you that much functionality,
__________________
All opinions are my own.
  #3   Spotlight this post!  
Unread 04-01-2013, 18:10
David Doerr's Avatar
David Doerr David Doerr is offline
Registered User
FRC #4478 (Materia Oscura)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Milford, Michigan, USA
Posts: 75
David Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud of
Re: FRC Team 4478 Code

Quote:
Originally Posted by joelg236 View Post
...apart from some formatting problems (I assume from RobotBuilder). Was that all from RobotBuilder? If it is (especially your PID code)...
No, that was not all RobotBuilder. RobotBuilder essentially provides a shell into which you need to put the guts and we're using it as a starting point for our coding. We're primarily interested in the "Command Based" functionality - previously we've used long and ugly state machines for autonomous coding. Things like member variable names were edited to conform to the "m_" convention.

The PID code is ours and you're welcome to use it.

I'm interested to learn what the formatting problems you mentioned are. Those are probably ours, not RobotBuilder.
  #4   Spotlight this post!  
Unread 04-01-2013, 18:35
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: FRC Team 4478 Code

I saw a few comments, brackets, and other structure elements that were off-tabbed. In Netbeans, Alt-Shift-F automatically formats code structure, it performs miracles.

Another note, the m_ convention is not actually part of the Java coding conventions, but if your intention is to make things consistent from WPIlibj and your code, that's alright.
__________________
All opinions are my own.
  #5   Spotlight this post!  
Unread 04-01-2013, 20:15
sophiad68's Avatar
sophiad68 sophiad68 is offline
Registered User
AKA: Sophia Doerr
FRC #4478 (Materia Oscura)
Team Role: Student
 
Join Date: Nov 2012
Rookie Year: 2004
Location: Milford, Michigan
Posts: 3
sophiad68 is a jewel in the roughsophiad68 is a jewel in the roughsophiad68 is a jewel in the roughsophiad68 is a jewel in the rough
Re: FRC Team 4478 Code

Thanks for the information! I'll have to try that out to see if it fixes the formatting problems.
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 12:49.

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