Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   *** CMUcam2 Frequently-Asked-Questions *** (http://www.chiefdelphi.com/forums/showthread.php?t=42742)

Alan Anderson 09-02-2006 12:32

Re: CMUcam2 Frequently-Asked-Questions
 
Quote:

Originally Posted by mallot1243
...is there a way to develope a potentiometer structure in replacement of the servo function?

Absolutely. What you want is something called PID position control. Search the forums for PID and you'll find plenty of pointers.

Briefly, you control the motor speed based on the difference between the desired and measured position (in order to move it into place), modified by the rate at which the difference is changing (in order to keep it from overshooting), with a term that pushes harder as it's out of place longer (in order to nudge it if it settles a little short of the target).

Keith Watson 09-02-2006 13:27

Re: CMUcam2 Frequently-Asked-Questions
 
Quote:

Originally Posted by bhsrobotics1671
Kevin We Need Your Help Re-Uploading the tracking.h file

Anyone!?!?!?

I haven't tried it yet but it appears to be in target.c in the function Initialize_Tracking(). Look for the call to Get_Tracking_Configuration() and see what the second parameter is used for.

nheft 09-02-2006 14:55

Re: CMUcam2 Frequently-Asked-Questions
 
We ended up using the pan servo to pan the camera, then use the data to the pan servo to run a motor that steers our turret. In effect, the turret motor keeps the camera steered to the target. When the pan servo is looking straight ahead, the turret motor stops. When the pan servo is off-center, the turret motor turns the whole business in the required direction to get pan servo looking straight ahead. If the tracker is searching rather than tracking, we disable the turret motor until the tracker acquires the target. You can test if the tracker has acquired the target by examining T_Packet_Data.my. Zero signifies searching; nonzero signifies tracking.

Quote:

Originally Posted by mallot1243
Can you use a different motor to control pan function? if so what would the code have to look like?


bhsrobotics1671 10-02-2006 00:37

Re: CMUcam2 Frequently-Asked-Questions
 
Quote:

Originally Posted by Keith Watson
I haven't tried it yet but it appears to be in target.c in the function Initialize_Tracking(). Look for the call to Get_Tracking_Configuration() and see what the second parameter is used for.


okay thanks but i need to know how to re-upload those config files to the camera...
thanks

nehalita 10-02-2006 00:46

Re: CMUcam2 Frequently-Asked-Questions
 
Quote:

Originally Posted by bhsrobotics1671
okay thanks but i need to know how to re-upload those config files to the camera...
thanks

is this what you are talking about?
Quote:

Originally Posted by readme files from the frc camera code
Do this by copying the two files to your project directory and then right clicking on "Source Files" in the
project tree, selecting "Add Files...", if necessary, navigate to the project directory and then double click on the file you need

that was in the readme file under "other files" you should check them out, they give a nice summary of all the files.

bhsrobotics1671 10-02-2006 00:50

Re: CMUcam2 Frequently-Asked-Questions
 
Quote:

Originally Posted by nehalita
is this what you are talking about?


that was in the readme file under "other files" you should check them out, they give a nice summary of all the files.


THANKS SO MUCH

we'll check it out
we got the pan to work but just not the tilt, and were not using pan i do not think..so yeah..big help

thanks!

bhsrobotics1671 10-02-2006 00:55

Re: CMUcam2 Frequently-Asked-Questions
 
Quote:

Originally Posted by nehalita
is this what you are talking about?


that was in the readme file under "other files" you should check them out, they give a nice summary of all the files.

hey side note: what program are you using to do this?

Keith Watson 10-02-2006 01:01

Re: CMUcam2 Frequently-Asked-Questions
 
Quote:

Originally Posted by bhsrobotics1671
okay thanks but i need to know how to re-upload those config files to the camera...
thanks

Previously you mentioned tracking.h. We encountered the same problem where changing values in tracking.h were not taking effect. From reading the code this appears to be the place which controls it.
Code:

*        FUNCTION:                Get_Tracking_Configuration()
*
*        PURPOSE:                Initializes the Tracking_Config_Data structure with data
*                                        stored in EEPROM. If valid data isn't present in EEPROM
*                                        or the force_default flag is set, default values from
*                                        tracking.h will be used.               
*
*        CALLED FROM:        Initialize_Tracking(), above
*
*        PARAMETERS:                Calling this function with a value greater than zero will
*                                        force it to load the configuration structure with the
*                                        default values found in tracking.h.

Were you asking about something else?

bhsrobotics1671 10-02-2006 01:10

Re: CMUcam2 Frequently-Asked-Questions
 
Quote:

Originally Posted by Keith Watson
Previously you mentioned tracking.h. We encountered the same problem where changing values in tracking.h were not taking effect. From reading the code this appears to be the place which controls it.
Code:

*        FUNCTION:                Get_Tracking_Configuration()
*
*        PURPOSE:                Initializes the Tracking_Config_Data structure with data
*                                        stored in EEPROM. If valid data isn't present in EEPROM
*                                        or the force_default flag is set, default values from
*                                        tracking.h will be used.               
*
*        CALLED FROM:        Initialize_Tracking(), above
*
*        PARAMETERS:                Calling this function with a value greater than zero will
*                                        force it to load the configuration structure with the
*                                        default values found in tracking.h.

Were you asking about something else?


ok so my programmer guy know about these files, and knows how to change the data and what to change it too, we just need to know how to re-upload these config files i guess you could call them (i.e. tracking.h traching.c) to the camera's programming, and what program you use to do this

--thanks for all your help guys

Kevin Watson 10-02-2006 01:20

Re: CMUcam2 Frequently-Asked-Questions
 
Quote:

Originally Posted by Keith Watson
Previously you mentioned tracking.h. We encountered the same problem where changing values in tracking.h were not taking effect...

You can also just select "Load default values" from either menu to get the values from the header file. Don't forget to save to EEPROM.

-Kevin

Keith Watson 10-02-2006 02:03

Re: CMUcam2 Frequently-Asked-Questions
 
Quote:

Originally Posted by bhsrobotics1671
ok so my programmer guy know about these files, and knows how to change the data and what to change it too, we just need to know how to re-upload these config files i guess you could call them (i.e. tracking.h traching.c) to the camera's programming, and what program you use to do this

--thanks for all your help guys

If your programmer is including tracking.c in your software build then nothing special needs to be done after changing the parameter I mentioned. It is contained in code that is already being run. Just do a normal rebuild and a normal download to the robot controller. This will pick up the change.

nehalita 10-02-2006 16:28

Re: CMUcam2 Frequently-Asked-Questions
 
bhsrobotics1671: We are using MPLAB IDE v7.20; it came in a cd in the kit of parts. If you go to kevin watson's website, http://kevin.org/frc, you can dl the code and everything you could possibly need is in there. then go read the FAQs and you'll avoid many mistakes you might end up making

arizonafoxx 20-01-2007 14:01

Re: *** CMUcam2 Frequently-Asked-Questions ***
 
When we tested the camera code it works perfectly. The camera will track the green light. We have our programming cable hooked up so that we get our Pan and Tilt angles displayed on the computer screen. Our question is what variable can we use from the code to take the Pan angle displayed on the computer and use it to change the position of the robot. We want to use a comparison statement like:

Psuedo Code
if(Pan_Angle > 10)
{
Turn robot left
}

if(Pan_Angle < -10)
{
Turn Robot right
}

if(Pan_Angle > -10 && Pan_Angle < 10)
{
Robot does not turn
}

We also want to do a similar thing with the tilt to calculate the distance. This is my first year with FRC but I am very familar with C programming and MPLab. I have looked through Kevin's code but I can't figure out what variable will acvhive our desired output. If anyone knows what i'm talking about please help me out.

The Vrooman 20-01-2007 17:21

Re: *** CMUcam2 Frequently-Asked-Questions ***
 
We have our camera working fine in teleoperated mode, but for some reason, we can't get it to work in autonomous mode. The red light comes on when the target is in front of the camera lens, but the camera will not actively search for a target, and it won't follow the target once we set it in position.

Is there something that needs to be added to user_routines_fast that activates the camera in autonomous?

Alan Anderson 20-01-2007 17:49

Re: *** CMUcam2 Frequently-Asked-Questions ***
 
Quote:

Originally Posted by The Vrooman (Post 561309)
Is there something that needs to be added to user_routines_fast that activates the camera in autonomous?

Indeed there is. You need to call the same CameraHandler() and ServoTrack() functions that Process_Data_From_Master_uP() does. Make sure you put them in the part of the autonomous loop that only executes once for each data packet from the OI.


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi