Go to Post So we had forklifts in 2015 and now front end loaders in 2017. First has really embraced the industrial side of robotics. - dmorewood [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 15-02-2007, 16:21
Oumonkey's Avatar
Oumonkey Oumonkey is offline
Master of the If statement
AKA: Josh Tyus
FRC #1555 (Pulse)
Team Role: Programmer
 
Join Date: Jun 2005
Rookie Year: 2005
Location: Monon, IN
Posts: 50
Oumonkey has a spectacular aura aboutOumonkey has a spectacular aura about
CMUcam communications with motors

Hello,
I'm not sure if I worded the title very well, but its the only way I can think to word it.

I'm currently working on a way to have the CMUcam to communicate with the normal motors from when the code tells the camera to move , from saying move +/- 1 for the motor to move until it centers. I am unsure if this will work very well. I read in the "Servo Values to Degrees... How?" thread talked about making degrees from the servo values, but I don't really understand it very well. So first I was hoping some one could help explain that to me, more of where to put what.

Also, I only want the camera working in auto mode. I have found a few things in around about it, although I haven't been able to do anything the past few days due to a bad snowstorm.

Another thing I want to discuss was what other teams are doing for auto mode, and how that are making the CMUcam communicate with other parts of their robot.

I'm not to sure if most of this makes since, and if it doesn't I'm sorry, I'm not feeling the best.

Thanks for the help
Josh 1555
__________________
  #2   Spotlight this post!  
Unread 15-02-2007, 18:07
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
Re: CMUcam communications with motors

Well, if you want to use the camera to interact with the motors you are going to have to understand the code. It is not so complicated if you go through the comments. To start off, do not worry about camera.c/h. The file you really need to look at is tracking.h/c.

There are two ways you can use the camera to adjust your drive train to a specific point. Either you use the servo values when it is centered on the light, or you use the camera target values. There is no way I can go through exactly how to write this code, but good luck figuring it out. It is fun.
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
  #3   Spotlight this post!  
Unread 17-02-2007, 11:58
Oumonkey's Avatar
Oumonkey Oumonkey is offline
Master of the If statement
AKA: Josh Tyus
FRC #1555 (Pulse)
Team Role: Programmer
 
Join Date: Jun 2005
Rookie Year: 2005
Location: Monon, IN
Posts: 50
Oumonkey has a spectacular aura aboutOumonkey has a spectacular aura about
Re: CMUcam communications with motors

Well, I guess that didn't make much sense. Oh well.
I have the camera working perfectly. But I have a few problems with it communicating with the rest of the robot. I'm not sure if this would be the right place for this or not. But if I can avoid making a new thread, yay....

The robot, besides the camera, is not responding at all. I hooked up the dashboard and all pwms are 0 and pwm08, which isnt used, is 255. pwm04 to pwm 09 are not used also, but they are still 0. I am not sure if this is something electrical or not. The code I added is below. I am unable to test the code on any other robot right now. The battery is still giving power, the backup battery is still working. I haven't changed any other code besides user_rouintes.c and user_routines_fast.c. Right now i am thinking it is electrical, but I don't know.
Another thing I would like to ask is if the code below would work the way I want it to. It should be set so, if the cameras pan servo is more than 10 degrees it goes right and vice versa.

EDIT: I have just tested it again, I used a clean CMUcam s_21 and I put to lines of pwm16 = 140; and pwm15 = 114; And nothing still happens.

Thanks
Josh
1555

This code isn not copied and pasted from the original, so I may have miss typed something.
Code:
if ((((int)PAN_SERVO - 124) * 65)/124 > 10)
{
pwm16 = 140;
pwm15 = 114;
}
else if ((((int)PAN_SERVO - 124) * 65)/124 < -10)
{
pwm16 = 114;
pwm15 = 140;
}
else
{
pwm16 = 127;
pwm15 = 127;
}
__________________

Last edited by Oumonkey : 17-02-2007 at 12:28.
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
CMUCam problems with EasyC Kickoff demo code Team 562 Programming 4 14-02-2007 14:27
Interrupts with CMUCam RyanW Programming 6 08-02-2007 23:32
Problem with TTL-RS232 + CMUCam Shinigami2057 Programming 6 28-01-2007 08:47
CMUCam with EasyC gabrielse Programming 5 01-02-2006 14:28
Problems with CMUcam & LABView Daniel_H LabView and Data Acquisition 1 30-01-2006 12:07


All times are GMT -5. The time now is 00:23.

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