![]() |
[FTC]: IR Block for Block Party
My team (The Things 5926) are looking at using an IR sensor to drop a block in the basket to score a IR score for the block in autonomous.
What I want to do is drive for a set amount of time, look to see a value from IR sensor, move arm to drop block, all while driving the set mount of time. I read online that I could tape over the sensor with electrical tape so that I would only get a reading if the sensor is right at the beacon. Is this idea feasible? Thanks, Matt, The Things 5926 |
Re: [FTC]: IR Block for Block Party
I think what a lot of people are doing is mounting the IR sensor at an angle, so that zone 5 (the smallest) corresponds with being directly in front of the IR beacon.
|
Re: [FTC]: IR Block for Block Party
If you don't want to mount the IR sensor at an angle, one approach is to wait until the sensor changes state to a certain zone, and then use a set time/encoder distance to get the scoring mechanism to the center of the basket.
The benefits of this approach is that it is easily adjustable for where your block scoring mechanism is, it doesn't require hardware changes to adjust where it scores and it doesn't really matter what orientation/zone you seek the beacon with. The downside is that the code is slightly more complex and as such could take longer to debug and get working properly. We use this approach for scoring the block; so here is our code that we used for this. I took out our robot specific commands and just left the framework together to give you a jump start. Code:
#include "C:\Program Files (x86)\Robomatter Inc\ROBOTC Development Environment\Sample Programs\NXT\3rd Party Sensor Drivers\drivers\hitechnic-irseeker-v2.h";Hope this helps, Team 4211 |
Re: [FTC]: IR Block for Block Party
Thanks for the help! This will help a lot, this is what I wanted to do, just couldn't quite figure out how to do it.
I am also looking at putting a NXT ultrasonic sensor on the front of the robot. I will use this to keep from getting blocked or hitting our alliance partners robot. Say the normal program would drive past the baskets, dump block, and then take a 180 degree left turn onto the ramp. This code would run unless the ultrasonic sensor sees something within 20cm. If an object is within 20cm the robot would turn around, and go up the other side of the ramp. Thoughts? Thanks, Matt, The Things 5926 |
Re: [FTC]: IR Block for Block Party
Hello,
Here is what I have written up for your application. This code contains the section of driving past the baskets and then tries to get on the ramp. It checks both sides for an opponent and if there is one it tries the other side of the ramp. Adjust the times and powers as needed for your robot. As is it should work decently for a robot with 4" wheels with a 1:1 gear ratio on the drive. Code:
#pragma config(Hubs, S1, HTMotor, HTServo, none, none)I didn't know how your sonar was mounted so included sections at the end for it pointing forward or sideways off the robot. Hope this works for you, Team 4211 |
Re: [FTC]: IR Block for Block Party
Quote:
|
Re: [FTC]: IR Block for Block Party
Looking back, you're right, I meant zone 4 or zone 6
|
Re: [FTC]: IR Block for Block Party
I got this error when compiling the IR sensor
**Error**:Undefined procedure 'HTIRS2readACDir'. Any thoughts? Am I missing something with sensor driver? Thanks, Matt, The Things 5926 |
Re: [FTC]: IR Block for Block Party
Quote:
|
Re: [FTC]: IR Block for Block Party
Note that if your robot is driving parallel to the pendulum and if you mount the IR seeker pointing directly ahead, the zones to detect the IR beacon will become 2 if it is on the left side and 8 if it is on the right side. Both zone 2 and 8 are very narrow. Mounting this way will make your robot capable of detecting the IR beacon on both the left and the right side.
|
Re: [FTC]: IR Block for Block Party
I'm not a programming mentor (more CAD, strategy, and design), so I can't speak for the specifics of what the teams I've been working with are actually doing in the source code, but I can tell you that more than 1/2 of our teams have a very nearly 100% IR autonomous with just a straight-on IR sensor and a little servo-powered "flicker arm," which behaves almost exactly as you've described.
Even our teams that have dedicated floor pickup use this method, and they've been pretty successful at competition. There's something to be said for just keeping it as simple as possible... I'll grab some pictures when I'm in the shop tonight of our setups. |
Re: [FTC]: IR Block for Block Party
You can also get the raw values of each of the five sensors in the IRSeeker. Visit the sensor website for information of the ports http://www.hitechnic.com/cgi-bin/com...on&key=NSK1042. The sensor could look straight and you can read sensors 2 and 4. Keep going until they are equal values. Sensor 2 is in the direction of zone 3. Sensor 4 is in the direction of zone 7.
Colton Mehlhoff HiTechnic |
| All times are GMT -5. The time now is 18:19. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi