Go to Post No one said that this would be easy. And if they did, they were obviously refering to a little red button from Staples and not to FIRST. - artdutra04 [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 17-01-2014, 21:02
gappleto97 gappleto97 is offline
Registered User
FRC #3617
 
Join Date: Oct 2013
Location: Marquette, MI
Posts: 12
gappleto97 is an unknown quantity at this point
Trouble with Command-Based coding

So, our team wants to go with command-based coding this year, since we've been going for a good four years now, but were having quite a few issues.

To start, we're using Netbeans and Java (I believe 7.0.4, but I'd need to check to be sure). My computer is windows 8, and the other one that we use is windows 7, with the files synced via google drive.

The problem we're having (for now at least) is that we can't seem to figure out how to call up the motors as a subsystem. We've even gone as far as to copy the code directly from the guide, yet for some reason it still refuses to compile properly. It continuously says errors like "class not found" and "variable cannot be resolved", despite it working in both the example, and in simple code.

Basically, I'm begging for either some sample code, or a more comprehensive guide. We should be able to figure it out from there, but we just can't seem to get off the starting line.

Thank you in advance,
The Programmers of Team Cold Logic
  #2   Spotlight this post!  
Unread 17-01-2014, 21:17
Jared's Avatar
Jared Jared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Connecticut
Posts: 602
Jared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond repute
Re: Trouble with Command-Based coding

If you're looking for example code and you have the plugins installed, you can go to file-> new project -> samples -> FRC Java -> GearsBot. The gearsbot example is a great example for command based programming. If you're still having trouble, post your code, and we can figure out what's not working.

Also, check out these videos for command based programming

http://www.youtube.com/playlist?list=PL8FF26A88C6D16C8F
  #3   Spotlight this post!  
Unread 18-01-2014, 08:01
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 582
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
Re: Trouble with Command-Based coding

You can see our previous years code at https://github.com/stevep001/roboeagles -- plenty of examples of command-based control code there. It's C++, but translateds pretty directly to Java.

Brad Miller has some videos on Youtube that have more information as well.

http://www.youtube.com/user/BradAMiller?feature=watch
__________________
2016-17 events: 10000 Lakes Regional, Northern Lights Regional, FTC Burnsville Qualifying Tournament

2011 - present · FRC 3081 Kennedy RoboEagles mentor
2013 - present · event volunteer at 10000 Lakes Regional, Northern Lights Regional, North Star Regional, Lake Superior Regional, Minnesota State Tournament, PNW District 4 Glacier Peak, MN FTC, CMP
http://twitter.com/MrRoboSteve · www.linkedin.com/in/speterson
  #4   Spotlight this post!  
Unread 19-01-2014, 00:34
gappleto97 gappleto97 is offline
Registered User
FRC #3617
 
Join Date: Oct 2013
Location: Marquette, MI
Posts: 12
gappleto97 is an unknown quantity at this point
Lightbulb Re: Trouble with Command-Based coding

(Hopefully) got it working after numerous error-fixes in their template file (I suspect my download was partially corrupted, or something equally absurd).

1) temporarily removing joystick input
2) adding numerous imports to nearly all included classes
3) refactoring CommandBase.java to deal with the actual command names
4) initiating OI class *after* ExampleSubsystem, rather than it's original position before
5) testing autonomous with motors set to 30%
6) flipping a wire
7) making methods to output joystickx and joysticky in OI class
8) testing teleopertation mode (yet to be done, waiting on belly pan replacement).

This took me, and the programmer from last year ~16 man-hours to figure out, 11 of which came from me.

Question is, is this somehow my fault? Or was it on WPI's end?
  #5   Spotlight this post!  
Unread 19-01-2014, 08:13
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Trouble with Command-Based coding

The templates are intended as just that, templates. It represents a starting point for your code where you have to add your own logic and control for your robot. A tool that might help since you are just getting started at this is RobotBuilder. It actually writes more of the boilerplate code for your commands and subsystems and there are good tutorials and examples for it.

Generic command based programming documentation in ScreenSteps:
http://wpilib.screenstepslive.com/s/...-project-files

ScreenSteps documentation on RobotBuilder:
http://wpilib.screenstepslive.com/s/3120/m/7882

Youtube video tutorial:
http://www.youtube.com/watch?v=k7PaY...lgn vhGObeKzp

Good luck with your robot!

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #6   Spotlight this post!  
Unread 19-01-2014, 17:25
gappleto97 gappleto97 is offline
Registered User
FRC #3617
 
Join Date: Oct 2013
Location: Marquette, MI
Posts: 12
gappleto97 is an unknown quantity at this point
Re: Trouble with Command-Based coding

But a template doesn't help you if the systems are initiated in ways that are known to cause errors... I mean, the OI thing is an easy fix, once you realize what's wrong, but the point is that the template shouldn't even have that error built into it.
  #7   Spotlight this post!  
Unread 19-01-2014, 19:51
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 183
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
Re: Trouble with Command-Based coding

I also would suggest using RobotBuilder - it simplifies things immensely and, from what I can tell from using C++, generates very few errors. (There were a few, but they were minor.) I assume it would be roughly the same for Java.
  #8   Spotlight this post!  
Unread 20-01-2014, 07:59
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,729
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Trouble with Command-Based coding

Here is a Java Command Based guide that our team presented at the VA FRC Workshop this past fall if you're interested. It will walk you through all of the files associated with the Command Based environment and how to write code for a drivetrain.
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: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