![]() |
How to rotate camera to target; motor to the angle of the camera
Hi i had a few quesitons that i needed help with. One of the mentor has thrown a challenge for me to make the robot do this in autonomous:
Rotate the camera(We are using Axis camera provided in 2010 season) to find circular target. Rotate the drive motors to the angle of the camera(since camera is facing the target). Dirve to target. My questions are: (1) Do i use the Rotate to target.vi provided? (2) how do i retrieve the angle and tell motor to go to that angle Need a little guidance in getting started in the basics of this problem. The rest i shall do myself :) Thanks |
Re: How to rotate camera to target; motor to the angle of the camera
My suggestion would be to start with the sample code that came with the 2010 kit. Visit the different team code routines and review what the code does versus what you think you need it to do.
Finally, dig into the Autonomous Independent. It is built upon the Rotate to Target VI, which does a portion of your task, but not the whole thing. If you have access to the robot, execute the code, make modifications, learn how to debug it to better understand what the sensors return, what values are sent to the motors, etc. Finally, feel free to ask more questions if you need to. Greg McKaskle |
Re: How to rotate camera to target; motor to the angle of the camera
1 Attachment(s)
Quote:
|
Re: How to rotate camera to target; motor to the angle of the camera
It looks like you haven't run your mandatory LabVIEW update, found here:
usfirst.org/frccontrolsystem Run that update, and then create a new project. |
Re: How to rotate camera to target; motor to the angle of the camera
I updated it and got a chance to look at the code. I have a few questions :
(1) what is a gyro? I have heard about gyro several times, but i need to know what it is to know what the code is doing :) (2) Does this rotate the camera? :s because no where in the code do i see the camera (192.168.0.90) get called. or is the gyro connected to the camera which moves it? If someone can clarify this for me it would be cool :) Whcirobotics |
Re: How to rotate camera to target; motor to the angle of the camera
A gyro tells you rate of rotation; it tells you how fast you are turning.
It is connected to an accumulator in cRIO, which continuously adds the value received from the Gyro, thus calculating the direction from the rate of rotation * time. The gyro is on the robot. The camera is on the robot. Thus, the camera turns when the robot turns. |
Re: How to rotate camera to target; motor to the angle of the camera
Quote:
whcirobotics |
Re: How to rotate camera to target; motor to the angle of the camera
Do you have the camera gimbal? One was in the kit in 09. It has one or more servo motors hinged together and mounted between the robot and camera. It allows the camera to swivel about mostly independent of the robot -- like a neck.
Greg McKaskle |
Re: How to rotate camera to target; motor to the angle of the camera
1 Attachment(s)
Quote:
I don't know about in autonomous, but one of my first programming challenges I was given last year was to program the 2009 gimbal to take input from a joystick. Figuring out a way to have the camera move on the servo, and then have the robot read the servo position and rotate to that angle would be complex, but if I get time, (and my LabView stops crashing) I will look into some sample code. For using a joystick in Teleop, just throw in a Joystick Get, use an unbundle by name, and attach it to the axes output. Run each axis to a mathematical equation box, which contains the formula (for the 2009 KoP joysticks) ((X+1)*85), then run the output to a servo set VI. IF that did not make sense, check out the picture included (Note: the example used is from a complex test code I wrote for a "super" bot, so there are lines of code all over, if you can understand it great, if not, PM me and I'll try and find a clearer pic) |
Re: How to rotate camera to target; motor to the angle of the camera
Hi sithmonkey13,
I am stuck at understanding the concept regarding tracking the target with the provided Axis Camera. my question is: What is a gryo? Is something attached to the axis camera so it can move to look for target(up, down, left, right) or does it have the capabilities already? And if it does internally have the capabilities, how do i talk to it. What is it called in the labview program? I am getting confused at how to move the camera, do i attach two servos, one that moves camera left and right, and the other up and down? and get the angle of both and set that as the angle in which the motor move? Help would be greatly appreciated :D Whcirobotics |
Re: How to rotate camera to target; motor to the angle of the camera
Quote:
However, when implemented as a sensor, it's easier to make something that tells you how fast you're turning, rather than spinning a disk and telling what direction you're facing. The cRIO takes care of converting this rate of rotation into direction. Quote:
You can control the servos with the VIs in FRC Framework > Motors and Actuators > Sevo Quote:
|
Re: How to rotate camera to target; motor to the angle of the camera
You may already be on the right track, but let me give a few clarifications.
The camera is a sensor, and all by itself, the camera cannot move the robot, it cannot move itself, and it cannot move the servo. It simply returns images. A motor will only rotate its shaft in a given direction at a given speed. A servo motor is similar, except that it is aware of where it has turned its shaft to, and will stop and hold that position. Each of these items has a set of VIs to control and communicate with in LV, and for C++ and Java, there are textual functions and classes for doing the same. The example programs and default code will show how to use the software to direct the motors, servos, cameras, gyros, and the like to do bigger tasks. Feel free to ask more detailed questions as you focus on smaller parts of the overall task. Greg McKaskle |
Re: How to rotate camera to target; motor to the angle of the camera
What is the nimbal? Please specify
Is it a part that you attach on the axis camera with has the servos which enable the Axis camera to move? |
Re: How to rotate camera to target; motor to the angle of the camera
1 Attachment(s)
Camera gimbal photo courtesy of AndyMark.
Also known as a pan-tilt assembly. |
Re: How to rotate camera to target; motor to the angle of the camera
O Goodies! I have seen this! Now i know how i am going to complete this challenge! Thnx!!!!! I will write the code right at this minute and get back to you guys if i need some help. :)
Whcirobotics |
| All times are GMT -5. The time now is 10:15. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi