Go to Post we have to get our robots to watch tv and drink beer. - nreynolds [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 11-01-2016, 16:34
curtis0gj curtis0gj is offline
Registered User
FRC #5033 (Beavertronics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Canada
Posts: 121
curtis0gj will become famous soon enough
Exclamation Gyroscope Programming

Howdy fellow robotic enthusiasts. I am in dire need of assistance programming our teams gyroscope. I am working with the iterative robot template and I am trying to instantiate my gyroscope. However, I always get the error, "Cannot instantiate the type Gyro." I have read that it has to do with instantiating interfaces. But I am bad at programming so I am unsure about this. Please help.

Here is a glimpse of what I am trying to accomplish.

Gyro gyro = new Gyro(1);


Last edited by curtis0gj : 11-01-2016 at 17:18.
Reply With Quote
  #2   Spotlight this post!  
Unread 11-01-2016, 17:15
curtis0gj curtis0gj is offline
Registered User
FRC #5033 (Beavertronics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Canada
Posts: 121
curtis0gj will become famous soon enough
Re: Gyroscope Programming

Quote:
Originally Posted by curtis0gj View Post
Howdy fellow robotic enthusiasts. I am in dire need of assistance programming our teams gyroscope. I am working with the iterative robot template and I am trying to instantiate my gyroscope. However, I always get the error, "Cannot instantiate the type Gyro." I have read that it has to do with instantiating interfaces. But I am bad at programming so I am unsure about this. Please help.

Here is a glimpse of what I am trying to accomplish.

Gyro gyro = new Gyro(1);

I think I have solved the error last year it was, Gyro gyro = new Gyro(1); to instantiate. This year it seems to be, AnalogGyro gyro = new AnalogGyro(1); If someone could confirm this that would be awesome.

Last edited by curtis0gj : 11-01-2016 at 17:19.
Reply With Quote
  #3   Spotlight this post!  
Unread 11-01-2016, 17:28
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,572
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Yes. See http://wpilib.screenstepslive.com/s/...e-2015-to-2016
Reply With Quote
  #4   Spotlight this post!  
Unread 11-01-2016, 17:28
rzoeller rzoeller is offline
MN GOFIRST Recruitment Officer
AKA: Ryan Zoeller
FRC #2169 (RI3D 'Snow Problem; KING TeC)
Team Role: Alumni
 
Join Date: Nov 2009
Rookie Year: 2007
Location: Savage, MN
Posts: 111
rzoeller is a jewel in the roughrzoeller is a jewel in the roughrzoeller is a jewel in the rough
Re: Gyroscope Programming

Quote:
Originally Posted by curtis0gj View Post
I think I have solved the error last year it was, Gyro gyro = new Gyro(1); to instantiate. This year it seems to be, AnalogGyro gyro = new AnalogGyro(1); If someone could confirm this that would be awesome.
Probably better to do `Gyro gyro = new AnalogGyro(1);`. You'll want to read up on interfaces and abstract classes.
__________________
Ri3D - 'Snow Problem Programmer
MN GOFIRST Recruitment Officer
FRC 2169 Alumni
Reply With Quote
  #5   Spotlight this post!  
Unread 13-01-2016, 00:17
TimTheGreat's Avatar
TimTheGreat TimTheGreat is offline
ArchdukeTim
FRC #1418 (Vae Victis)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Falls Church
Posts: 236
TimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura about
Quote:
Originally Posted by rzoeller View Post
Probably better to do `Gyro gyro = new AnalogGyro(1);`. You'll want to read up on interfaces and abstract classes.

Why is it better?
__________________
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.



2012 - Gracious Professionalism - Greater DC
2014 - Regional Finalist - Virginia | Industrial Design - Virginia | Regional Finalist - Greater DC
2015 - Innovation in Control - Greater DC
2016 - District Event Winner - VAHAY | Innovation in Control - VAHAY | District Event Winner - MDBET | Industrial Design - MDBET | District Champion - CHCMP | Innovation in Control - CHCMP
Reply With Quote
  #6   Spotlight this post!  
Unread 13-01-2016, 00:24
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Gyroscope Programming

he doesnt mean its better, the Gyro class is simply a "template" to use so all 3000 teams that use gyros dont have to make their own classes...the class you are looking for is the analogGyro
Reply With Quote
  #7   Spotlight this post!  
Unread 13-01-2016, 14:03
curtis0gj curtis0gj is offline
Registered User
FRC #5033 (Beavertronics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Canada
Posts: 121
curtis0gj will become famous soon enough
Re: Gyroscope Programming

Does anyone know where I find an example of a PID controller that turns the robot 90 degrees using the gyro. I was looking at the examples that came with the robot java development plugin and I learned a bit from the potentiometer PID example but I couldn't figure out how to apply it to the gyro.
Reply With Quote
  #8   Spotlight this post!  
Unread 27-01-2016, 16:29
techkid86's Avatar
techkid86 techkid86 is offline
Magic Programer
FRC #3044 (0xBE4)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: ballston spa
Posts: 58
techkid86 is an unknown quantity at this point
Re: Gyroscope Programming

To just turn 90 Deg, you just need to supply it to the PIDController where the encoder would normally go, as it is already a defined PID source. you would then use your drive motors as output. you would need to invert one motor, so that it turns, but that should be the extent if the mods. I'm not sure you need PID for this simple task though. It's likely easier to just stop after turning 90
__________________
"you can build a perfect machine out of imperfect parts" -Urza
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 11:54.

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