PRO
EzAng
USA
Asked
— Edited
Sharp IR On Car Robot, Table Top Robot Avoids Falling Off
anyone know how to write this code in java?
:loop adc_wait(adc0,lower,160) stop() reverse(200,500) sleep(50) left(255,500) stop() forward() sleep(50) goto(loop)
now it starts, avoids falling off table, turns left, keeps going - cheers! All figured out below, I solved it below with help of thetechguru
thanks
Related Hardware EZ-B v4
Related Control
Indoor Positioning System
Do you mean a cliff detector? I use an Sharp IR sensor and a script to detect cliff edges.
Alan
do you have the Arduino code for that
No, I did it in Synthiam ARC with an EZ-B V4/2.
It is in the MyRoli MKII project under my name. I believe the script and object are named Edge Detector (I am at work and can't open the project from here).
Alan
ok talk later, thanks
This has come up a few times lately. When I have a few minutes either tonight or maybe Wednesday I'll make a project without all the extra stuff just to demonstrate how this works. Maybe even create a tutorial, although I never have enough free time for that lately.
Alan
I just posted a cliff detection sample project: https://synthiam.com/Community/Apps/cliff-detection-sample-18442
This uses an H-Bridge movement panel, and a Sharp IR sensor plugged into the ADC7 port. The read-ADC control reads the value, and has a multiplier to adjust the sensitivity range. The script waits for a change, and if the value is high enough that the robot would fall, it stops and backs up, then waits for further instructions. You need to start the cliff detection script (in a real robot, you would probably call it from your init script) before driving the robot.
I believe I used a 5cm-30cm Sharp IR sensor, but I don't recall for sure. You want one with a short enough range that it can detect drops when facing down from a mount point on the robot.
This could easily be adapted to use multiple sensors to detect cliffs on the sides and back and have different actions depending on which sensor triggered.
Alan
Thanks for the info and the link, I will try later,
I used my Arduino, com3 on ARC
sharp sensor:
used port ADC3
sharp IR radar
ADC graph
ADC meter
ADC read
All went well
thetechguru,
I know this is an old thread, but I have a question.
Why do you use the H-Bridge Movement Panel in your app?
I use the servo Movement Panel for the wheels.
I am interested in table top robots that don't fall off the table :-) anymore info?
@EzAng I was using a Roli. It has an HBridge and motors, so I needed the HBridge Movement Panel to make it work, but the example will work with any movement panel. It just issues a stop, then a short back any time the IR detector discovers the distance increase. I only put one on the front, but you would probably want them at each corner with approptiate scripts for a tabletop robot so it doesn't back or turn its way off the table when responding to one of hte sensors. Maybe a script that just does a panic stop if 2 detectors trigger at once.
Alan
any sensors better then the sharp IR for table top robots that don't fall off the table?
Does this need a left or right turn to avoid the edge while it is in reverse?
I think the IR is pretty good for this use. It is sensitive and fast.
As far as the script, it depends on how the robot is being driven. This script is just a panic stop. If you want it to continue moving, then yes, you probably want it to make a turn, and then pass control back to whatever you are using to drive it. (When I wrote it, I was manually driving using the movement panel, so when it panic stopped, I took care turning and recovering...).
Alan
I tried this
works ok then stops, have to keep starting the robot
be back later for more, thanks
EzAng
Instead of the stop before the :loop, you will need to tell the script to return to what it was doing previously, whether that is a separate script or a control command, or just a forward()
Alan
Hi, I made it back,
I will try what you said, thanks
The Roomba and most vacuum robots use IR sensors for cliff detection.
Sharp IR sensor - ARC
figured it out - now it starts, avoids falling off table, turns left, keeps going - cheers!
:loop adc_wait(adc0,lower,160) stop() reverse(200,500) sleep(50) left(255,500) stop() forward() sleep(50) goto(loop)
How would you write this code in java? EzAng
Synthiam ARC doesn't work with Java - at least not without a ton of work. You'd need to create some bridge between the two compiled executables.
Also, I don't think those sleep(50) lines are doing anything.
I ment Java script
This is probably a good way to back away from cliffs...
JavaScript Code
thanks DJ for the code
Actually this makes more sense if using any NMS skills for navigating..
My problem was - I have a Sharp IR distance sensor, I need a Sharp Infrared Proximity Distance Sensor, ordered it
What is a the diference between "Sharp Infrared Proximity Distance Sensor" and "Sharp IR distance sensor"?
From what I read,
the Sharp IR Analog Distance Sensor (6.99_ detects (avoids) objects in front of the robot, I have this, works well,
I going to try The Sharp Proximity Distance Sensor (9.98) to detect more of a depth proximity
I will receive this Sunday and test and let you know,
I think the distance sensors don’t work well with close objects, specifically edge detection.
the proximity detector is designed for close contact and edge detection.
proteusy,
received the Sharp proximity sensor, did the test,
much better results, responds very different
What is the reference of those sensores? Can you post a pic? Thanks
The ones I’ve used require a two resistors and they’re tiny and super cheap. Look like this
but you can get ones that have a pcb with the wiring all ready for you. Maybe like this from Amazon
Oh yes, i know those sensors. Thanks.
proteusy
This is the Sharp proximity sensor, not the distance sensor
works well for me
Here are 2 pics:
In my experience, the sensor that ezang just posted isn't great for edge detection. They have difficulty with close objects and prefer a distance of 10+ cm away.
Yep, that seems to be the Sharp GP2Y0A21YK0F sensor. It works from 10 to 80cm.
Sharp GP2Y0A21YK0F GP2Y0A21 10~80cm Infrared Proximity Distance Sensor
is enough for a table top car :-)
You always can get the Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0F 19.95
the Description: Infrared proximity sensor made by Sharp. Part # GP2Y0A02YK0F has an analog output that varies from 2.8V at 15cm to 0.4V at 150cm with a supply voltage between 4.5 and 5.5VDC. The sensor has a Japanese Solderless Terminal (JST) Connector. We recommend purchasing the related pigtail below or soldering wires directly to the back of the module.
I have used those Sharp sensors too, and they do a pretty good job.
I've used the same Sharp sensors for years and have have had good results with them for edge and line detection.
Hi JustinRatliff, nice to see you again,
what script do you use ior edge detection?
I have one but it may not be as good as you , thanks
On my big robot I use 5 of this:
Sharp GP2Y0A51SK0F Analog Distance Sensor 2-15cm https://www.pololu.com/product/2450
Similar to the GP2Y0A21YK0F but a shorter range 2-15cm.
Cliff detection:
@PTP I like how small those are. The GP2Y0A21YK0F work fine if the drop-off you are worried about is high enough. The step I am avoiding is well over 10cm, so I just watch for an increase from unmeasurably small to measurable, but for future builds I think I'll get the Pololu ones.
This is why I use the Sharp GP2Y0A21YK0F GP2Y0A21 10~80cm Infrared Proximity Distance Sensor
not the Sharp Infrared Distance Sensor
PtP what script do you use for the sensors?
I purchased some of the IR Infrared Obstacle Avoidance Sensor Modules 7.99 for 10 units
will test soon, hope they work
I'm curious how those will work - without any rear reflector housing on the emitter or detector... will be interesting to see.
This is just to avoid obstacles