![]() |
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 |
| All times are GMT -5. The time now is 04:11. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi