Go to Post But then again, no one's robot ever is fully working to how they want it before the first tournamant. - #1Transgirl1140 [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 11-02-2005, 17:08
SeanCassidy's Avatar
SeanCassidy SeanCassidy is offline
Antiregistered User
#0263 (Aftershock)
Team Role: Programmer
 
Join Date: Oct 2003
Location: Holtsville, NY
Posts: 37
SeanCassidy is an unknown quantity at this point
Camera stops working when we use camera_set_servos()...

Ok so we're trying to make our camera pan back and forth until it sees the vision tetra, then lock and track. However it appears that whenever we call camera_set_servos() it stops searching for a color, and when we tell it to look for a color ( camera_find_color() ) it then appears to recenter the servos; we're stuck. Is there any solution to our problem?

This code block is inside Camera_Processing(), before it's own tracking routine.

Code:
  if(!tracking)
  {
    camera_set_servos(cnt,128);
    cnt += dir;
    if(cnt == 210)
      dir = -5;
    else if(cnt == 40)
      dir = 5;
    
    printf("Didn't find it: %d\r",cnt);
  }
Now, when we had it in other places using 'if(cam.conf < 60)' or something similar to track it, we had the same problem. I believe the problem with the reseting servos, is using camera_reset() in camera_find_color(). But, the real problem, IMO, is the mysterious breaking of the camera while using camera_stop() (and therefore camera_getACK(), while using camera_set_servos). I really hope it's something really silly.
  #2   Spotlight this post!  
Unread 11-02-2005, 18:18
devicenull devicenull is offline
Robot? We need a robot?
no team
 
Join Date: Sep 2004
Rookie Year: 1234
Location: n/a
Posts: 359
devicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nice
Re: Camera stops working when we use camera_set_servos()...

After you set the servos, you have to tell the camera to track again.
  #3   Spotlight this post!  
Unread 11-02-2005, 18:20
russell's Avatar
russell russell is offline
Registered User
#1430 (WRONG)
Team Role: Electrical
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Anchorage AK
Posts: 402
russell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to all
Re: Camera stops working when we use camera_set_servos()...

I have the same problem. Today I am going to try an idea proposed somewhere around here to use a left, right, and center position and spend a few seconds at each. I dont know if it will work, and assuming that the conclusion you came to (that resetting the camera centers the servos) it wont work, but its worth a try.
  #4   Spotlight this post!  
Unread 11-02-2005, 18:27
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Camera stops working when we use camera_set_servos()...

Quote:
Originally Posted by devicenull
After you set the servos, you have to tell the camera to track again.
That cause the servos to recenter though, meaning we can't pan and look for a colr at the same time, cause it keeps recentering when we tell it to look for colors. Which makes pan useless..but without it we can't see the tetras in most cases and we're against the idea of moving our robot if we can avoid it.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #5   Spotlight this post!  
Unread 11-02-2005, 18:42
russell's Avatar
russell russell is offline
Registered User
#1430 (WRONG)
Team Role: Electrical
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Anchorage AK
Posts: 402
russell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to all
Re: Camera stops working when we use camera_set_servos()...

Has anyone tried using camera_set_servos() without stopping the camera or auto servos or any of that? I know it says you can't do anything other than camera_track_update() after camera_find_color(), but has anyone tried it anyway?
  #6   Spotlight this post!  
Unread 11-02-2005, 19:01
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Camera stops working when we use camera_set_servos()...

It works, but it calls camera_stop() in camera_set_servos(), which interestingly enough makes it stop..everything, color tracking included. Without camera_stop() it jsut seizes up the camera.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #7   Spotlight this post!  
Unread 12-02-2005, 03:34
Leav's Avatar
Leav Leav is offline
Spud Gun Division
AKA: Leav Oz-Ari
FRC #3316 (D-Bug)
Team Role: Mentor
 
Join Date: Dec 2004
Rookie Year: 2005
Location: Technion, Haifa, Israel
Posts: 774
Leav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond repute
Send a message via ICQ to Leav Send a message via AIM to Leav Send a message via MSN to Leav
Re: Camera stops working when we use camera_set_servos()...

Quote:
Originally Posted by Matt Krass
It works, but it calls camera_stop() in camera_set_servos(), which interestingly enough makes it stop..everything, color tracking included. Without camera_stop() it jsut seizes up the camera.

just an idea, but.....

what if:
1)you took the pwm out on the camera, and connected that to the pwn in on the robot controller.
2)connected a pwm out from the robot controller to the servos on thecamera mount.

now all you need to do is decide on the software level when you want to track and when you want to keep panning.
Code:
if (!tracking) //if the caera isn't trying to track - pan
{
    pwm_15=cnt;
    cnt += dir;
    if(cnt >= 210)
      dir = -5;
    else if(cnt <= 40)
      dir = 5;
    
    printf("Didn't find it: %d\r",cnt);
}
else if (tracking) //if the camera is trying to track, give the servos it's values.
{
    pwm_15=pwm_in15;
}
one problem might be that the camera wouldnt know where it started, and if it needs its current location to move the servos correctly, you would need to compensate somehow:
Code:
else if (tracking) //if the camera is trying to track, give the servos it's values.
{
    pwm_15=(cnt-127)+pwm_in15; //if the camera expects to start from 127, then you need to compenstae, because it thinks it's starting at a different place.....
}
(cnt-127) gives you the offset....

just my 0.02 NIS (New Israeli Shekel)
-Leav
__________________
"We choose to build robots this season and do the other things; Not because they are easy, but because they are hard."
-Paraphrasing JFK

Participated in FIRST as a student: 2005-2006 (But still learning every season!)
Mentor: 2008 - ? (Team 2630 2008-2011, and Team 3316 since 2013)
Engineer: 2011 - ? (B.Sc. and M.Sc. in Mech. Eng. from the Technion IIT)
FIRST Volunteer - 2007 - ? (MC, FTA, FIRST Aid etc.)
  #8   Spotlight this post!  
Unread 12-02-2005, 08:43
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Camera stops working when we use camera_set_servos()...

Well as far as I am informed, the cameras servos must remain connected to the camera and the camera only, so that's out...Any other ideas?
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #9   Spotlight this post!  
Unread 12-02-2005, 11:35
Leav's Avatar
Leav Leav is offline
Spud Gun Division
AKA: Leav Oz-Ari
FRC #3316 (D-Bug)
Team Role: Mentor
 
Join Date: Dec 2004
Rookie Year: 2005
Location: Technion, Haifa, Israel
Posts: 774
Leav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond repute
Send a message via ICQ to Leav Send a message via AIM to Leav Send a message via MSN to Leav
Re: Camera stops working when we use camera_set_servos()...

says who?

is this in the rules or something? if it is, sounds like a rule meant to make it harder on us....

i'll go look this up now....
__________________
"We choose to build robots this season and do the other things; Not because they are easy, but because they are hard."
-Paraphrasing JFK

Participated in FIRST as a student: 2005-2006 (But still learning every season!)
Mentor: 2008 - ? (Team 2630 2008-2011, and Team 3316 since 2013)
Engineer: 2011 - ? (B.Sc. and M.Sc. in Mech. Eng. from the Technion IIT)
FIRST Volunteer - 2007 - ? (MC, FTA, FIRST Aid etc.)
  #10   Spotlight this post!  
Unread 12-02-2005, 12:57
Calvin Calvin is offline
Registered User
no team
 
Join Date: Feb 2005
Location: Portland OR
Posts: 105
Calvin has a spectacular aura aboutCalvin has a spectacular aura about
Re: Camera stops working when we use camera_set_servos()...

ID: 1183 Section: 5.3 Status: Answered Date Answered: 1/17/2005
Q: May we connect servos to the PWM outputs on the CMUcam to take advantage of the automatic pan and tilt control that it provides

A: Yes. Servos connected to the camera module are considered part of the camera module and can only be connected to it.

That "only," makes it sound like no.
  #11   Spotlight this post!  
Unread 12-02-2005, 18:45
Bleric's Avatar
Bleric Bleric is offline
Registered User
#0624 (CRyptonite)
Team Role: Programmer
 
Join Date: Jan 2005
Location: Houston
Posts: 19
Bleric is on a distinguished road
Send a message via AIM to Bleric Send a message via MSN to Bleric
Re: Camera stops working when we use camera_set_servos()...

So... no one has figured out how to make the camera pan back and forth to look for a color?

I'm working on the problem myself, without much success. >.< If I figure anything out, I'll let ya know, but... right now it looks like we'll just be turning the whole robot back and forth if the tetra isn't in the camera's field of vision. :
  #12   Spotlight this post!  
Unread 12-02-2005, 20:33
logicalhippo logicalhippo is offline
Registered User
AKA: Russell McClellan
#0213 (Dirty Birds)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Keene, NH
Posts: 11
logicalhippo is an unknown quantity at this point
Send a message via AIM to logicalhippo
Re: Camera stops working when we use camera_set_servos()...

Quote:
Originally Posted by Calvin
ID: 1183 Section: 5.3 Status: Answered Date Answered: 1/17/2005
Q: May we connect servos to the PWM outputs on the CMUcam to take advantage of the automatic pan and tilt control that it provides

A: Yes. Servos connected to the camera module are considered part of the camera module and can only be connected to it.

That "only," makes it sound like no.

NOPE! check out question 1480:
Q: Is it illegal to use the RC to control servos that control the camera?
A: No.
  #13   Spotlight this post!  
Unread 12-02-2005, 20:57
russell's Avatar
russell russell is offline
Registered User
#1430 (WRONG)
Team Role: Electrical
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Anchorage AK
Posts: 402
russell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to all
Re: Camera stops working when we use camera_set_servos()...

What I have been trying to do just now is something that was proposed elsewhere... foget who suggested it, but the point is this is not my own idea. But basically you plug the camera servos into the RC then set auto servos on the camera, then on the RC you check the supposed servo postions and then set the servos to those positions using the pwm outputs. It should work, but there is something wrong with my compiler. Or maybe my program. Something is wrong.
  #14   Spotlight this post!  
Unread 12-02-2005, 22:05
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: Camera stops working when we use camera_set_servos()...

We're having the same trouble. If we plugged the pan/tilt into the RC wouldn't that make the camera_auto_servo not work?
__________________
http://www.mikesorrenti.com/
  #15   Spotlight this post!  
Unread 12-02-2005, 23:34
russell's Avatar
russell russell is offline
Registered User
#1430 (WRONG)
Team Role: Electrical
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Anchorage AK
Posts: 402
russell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to all
Re: Camera stops working when we use camera_set_servos()...

I dont think so. My guess is that the autoservo function just sets the servo ports to the values it wants the servos at, and doesnt actually check to see that the servos are functioning. Then when you retrieve data from the camera it will tell you the positions the servos should be in, then you use that info to put them into those positions. It seems workable to me.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripting Setup and the Camera + Serial Port Drivers CJO Programming 22 11-01-2006 17:42
Unresponsive camera neilsonster Programming 9 17-02-2005 08:51
Camera not working when connected to robot MarkVH Programming 5 14-02-2005 15:40
Kevin Watson's Kick-off Demo Code! Mr. Lim Programming 27 22-01-2005 03:38
CMUCam2 Camera Code - Are important parts commented out? Mr. Lim Programming 4 14-01-2005 12:11


All times are GMT -5. The time now is 19:17.

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