Go to Post when things start to get a little stressful, "FIRST: Fun Is Required. So Tolerate!" - Rich Kressly [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 19-01-2012, 14:31
nileshp87 nileshp87 is offline
The Infamous nileshp87
no team
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Kent, CT
Posts: 15
nileshp87 is a jewel in the roughnileshp87 is a jewel in the roughnileshp87 is a jewel in the roughnileshp87 is a jewel in the rough
Lightbulb Our Algorithm\Idea for Target tracking

So, let me preface this by saying that I think this sounds near ridiculous, but for some reason makes logical sense if you sit and think about it. If you have any criticisms\ideas please let us know because its a very uncommon idea.

So, the first thing we decided was that we had to somehow shoot the ball into the hoop. This is a simple kinematic formula, and everything can be calculated if you view each side as a Cartesian plane. If you know your position non the field you can figure out where to aim. We are going to cross the barrier by hitting it with wheels, so using a z accelerometer and a boolean we will keep track of which side of the field we are on.

If the robot is facing the hoop on the starting side of the field we let the point 0,0 be in the left corner on the hoop wall.

Sensors we use:
1 ultrasonic on the midpoints of each side of the robot, and 2 more on the back corners of the robot facing backwards for a total of 6 ultrasonics.
3 encoders, 2 on the driving toughboxes, and 1 on the turretting wheel that angles the shooter left and right.
1 gyro and 1 accelerometer.
3 touch sensors for detecting the number of balls in our clip.

Getting initial position:
drive backwards and detect the distance difference between the back left and back right distance sensors to grab initial angle.
rotate to 0 degrees, and 27 - back distance gives y location
drive backwards while continuously checking if the right + left + width of the robot add up to 27. if they do that is the x value.

Keeping track of position:
constantly check if the robot position can be worked out using the distance sensors with trig\distance sensors. When it can't be use gyro value.
Double integrate the acceleration to get distance in each direction while the values from the distance sensors don't give proper values (since other robots can get in the way).
Keep track of the side using the z-axis accelerometer, and finding what value it has to hit.
Encoders can compare distance traveled to get the angle and distance to compare with accelerometer (least trusted value though because robot can slide\be pushed).

We have also considered using 2 accelerometers and gyros to ensure we are getting good values.

Any input on the feasability of this idea?

We are programming in Java.
Reply With Quote
  #2   Spotlight this post!  
Unread 19-01-2012, 23:00
JewishDan18's Avatar
JewishDan18 JewishDan18 is offline
Registered User
FRC #1700
Team Role: Engineer
 
Join Date: Feb 2009
Rookie Year: 2007
Location: Sunnyvale, CA
Posts: 185
JewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to behold
Re: Our Algorithm\Idea for Target tracking

One issue with this is the accelrometer. it is very very noisy for the non-gravity components of the vector it gives you. Also, if anything gets between your ultrasonics and the walls, it will mess up your numbers. I would recommend tracking the targets via the camera, it will be a lot less error prone and most likely easier to get working
Reply With Quote
  #3   Spotlight this post!  
Unread 19-01-2012, 23:19
Patrickwhite's Avatar
Patrickwhite Patrickwhite is offline
May the North be with you
FRC #0610 (The Coyotes)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Toronto
Posts: 88
Patrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of light
Re: Our Algorithm\Idea for Target tracking

I would tend to agree with Dan on this one - knowing where your robot is at all times is extremely hard to pull off, especially because of the error inherent in all of the sensors.

Even if your error were almost negligible, as the match went on, your calculated position would be more and more off from your true position - the drift would accumulate, and you don't have time to recalibrate mid-match.
__________________
while(!going.isTough());
tough.exit();

What will we do tonight, Warfa?
The same thing we do every night, Patrick. Sit and wait for Electrical.
Reply With Quote
  #4   Spotlight this post!  
Unread 20-01-2012, 00:24
nileshp87 nileshp87 is offline
The Infamous nileshp87
no team
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Kent, CT
Posts: 15
nileshp87 is a jewel in the roughnileshp87 is a jewel in the roughnileshp87 is a jewel in the roughnileshp87 is a jewel in the rough
Re: Our Algorithm\Idea for Target tracking

Yeah so we realized those problems and when we wrote the pseudo code we have stuff to compensate.

Let front ultrasonic sensor be a, right sensor be b, rear c, right d.

Since each half of the field is a square, a+c+length=b+d+width

Can be used to validate our data. Accelerometer is used whenever the data from the ultrasonics is invalid.

Similarly, when that is true the robot angle is equal to 90-arcsin(27/(a+c))

I imagine it like having your eyes closes and navigating. Whenever the data validates it is like opening your eyes for a second.
Reply With Quote
  #5   Spotlight this post!  
Unread 20-01-2012, 00:35
JewishDan18's Avatar
JewishDan18 JewishDan18 is offline
Registered User
FRC #1700
Team Role: Engineer
 
Join Date: Feb 2009
Rookie Year: 2007
Location: Sunnyvale, CA
Posts: 185
JewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to behold
Re: Our Algorithm\Idea for Target tracking

I've tried using the accelrometer a couple of years ago just for this purpose, and I can tell you that the noise will far exceed any change caused by movement. But, if you are set on it, you should research some better methods for double integration; the traditional method has way too much error on its own.

https://en.wikipedia.org/wiki/Simpson%27s_rule
https://en.wikipedia.org/wiki/Gaussian_quadrature

The idea is to use a polynomial to approximate the function, rather than a flat rectangle or trapazoid as one learns in high school calculus. If you have any questions, I can help. I don't see the accelerometer working without something like this, since the error for the integration alone will be too high, let alone error from the reading (it is only meant to tell you the direction of gravity, nothing more!)


Also, the mentor on my team who deals with such things has had trouble getting the kit ultrasonic sensors to go more than ~20 feet, iirc. You will need to find some high quality ones for that to work.
Reply With Quote
  #6   Spotlight this post!  
Unread 20-01-2012, 07:44
nileshp87 nileshp87 is offline
The Infamous nileshp87
no team
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Kent, CT
Posts: 15
nileshp87 is a jewel in the roughnileshp87 is a jewel in the roughnileshp87 is a jewel in the roughnileshp87 is a jewel in the rough
Re: Our Algorithm\Idea for Target tracking

By no means do I have my heart set on this method. Has anyone gotten the camera working from ~30ft? (with detection of angle and distance?). Is there any way I can measure or see the issues with the accelerometer?
Reply With Quote
  #7   Spotlight this post!  
Unread 20-01-2012, 11:13
Bryscus's Avatar
Bryscus Bryscus is offline
EE, CpE
AKA: Bryce B.
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 1999
Location: Jupiter, FL
Posts: 173
Bryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud of
Re: Our Algorithm\Idea for Target tracking

Quote:
Originally Posted by nileshp87 View Post
By no means do I have my heart set on this method. Has anyone gotten the camera working from ~30ft? (with detection of angle and distance?). Is there any way I can measure or see the issues with the accelerometer?
If you want to measure distance from 30ft, you could track the two center rectangles. To center the image, you could take the average of the x-axis centers of mass for the two rectangles. To measure distance, you can measure the difference between the center's of mass since the distance between the two rectangles is constant (they'll be closer together at farther distances and farther apart at closer distances).

