View unanswered posts | View active topics It is currently Mon Dec 22, 2014 8:47 am






Reply to topic  [ 12 posts ] 
How to use the HTDIRreadACStrength 
Author Message
Rookie

Joined: Wed Sep 14, 2011 8:29 am
Posts: 6
Post How to use the HTDIRreadACStrength
Hey, I'm currently stuck on a part of my program involving the HTDIRreadACStrength. The program is for robosoccer, specifically a goaly. What it is meant to do is stay in a black square, until the IR ball comes close enough (hence the use of the HTDIRreadACStrength) that it charges at it, and dribbles it towards the opponent's goals.

Everything else in my program works besides the ball strength, which only gives a value when the ball is 5 (in HTDIRreadACDir terms). Im looking mainly for some tutorial of how to use the HTDIRreadACStrength, whether i should be using the HTDIRreadACStrength or HTDIRreadAllACStrength and if there may be another way. I can post part of the code if needed.

Thanks,
Sambo


Wed Sep 14, 2011 8:38 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post Re: How to use the HTDIRreadACStrength
There is no tutorial apart from the examples that come with the driver suite. Did you take a look at those?

- 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 Sep 14, 2011 8:45 am
Profile WWW
Rookie

Joined: Wed Sep 14, 2011 8:29 am
Posts: 6
Post Re: How to use the HTDIRreadACStrength
mightor wrote:
There is no tutorial apart from the examples that come with the driver suite. Did you take a look at those?

- Xander


I've had a look over some of them, but i cant seem to find one that would specifically help me in this case, altho I might be completely wrong. Can you think of one of the examples that would help me put me on track for this?

sambo


Wed Sep 14, 2011 9:23 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post Re: How to use the HTDIRreadACStrength
In HTIRS2-test1.c there's a call to HTIRS2readAllACStrength() that fetches all the different sensor values. Is this not what you have been using?

Are you using the 2.1 version of the driver suite?

- 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 Sep 14, 2011 9:30 am
Profile WWW
Rookie

Joined: Wed Sep 14, 2011 8:29 am
Posts: 6
Post Re: How to use the HTDIRreadACStrength
I'm using the 2.1 version. Before we were actually using another driver, not sure what version, but HTDIR-driver, not HTIRS2-driver


Wed Sep 14, 2011 9:49 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post Re: How to use the HTDIRreadACStrength
Do you have a HT IR Seeker V1 or V2? :) Does it look like this one: http://www.hitechnic.com/cgi-bin/commer ... ey=NSK1042 ?

- 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 Sep 14, 2011 9:58 am
Profile WWW
Rookie

Joined: Wed Sep 14, 2011 8:29 am
Posts: 6
Post Re: How to use the HTDIRreadACStrength
Yes its a V2 one.


Wed Sep 14, 2011 9:59 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post Re: How to use the HTDIRreadACStrength
The HTDIR driver isn't the right driver to use then :) It should be HTIRS2-driver.h

- 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 Sep 14, 2011 10:03 am
Profile WWW
Rookie

Joined: Wed Sep 14, 2011 8:29 am
Posts: 6
Post Re: How to use the HTDIRreadACStrength
Ok i've changed all that over now, the reason we were just using the HTDIR-driver was because of just needing to know the ball direction. How can i make it so that no matter where the ball is around the sensor it will give me a strength value?


Wed Sep 14, 2011 10:15 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post Re: How to use the HTDIRreadACStrength
I am not sure I understand what you mean. You will never see a strength value if the sensor cannot see the ball. You don't just get 1 strength value, you get 5 of them. Are you looking for some kind of way to get a feeling of how far the ball is general? If that's the case then I have to disappoint you, there is no HTIRS2readDCAverage() equivalent for the AC signals. You may need to do some additional maths yourself.

- 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 Sep 14, 2011 1:33 pm
Profile WWW
Rookie

Joined: Wed Sep 14, 2011 8:29 am
Posts: 6
Post Re: How to use the HTDIRreadACStrength
Sorry, I meant that as long as the ball is in the sensors range (between 1-9) that it could give the strength value instead of just at 5. It seems I might just have to change how the goaly operates if there is no equivalent for the AcStrength. Thanks for the help.
Sambo


Wed Sep 14, 2011 7:46 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post Re: How to use the HTDIRreadACStrength
Do you also see this problem of just a signal when the ball is at 5 when you're using one of my test programs?

- 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 Sep 15, 2011 1:58 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 12 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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.