Quote:
|
Originally Posted by BurningQuestion
I was thinking of using a sensor such as this one . Can you recommend a better one? How do you write the code for a sensor like this?
|
I'm all for any attempt by teams to move away from dead reckoning to something more sophisticated. I think autonomous is going to become a real drag if we don't start heading that direction. With that said...
The sensor you listed here wouldn't have been allowed this year (I don't think any of the approved suppliers carry it). Hopefully the rules will be relaxed next year, but you never know. I don't have experience with any of these sensors, however we did investigate the use of them for our robot this year. Depending on what the rules are next year with regards to infrared emitters on the robot, there's some IR rangefinder devices that I believe are much cheaper than these ultrasonic ones.
Writing code for proximity sensors depends a lot on the sensor in question. Many of the IR prox sensors just output an analog voltage (hook it up to an analog input on the RC and just read the value! Pretty convenient!) The sensor you selected above appears to work a little differently and would be harder to work with. Basically you hook the output of that sensor up to a digital input on the RC, and after you tell it to measure distance, it will send a high signal to the digital input for a length of time that is proportional to the distance to the target. This means you need a good way to accurately measure time. So, you need to set up one of the timers on the processor to run at a known rate, then you probably want to hook the sensor up to an interrupt line and trigger the interrupt on both the rising edge and falling edge (I believe the RC supports this, but it's been a while since I looked at it). Then you just start the timer when you get the rising edge interrupt and stop it when you get the falling edge (and don't forget to account for rollover). Obviously it'd be a lot easier to try to find a sensor that just gives you an analog output
Quote:
|
Originally Posted by Lisa Perez
is there any way that these sensors may be programmed in such a manner that they will not react to other robots on the field but rather, just the playing field itself?
|
Unfortunately no. All these sensors can tell is if there's an object that reflects sound (or IR, for the infrared ones) within it's path. The sensor has no knowledge of what type of object it is, which is why navigating with these would be very difficult, because you can't really be sure if the reflection you're getting is from the playfield wall or from another robot, or a ball, or some junk that got dropped on the field, or....