|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
Re: Camera to motor setup
Acutally, I was thinking of mounting the camera on top of the turret, and setting up the motors so that it would automatically swing the turret until the camera reads 0 pan and 0 tilt without any code modification. Would that work?
|
|
#17
|
|||||
|
|||||
|
Re: Camera to motor setup
Quote:
|
|
#18
|
||||
|
||||
|
Re: Camera to motor setup
Quote:
|
|
#19
|
|||||
|
|||||
|
Re: Camera to motor setup
Look at tracking.c in the camera code provided by Kevin Watson. In the servo_track() function, it checks to see how many pixels off-center the target is. Only if it's more than Pan_Allowable_Error left or right, or Tilt_Allowable_Error up or down, does it actually move the servo to recenter the target in the camera's field of view.
So if you want to be as accurate as possible, you need to move the turret to zero the pan/tilt servo values and also cause the mx/my values returned from the camera to match the target pixel values. |
|
#20
|
||||
|
||||
|
Re: Camera to motor setup
Quote:
|
|
#21
|
|||
|
|||
|
Re: Camera to motor setup
Quote:
![]() |
|
#22
|
|||||
|
|||||
|
Re: Camera to motor setup
Did you or anyone ever get the Camera to Motor setup working?
|
|
#23
|
|||
|
|||
|
Re: Camera to motor setup
Our team used a heavily modified version of Kevin's PID code,
basically all you have to do is add another motor to the motor_info data struct, and change the get_encoder_value function so that it returns PAN_SERVO when the argument is 2 now simply call set_pos(2,127) and set your left and right drive motors to =motor_info[2].pwm+127; and 127-motor_info[3].pwm; (this may need to be change depending on your wiring and robot setup) you may have to tweak the P, I, D constants We had it working beautifully until we did some other stuff and screwed it up... (we used our own custom PID software... but i think i'm gonna switch back to kevins because i can't figure out whats wrong with ours... and I didn't write it so I don't understand it 100%) Last edited by Salik Syed : 18-02-2006 at 00:07. |
|
#24
|
||||
|
||||
|
Re: Camera to motor setup
Quote:
We don't have encoders working and it is far too late to implement them into our bot. On a side note, we did the zero point method making the servo's and motor values equal to the search value, it works beautifully when we implemented. Basically the human player controls the turret until the "find target" button is pressed. Then the camera re-aligns the turret to aim for the green. |
|
#25
|
|||
|
|||
|
Re: Camera to motor setup
Quote:
you don't need encoders, you can fake the system.... just put the camera pan servo value in place of the encoder count, the PID math is the same |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How To Use the Google Camera | generalbrando | Kit & Additional Hardware | 2 | 07-02-2006 16:00 |
| Camera pointing error? | Craig Putnam | Programming | 14 | 21-01-2006 02:52 |
| 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 |
| CMUCam2 Camera Code - Are important parts commented out? | Mr. Lim | Programming | 4 | 14-01-2005 12:11 |