View unanswered posts | View active topics It is currently Mon Oct 20, 2014 6:30 pm






Reply to topic  [ 9 posts ] 
Get distance from IR sensor 
Author Message
Rookie

Joined: Mon Sep 19, 2011 5:25 pm
Posts: 3
Post Get distance from IR sensor
Hello all,

From my understanding, the Hitechnic IR Sensor V2 uses five different IR-receiving panels to get an angle based on signal strength. It seems, then, that there should also be a way to get the approximate distance to the beacon, or at least the approximate signal strength, which could then be calibrated to a standard measurement. Is there a way to do this?

I would like to be able to approximate my position on the FTC playing field, which I could do by knowing the approximate angle to a given beacon (which I can get), which beacon it is (which I can probably track) and the approximate distance to the beacon.

Edit
I have recently come across a set of non-ROBOTC native driver files made by Xander and hosted at HiTechnic. Are these the files I need to use? Would the function, then, be
Code:
HTIRS2readAllDCStrength(tSensors, int&, int&, int&, int&, intr&)
? Could someone give me an example of how to do this?

Thanks!

WC


Tue Dec 06, 2011 11:49 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Get distance from IR sensor
You can already read the strength of all 5 IR sensors in the IR seeker. Refer to the HTIRS2readAllACStrength function in Xander's driver suite. You can interpret the data however way you want. But in my opinion, you won't get very reliable distance information from the data. There are many factors affecting the IR signal strength. With careful calibration on the particular competition field before each competition, you may be able to approximate the distance. I did not experiment with this idea but I would expect the signal strength is inversely proportional to the square of the distance (if you need to translate the signal strength to distance). I would be interested in your finding if you decided to experiment with it.


Wed Dec 07, 2011 1:57 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Re: Get distance from IR sensor
Examples on how to use that function are in the HTIRS2-test*.c programs. The IRS sensor is not suitable to accurately determine distance. You can only get an indication, nothing more.
You can always download the latest version of the driver suite here: [LINK].

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Dec 07, 2011 2:48 am
Profile WWW
Rookie

Joined: Mon Sep 19, 2011 5:25 pm
Posts: 3
Post Re: Get distance from IR sensor
Okay, thanks. I was just confirming that I need to use the custom drivers. They were easy to install though, and they work great - thanks Xander!

MHTS, if I get something working I will let you know. Today I got the robot to slow down as it reaches its target, so it's a step. :)

Thanks again everyone.

WC


Thu Dec 08, 2011 3:49 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Get distance from IR sensor
We used two IR seekers on our robot to do triangulation. We also have a sonar sensor so we could use that for accurate distance measurement.


Thu Dec 08, 2011 4:20 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Re: Get distance from IR sensor
Quote:
We also have a sonar sensor so we could use that for accurate distance measurement.

Surely that should read:
Quote:
We also have a sonar sensor so we could use that for "accurate" distance measurement.

?
To call the sonar sensor accurate would be an inaccuracy in itself.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Dec 08, 2011 7:52 am
Profile WWW
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Get distance from IR sensor
Sorry for the slight off-topic, but does anyone know why the sonar sensor is so bad? Usually, the NXT sensors are much better than those offered by VEX. In this case however, the VEX ultrasonics do a fantastic job by comparison.

_________________
sudo rm -rf /


Thu Dec 08, 2011 10:16 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Re: Get distance from IR sensor
It's just a crap sensor, plain and simple. Maybe LEGO tried to save some bucks/euro/kroner bij skimping on parts. It's the same reason the LEGO colour sensor is not nearly as good as the HiTechnic one.

The US sensor that came with my BoeBot from Parallax was fantastic, compared to the LEGO one.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Dec 08, 2011 11:37 am
Profile WWW
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Get distance from IR sensor
mightor wrote:
To call the sonar sensor accurate would be an inaccuracy in itself.

You are right. I should have said more accurate than IR sensors.


Thu Dec 08, 2011 1:07 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.