How do you program the robot to use the IR Seeker?I downloaded the drivers from http://www.hitechnic.com/downloads but have no clue what to do with them, or how to attach them to RobotC.And I watched the video at CMU FTC training site, but only found Part 2, which assumes you have already set up RobotC to recognize the IR Seeker. How do you get the right information into the Pragma statements?

I assume you downloaded the "RobotC Drivers for HiTechnic Sensors & SMUX"? I am the guy who wrote them. You need to read the documentation that came with it. I made a lot of effort to document the API for all of the drivers. So open your file browser and open the "index.html" in the HTML folder that came with the drivers. On the left of the page, click on "File List" and then select the "HTDIR-driver.h" for the IR Seeker V2 or "HTIRS-driver.h" for the IR Seeker V1.

As you scroll down the list of functions and their usage, you will see links to examples, click on one of them and you'll see a program that tells you how to use the functions.

In the driver suite directory, you can open HTDIR-test1.c for an example of how to use the IR Seeker V2 or HTIRS-test1.c for an example of how to use the IR Seeker V1.

OK, I did that, but I still have a couple of problems.1. I'm so new to RobotC that I don't understand half of what I'm reading.2. When I open one of the -test1.c programs in RobotC (v 1.46), it doesn't recognize much of the code and returns numerous "Unreferenced function" warnings. Do I need to move the .h files into RobotC? If so, how? Do I have to move something I downloaded into the "Includes" directory? Or do I go into RobotC and have it go out and search for the missing drivers?3. When I click on Robot -> Motors & Sensors Setup -> Sensors -> Type, this sensor isn't one of the choices.

Go to Window->Menu Level and make sure it is set to "Expert"In the "Motors and Sensors Setup" select the "Device Mgmt NXT" tab and make sure "Allow Custom Designed Sensors" is selected. Next go the "Sensors" tab and select "I2C Custom" from the list.

Just my 2 cents worth, but the documentation for this stuff is not student-ready. Doxygen may be used in industry for documenting code, but it is little more than pretty-printing the comments from the source - at the expense of making the source comments difficult to read. I would much prefer that code such as this:

(of course, the nice white-space I added to the comment blockwas stripped from the HTML, but you get the idea)

Also, the existing documentation is mainly a function/data-structure reference. Where is the overview that describes what an "SMUX" is and what robot configuration you need to run the example programs? What is the differencebetween "HTIRSreadStrength(tSensors link, byte sensorNr)" and"HTIRSreadStrength(tMUXSensor muxsensor, byte sensorNr)" and why wouldyou need one or the other?

Finally, it would be ideal if the code examples provided to the teams followed a style that we expect from the students themselves. I try to stress with my students thatyou must document the code concisely but completely such that another studentcan easily understand it and apply it to the next problem to solve.

Just my 2 cents worth, but the documentation for this stuff is not student-ready. Doxygen may be used in industry for documenting code, but it is little more than pretty-printing the comments from the source - at the expense of making the source comments difficult to read. I would much prefer that code such as this:

You are encouraged to read the HTML documentation that is generated from the doxygen tags.

Quote:

Also, the existing documentation is mainly a function/data-structure reference. Where is the overview that describes what an "SMUX" is and what robot configuration you need to run the example programs? What is the difference between "HTIRSreadStrength(tSensors link, byte sensorNr)" and"HTIRSreadStrength(tMUXSensor muxsensor, byte sensorNr)" and why would you need one or the other?

A SMUX tutorial is on its way. As for the functions, you don't need one over the other, they both serve different purposes.

Quote:

Finally, it would be ideal if the code examples provided to the teams followed a style that we expect from the students themselves. I try to stress with my students that you must document the code concisely but completely such that another student can easily understand it and apply it to the next problem to solve.

I think you forget that this is a project I do in my spare time. I don't get paid for it by anyone. If you'd like to contribute examples to the project, you're more than welcome to do so. If I think they're good enough, I will include them with the proper credits. If you think you have what it takes to make this project more student friendly, feel free to drop me an email, it's in the top of each source file.

I found the answer to my own question.The instruction sheet that came with the sensor says "IRSeeker V2.0 Feb 2009"Also, I determined the driver that I downloaded today is set up for a V1 seeker with an I2C address of 0x02.I modified it for V2 by changing it to 0x10. The seeker now works with the HTIRS-test.c program.Thanks for your help.

The new HT IR Seeker (also known as the HTDIR) uses another driver, the... HTDIR driver. There is no need to change the I2C address in the HTIRS, you can leave that at 0x02. The HTDIR already uses the correct 0x10 address. In the documentation there is a nice list of all the drivers and the sensor they support. Below is a small screenshot of part of it.

You can't skip over the documentation I provide and then complain about the lack of it. There are some major differences between the HTDIR and HTIRS, the HTDIR is capable of a lot more. A quick glance at the API documentation will illustrate my point.

Lest you forget, we're not all based in Oregon, so time zones are something you need to take into account when posting a question and waiting for an answer. When you posted your question

Quote:

How do you know if you have a V1 or V2 seeker?

I was already in bed for more than an hour. The Internet is populated by people outside the US, too, you know.

I see that in the documentation now. Since the list was machine generated, the table was sorted by file name not function. I'll be more careful about reading the docs before posting to the forum.

By the way, why not have a single function that returns all of the data from the sensor at once?If the students want to get the direction and get the signal strength, they need to call two differentfunctions, each incurring their own time penalty over the I2C bus.

Our team is a little frustrated at the moment because we are trying to get a reading from the IR Seeker, we believe that it is version 2. We have downloaded the drivers and gotten to the right page in the index. However the test program is full of errors, and RobotC won't let us ignore them. Is there a simpler way to test the IR seeker than this large program? We also looked at the video of getting the robot to chase the IR ball. The program didn't work even though it had no errors. Any help is much appreciated.

Please be more specific about "full of errors". If you are talking about the warnings, you can safely ignore them. They have to do with the fact that there are functions in the libraries that are not being used.

Are you using HTDIR-test1.c? That is the program you should be using for the IR Seeker V2. I just loaded it up and it works fine. I am using ROBOTC 2.00.

Who is online

Users browsing this forum: No registered users and 2 guests

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