algorithm - How to plot a room outline from range finder sensors in a toy car? -
i have toy car has arduino , 4 ultrasonic range finder sensors in front, rear , both sides, give me distance wall if exist within range sensor covers, sensors give me data in short intervals, car has move around room , plot outline, rooms can have columns , kind of irregular, don't know algorithms involved in plotting, insight appreciated.
heh once did robot same :)
bud turn around @ 1 place (no turning radius)
easy drive , map environment
in case hard because not see car kinematics
anyway hints:
1.while doing ultrasonic listening should have motors quiet
- i used stepper motors pulses heard in receiver
- if use dc motor tricky (may need full stop)
- or determine echo echo , commutator noise
- with brushless (bldc) , sinusoidal driving ok
- but pwm or other impulse driving create same problems
- so need synchronize listening times , pulse noisse times
- without proper measure equipment extremly hard (oscilloscope ideal this)
2.ultrasound emitters
- to avoid many confusions
- either use 1 @ time
- this easy slow
- or @ once , wait first receive
- in way not data far echoes
- it possible receive sides need complex filtering
- try optimize receiving loop as can
- i did in few t of mcu give me 4 mm resolution
- but long time ago , atmel used old 51 clone running on 20 mhz only
- dont know arduino (preffer uc3) todays mcus more 10 times faster better timings.
3.movement
- you need code movement manoeuvres
- forwad/backward constant step
- turn left/right 90 degrees
- their must accurate can code
- in suitable environment can use ultrasound more accurate (need perpendicular sides , no problematic material inside)
- with these can start mapping 2d maze
4.mapping room
- create 2d map of environment
- you can cell or vector approach
- i recommend cell access (it less accurate easier starters)
- map can 2d array
with values unknown,space,wall
1.init
- place car perpendicular wall
- clear map unknown
- set position in middle of map (x,y)
2.echo-locate sides
- if wall found mark in map on (x,y)+(distance * side vector)
- and mark space between x,y , wall mark space
- if no wall found mark space cells in map x,y (x,y)+(safe range*side vector)
- side vectors can be: front(0,+1), back(0,-1), left(-1,0), right(+1,0)
- safe range distance car wall detected in [cells]
- distance measured distance of wall in [cells]
- do not forget add emitter/receiver offsets car position account
- also mark current position (x,y) space
3.find or closest or fastest move cell marked unknown neighbouring space cell
- if none such found mapping finished (blink led or crazy move signal it)
- if found plan path , move car it
- set position x,y it
4.goto 2
now mine data mcu pc , view it
[notes]
- there can added improve ...
- beware fabric/cloth materials
- they hard detect ultrasound
- for emitters use required frequency maximize performance
- for impulse echolocation the best power/accuracy/range ratio emitting 7 pulses
- no 1 knows why best (at least applications , equipment know of)
have fun :)
Comments
Post a Comment