Go to Post I was on the same plane as 365 returning from Atlanta to Philadelphia last year. The whole rear half of the plane was neon green. - Lil' Lavery [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-02-2014, 18:22
CarrotBlasphemy's Avatar
CarrotBlasphemy CarrotBlasphemy is offline
Registered User
FRC #4226
 
Join Date: Feb 2014
Rookie Year: 2012
Location: Albany, MN
Posts: 9
CarrotBlasphemy is an unknown quantity at this point
Vision code in separate class?

I downloaded the sample vision code project and copied the main file into my preexisting project. Whenever I attempt to create a new `VisionCode vision=new VisionCode();` and try to run it, it says "network tables has already been initialized" and the program halts. Is there a way to cleanly keep the vision code in a separate file and call it from my main one? This is my first year as programmer and our team's first year trying vision code

Thanks!
Reply With Quote
  #2   Spotlight this post!  
Unread 11-02-2014, 18:32
irvingc irvingc is offline
Registered User
FRC #0948 (Newport Robotics Group)
Team Role: Leadership
 
Join Date: Jan 2014
Rookie Year: 2011
Location: Bellevue, WA
Posts: 31
irvingc is on a distinguished road
Re: Vision code in separate class?

The issue is probably that your VisionCode class still extends the SimpleRobot class. This is a problem because the default RobotBase constructor (from which SimpleRobot extends) is where NetworkTable initialization is conducted. You need to change your VisionCode class not to extend SimpleRobot. Depending on how familiar you are with Java, this might not be so straightforward. Is there a reason you can't just modify the VisionSampleProject robot code to fit your needs?
Reply With Quote
  #3   Spotlight this post!  
Unread 11-02-2014, 20:39
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: Vision code in separate class?

Are you using robot builder? We wound up creating a subsystem called "HotCamera" in which we added an initialize method and an isHot method. I personally like this design, because any commands requiring the camera can then reserve it.
__________________
"Never let your schooling interfere with your education" -Mark Twain
Reply With Quote
  #4   Spotlight this post!  
Unread 11-02-2014, 21:23
CarrotBlasphemy's Avatar
CarrotBlasphemy CarrotBlasphemy is offline
Registered User
FRC #4226
 
Join Date: Feb 2014
Rookie Year: 2012
Location: Albany, MN
Posts: 9
CarrotBlasphemy is an unknown quantity at this point
Thanks so much! Removing the `extends SimpleRobot` did the trick! I'll have to hack at the code to try to get it down to something as simple as an init and isHot but I'm a step closer than this afternoon!
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 09:31.

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