Go to Post note: spelling, punctuation and good grammar are your friends - use them and enjoy the benefits of legible, understandable prose - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-11-2010, 18:22
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
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
Reply With Quote
  #2   Spotlight this post!  
Unread 08-11-2010, 19:09
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
  #3   Spotlight this post!  
Unread 08-11-2010, 19:48
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Re: How to rotate camera to target; motor to the angle of the camera

Quote:
Originally Posted by Greg McKaskle View Post
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.

Greg McKaskle
What aspects are built in? Because the only thing i see for when i open autonomus independent.vi is only moving the bot. Picture is below of what i get when i open the built in autonomus independent.
Attached Files
File Type: doc autonomus.doc (89.0 KB, 44 views)
Reply With Quote
  #4   Spotlight this post!  
Unread 08-11-2010, 20:59
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
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.
__________________
-- Marshal Horn
Reply With Quote
  #5   Spotlight this post!  
Unread 08-11-2010, 22:40
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
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
Reply With Quote
  #6   Spotlight this post!  
Unread 08-11-2010, 23:47
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
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.
__________________
-- Marshal Horn
Reply With Quote
  #7   Spotlight this post!  
Unread 09-11-2010, 07:45
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Re: How to rotate camera to target; motor to the angle of the camera

Quote:
Originally Posted by kamocat View Post

The gyro is on the robot. The camera is on the robot. Thus, the camera turns when the robot turns.
Is there a way to move the camera first .. make it look for the target. as soon as it finds it, turn the robot to the direction which the camera is lookiing,(which would be target)?

whcirobotics
Reply With Quote
  #8   Spotlight this post!  
Unread 09-11-2010, 08:14
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
  #9   Spotlight this post!  
Unread 09-11-2010, 21:20
sithmonkey13's Avatar
sithmonkey13 sithmonkey13 is offline
Registered User
AKA: Nathan
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: St. Louis
Posts: 70
sithmonkey13 is a name known to allsithmonkey13 is a name known to allsithmonkey13 is a name known to allsithmonkey13 is a name known to allsithmonkey13 is a name known to allsithmonkey13 is a name known to all
Re: How to rotate camera to target; motor to the angle of the camera

Quote:
Originally Posted by whcirobotics View Post
Is there a way to move the camera first .. make it look for the target. as soon as it finds it, turn the robot to the direction which the camera is lookiing,(which would be target)?

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)
Attached Thumbnails
Click image for larger version

Name:	Joystick to Servo VI.1.JPG
Views:	53
Size:	118.7 KB
ID:	9417  
Reply With Quote
  #10   Spotlight this post!  
Unread 10-11-2010, 17:28
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
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

Whcirobotics
Reply With Quote
  #11   Spotlight this post!  
Unread 10-11-2010, 18:02
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: How to rotate camera to target; motor to the angle of the camera

Quote:
Originally Posted by whcirobotics View Post
What is a gryo?
"gyro" is an abbreviation for gyroscope.
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:
Originally Posted by whcirobotics View Post
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?
This is the gimbal that comes in the FRC kit of parts. It uses two servos; one for pan (side to side) and one for tilt (up and down).
You can control the servos with the VIs in FRC Framework > Motors and Actuators > Sevo

Quote:
Originally Posted by whcirobotics View Post
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?
Yes.
__________________
-- Marshal Horn

Last edited by kamocat : 10-11-2010 at 18:05.
Reply With Quote
  #12   Spotlight this post!  
Unread 10-11-2010, 20:06
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
  #13   Spotlight this post!  
Unread 10-11-2010, 21:36
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
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?

Last edited by whcirobotics : 10-11-2010 at 21:42.
Reply With Quote
  #14   Spotlight this post!  
Unread 10-11-2010, 21:54
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: How to rotate camera to target; motor to the angle of the camera

Camera gimbal photo courtesy of AndyMark.
Also known as a pan-tilt assembly.
Attached Thumbnails
Click image for larger version

Name:	CameraGimbal.jpg
Views:	26
Size:	70.6 KB
ID:	9418  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #15   Spotlight this post!  
Unread 10-11-2010, 21:57
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
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
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to rotate camera to target; motor to the angle of the camera whcirobotics NI LabVIEW 0 08-11-2010 18:18
How to get the camera to show images on the dashboard? whcirobotics NI LabVIEW 38 20-02-2010 11:55
How to make the camera search the light instead of only follow when targeted? jesusescobar Programming 4 18-02-2007 16:56
How do I get distance between Camera and the target? sjung9442 Programming 5 27-01-2006 09:44
How is everyone setting the angle for the shooter/camera? waialua359 Programming 6 26-01-2006 21:51


All times are GMT -5. The time now is 21:19.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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