Go to Post The manual can be compared to a textbook in school. If you choose not to use your textbook, you are asking to fail classes. - dez250 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 23-01-2010, 14:23
Steve Warner Steve Warner is offline
Controls / Programming
FRC #0234 (Cyber Blue)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Indiana
Posts: 41
Steve Warner is an unknown quantity at this point
Camera using IterativeRobot class

Has anybody converted the 2010 Image Demo from the SimpleRobot class to the IterativeRobot class? How did you define the camera so it's not local to only the function it's defined in and therefore lost between iterations? The AxisCamera class seems to work differently from all the other WPILib classes.
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2010, 17:49
Steve Warner Steve Warner is offline
Controls / Programming
FRC #0234 (Cyber Blue)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Indiana
Posts: 41
Steve Warner is an unknown quantity at this point
Re: Camera using IterativeRobot class

I think I have an answer to my own question if anyone is interested. The line

AxisCamera &camera = AxisCamera::getInstance

can be put into a function and called repeatedly. The first time it's called it creates a pointer to the camera object and starts the camera app. After that it just returns the same pointer. Seems to works okay.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-01-2010, 21:47
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Camera using IterativeRobot class

Quote:
Originally Posted by Steve Warner View Post
Has anybody converted the 2010 Image Demo from the SimpleRobot class to the IterativeRobot class? How did you define the camera so it's not local to only the function it's defined in and therefore lost between iterations? The AxisCamera class seems to work differently from all the other WPILib classes.
Declare a pointer in your IterativeRobot class:

Code:
AxisCamera * camera;
Then in your IterativeRobot constructor call:

Code:
camera = &(AxisCamera::GetInstance());
Use the dereference arrow -> instead of periods when calling camera methods.

Code above is from memory, so it may not work if you cut/paste, but hopefully it will help!
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem using the camera. Teh1337Bix Programming 14 21-01-2010 19:52
Is anyone using the Camera? GillSt.Bernards General Forum 19 05-03-2009 21:52
IterativeRobot Race Condition Dave Scheck C/C++ 1 14-02-2009 22:55
using servos with camera team877 Programming 2 01-02-2007 21:26
Using camera PWM out Cuog Programming 2 28-11-2005 14:17


All times are GMT -5. The time now is 12:13.

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