This might be relatively accurate if you're in the center of the field (middle of 27ft) or just a few feet from center. However, you will probably have distance and centering errors when you get too far off center.

If you are only varying the angle of your ball shooter, you probably won't find a shooter speed that works at both close and far distances (at least not for consistency I would think). You could also potentially vary the firing speed and keep a constant firing angle.

- Bryce
__________________
The opulence of the front office decor varies inversely with the fundamental solvency of the firm.
Reply With Quote
  #8   Spotlight this post!  
Unread 20-01-2012, 12:48
nileshp87 nileshp87 is offline
The Infamous nileshp87
no team
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Kent, CT
Posts: 15
nileshp87 is a jewel in the roughnileshp87 is a jewel in the roughnileshp87 is a jewel in the roughnileshp87 is a jewel in the rough
Re: Our Algorithm\Idea for Target tracking

I would imagine that the vision tracking would have difficulty when it is off center. If it is off center the robot would appear to be farther away.

So, there is no currently known way of tracking the center upper hoop from any point on the field?
Reply With Quote
  #9   Spotlight this post!  
Unread 20-01-2012, 17:09
JewishDan18's Avatar
JewishDan18 JewishDan18 is offline
Registered User
FRC #1700
Team Role: Engineer
 
Join Date: Feb 2009
Rookie Year: 2007
Location: Sunnyvale, CA
Posts: 185
JewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to behold
Re: Our Algorithm\Idea for Target tracking

My code finds the position of the robot and its orientation from a single target, at any position on the field. I am working on multiple target tracking, which will be more accurate.
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


All times are GMT -5. The time now is 09:56.

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