![]() |
CMUCam and autonomous code
How do you interface the streamlined version of Kevin's CMUCam code with the default code? I understand that you change the position o fthe robot as a whole based upon the pulses you send to the camera's servos, but how or where do you put the camera code into the default code?
|
Re: CMUCam and autonomous code
The default code, from what I understood, focuses on giving you the simplest code to control your robot. It doesn't include other components except those related to the "cart".
Kevin's CMU code takes the default code and adds the camera functions and varibles so you can use them to work on targeting the lights on the rack and using the functions and varibles to do things around the arena(such as going to the spiders). I'm affraid that using the default code with the camera won't be possible(you'll be controling the tilt of the camera with the Y axis of your joysticks :p ). You shouldn't have any problem at all using codes you've written in the default code(and those that actuall worked) and transfer them to the CMU code. The CMU code is there to give your more options. Hope I helped and good luck! :D |
Re: CMUCam and autonomous code
Quote:
Then, when you have the robot running manually and the camera still tracking the light at the same time, you can start getting fancy with software to run the robot automatically based on what the camera is telling you. |
Re: CMUCam and autonomous code
I have a question. Do I need to measure the degree angle of the camera (pan/tilt) and do I need to use it in order to allow the robot to move itself during manual routines?
if (get_tracking_state() == CAMERA_ON_TARGET) { set pwm values; } Would that work? Might I put this in Process_Data_From_Master_uP? |
Re: CMUCam and autonomous code
Also, I'd need to calculate the distance to the light in order to stop the pwm's? (if so...I know the formula, but how the heck to I get it to work? I don't even know where to begin for that):)
|
Re: CMUCam and autonomous code
Well, you asked me to answer like this, so my answer is yes. :D
|
Re: CMUCam and autonomous code
Cool. :cool: Now I see that the camera code is just kind of inserted into the default code. How convenient, no?:)
|
Re: CMUCam and autonomous code
Yep, just one thing, you'll need to commnet/uncomment some code lines in the camera code in order to use some of the default code stuff, such as the engines. It's more of where exactly you call the functions. Don't worry, if something doesn't work in your code(and it was compiled succesfuly) it probablly means that you need to change the place where you call the code lines or functions.
Really, it's no big deal. :) |
Re: CMUCam and autonomous code
yeah, i heard about uncommenting some functin like "default_routine()" or something like that and change something with PWM01 and PWM02. What exactly is that that because it confused me, and it didn't work. :confused:
|
Re: CMUCam and autonomous code
Uncomment Default_Routine() and comment pwm01 = p1_y and pwm02 = p2_y.
|
Re: CMUCam and autonomous code
Quote:
|
Re: CMUCam and autonomous code
I kind of figured that, but it didn't work. the good thing is, it doesn't matter anyway. I need to know how to work the camera from autonomous code.
Demothesis |
Re: CMUCam and autonomous code
Quote:
|
Re: CMUCam and autonomous code
Camera_Handler() * ;)
|
Re: CMUCam and autonomous code
Okay, camera_handler() and not servo_track()? Is there any other special code that I have to write or work around in order to use the PWMs in autonomous mode? If so, will it conflict with the values mapped to the camera PWMs?:o
Demothesis |
Re: CMUCam and autonomous code
Please help me, I can't figure out how to use the camera to actually MOVE the robot. I have the camera code working along with the camera itself, but how do I move pwm01 (left drive wheel) and pwm02 (right drive wheel) individually according to the pan of the camera? I have no idea where to begin with this code. (I just got the code to work for the camera and I've been trying for weeks. Now I only have 2 days, Please help if you can)
|
Re: CMUCam and autonomous code
Quote:
In theory, all you need to do is write some software to read the camera tracking information and control the motors the same way you would do it with your hands. The details are up to you. |
Re: CMUCam and autonomous code
Here's what I have so far
Code:
Code:
unsigned int Find_Distance(void)Code:
const rom unsigned int targetRange[] =Code:
if((Get_Tracking_State() == CAMERA_ON_TARGET) || (Get_Tracking_State() == TARGET_IN_VIEW)) |
Re: CMUCam and autonomous code
by the way...pwm01_On_Off maps pwm01 to the p1_y joystick. (same with 2) So if its 1, it maps it so the joystick functions. If its not 1 then the joystick cannot function so the camera will take control of pwm01 and pwm02.
|
Re: CMUCam and autonomous code
you just need to tighten up the code a bit
|
| All times are GMT -5. The time now is 00:24. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi