![]() |
Where do I begin to get the robot to move using the camera?
This is what I have? I haven't done anything with turning the robot to the correct degree, I'm not very good at this stuff and I'm the only programmer and electrician on the whole team of 5, so i'd really like some help. Here is what I have for this:
Code:
if(Get_Camera_State() == 1) |
Re: Where do I begin to get the robot to move using the camera?
I know what it feels like to work so many roles. I'm the eletriction, programming, and website guy on our team. Let's see if I can help you any:
Have you tested your code at all or are you just trying this out? I have found that the CAMERA_ON_TARGET state doesn't work to well. Even if the camera has located the target and its pointing directly at the target, it will modulate and will toggle off and on within state which won't even turn on a relay. Do something like: Code:
if(Get_Camera_State()) The switch leds are really unessicary. Those turn on LEDs on the OI when the camera is on target. I took then out because we won't be looking down too much during the game. When you start getting down to coding the specifics of the routine, post again and we'll help. |
Re: Where do I begin to get the robot to move using the camera?
Thanks. I'm getting an error report though
Code:
if(Get_Camera_State())Code:
unsigned int Find_Distance(void)Code:
C:\USFIRST\frc_camera_s_21\CAMERA CODE\user_routines.c:254:Warning [2058] call of function without prototypeWhat's wrong? |
Re: Where do I begin to get the robot to move using the camera?
Quote:
|
Re: Where do I begin to get the robot to move using the camera?
Tracking.h is already in there. It still says the prototype error thing on those lines.
|
Re: Where do I begin to get the robot to move using the camera?
Here's your problem you need to add a declaration of the function at the top of your user_routines_fast.c (or what ever file is running the camera code).
At the top below the includes add: unsigned int Find_Distance; and you should be fine. If that errors out just incase try this: unsigned int Find_Distance(void); |
Re: Where do I begin to get the robot to move using the camera?
It compiles now, I've changed some things here and there, but the robot wont move. I think I'm doing something completely wrong with the code. Check out this forum if you can help me out. http://www.chiefdelphi.com/forums/sh...t=53916&page=2
|
Re: Where do I begin to get the robot to move using the camera?
Make sure there isn't a call to the joystick values after the code. The default code calls Default_Routine(). So make sure that is still commented out, and any mapping of the joystick values is done before the camera tracking.
It all goes in order, so if you set a value for the motor speed after locking on, and then later in the function, go and overwrite the value with your joystick, its going to be assigned the joystick in the end of the loop. Yes, no? |
Re: Where do I begin to get the robot to move using the camera?
Thanks. I made these changes, hopefully it will work:
At the top of user_Routines.c I declared this Code:
int pwm03_On_Off = 1;Code:
if(pwm03_On_Off == 1)Code:
if((pwm03 < 125) || (pwm03 > 129)) //if py_3 is being used (forklift going up or down)This is all still in Default_Routine() Code:
last = now; |
Re: Where do I begin to get the robot to move using the camera?
That won't work because the next time around the fork lift is going to be reconnected to the joystick.
This does not do what you think it does: pwm03 != p1_y; Lets say p1_y is equal to 200 at the moment, so we have pwm03 != 200; Which means pwm03 is going to be set to 0 (for the moment). You will need an if or switch statement for your joystick. Also you might want to put a \r\n in your print statements. Keep up the good work!! Jason |
Re: Where do I begin to get the robot to move using the camera?
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)
Code:
Code:
unsigned int Find_Distance(void)Code:
const rom unsigned int targetRange[] = |
| All times are GMT -5. The time now is 19:11. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi