如何绘制从测距仪传感器的一个房间的轮廓在玩具车? [英] How to plot a room outline from range finder sensors in a toy car?

查看:138
本文介绍了如何绘制从测距仪传感器的一个房间的轮廓在玩具车?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个玩具车,其具有的Arduino和4超声波测距仪传感器前,后和两侧,它们给我一个壁的距离,如果范围内的任何所存在的传感器罩,传感器给我这个在较短的时间间隔的数据,车上有走动的房间并画出轮廓,房间可以有列,成为一种不规则的,我不知道参与这一阴谋的算法,任何有识之士将AP preciated

解决方案

嘿曾经做过一个机器人,几乎是相​​同的:)
芽它可能掉头在一个地方(没有转弯半径)
所以很容易驾驶和地图环境
你的情况很难说,因为我们没有看到车运动<​​/ P>

反正一些提示:

1.当在做超声波的聆听,你应该有你的电机安静

  • 我用步进电机这样的脉冲可以听到接收器
  • 如果您使用的直流电机那么这可能是非常棘手的(可能是你需要做的句号)
  • 或确定呼应的回声和它换向器噪音
  • 无刷(BLDC)和正弦驱动是一切OK
  • 但PWM或其他脉冲驱动会造成同样的问题
  • ,所以你需要同步监听时间及脉冲noisse次
  • 在没有适当的处理设备将这个是很难的极端(示波器非常适合这个)

2.ultrasound发射器

  • 要避免许多混乱
  • 或者使用仅一次一个
    • 这是容易的,但慢
  • 或一次,等待第一只接收
    • 在这种方式你没有得到的数据从遥远的回声
  • 有可能从四面八方接受,但它需要一个相当复杂的过滤
  • 尝试优化接收环路多,您可以
  • 我在MCU的几个t内给我约4 mm的分辨率做了
  • 但它是一个很久以前的ATMEL用的是旧的20 MHz的唯一
  • 运行51克隆
  • 在不知道的Arduino(preffer UC3),但今天的MCU是更快更好的时机了10倍以上。

3.movement

  • 您将需要code运动演习
  • forwad /向后恒步
  • 转左/右90度
  • 他们必须尽可能准确,你可以code
  • 在合适的环境中,可以使用超声来更准确(只需要垂直侧面和没有问题的材料内部)
  • 在这些你就可以开始你的映射二维迷宫

4.mapping房间

  • 创建环境的2D地图
  • 您可以通过细​​胞或载体的方式做到这一点
  • 在我强烈建议小区接入(这是不太准确,但更容易为初学者)
  • 在地图上可以是二维数组
  • 与价值观不明,空间,墙壁

    1.init

    • 垂直放置汽车的一些墙壁
    • 未知
    • 清晰的地图
    • 在地图(X,Y)的中间位置设置位置

    2.echo,找到各方

    • 如果墙体被发现将其标记在(X,Y)+(距离*方矢量)
    • 地图
    • 和标记x,y和墙上标记为空间之间的所有空间
    • 如果没有墙,然后发现标记为空间中的所有细胞从x的地图,准备(X,Y)+(安全范围*方矢量)
    • 在侧载体可以是:前(0,+ 1),背(0,-1),左(-1,0),右(+1,0)
    • 在安全的范围是从你的车在哪里的墙总是在检测到的距离[细胞]
    • 在距离被测量的距离墙的[细胞]
    • 请不要忘记从车上的位置增加了发射器/接收器偏移到
    • 也标志着当前位置(X,Y)的空间

    3.find任何或最接近或最快速的移动单元格标记为未知的,但相邻的空间单元

    • 如果没有这样的发现则映射完成(通过闪烁的LED或做一些疯狂的举动,以表示它)
    • 如果找到则计划路径和移动车吧
    • 设置位置x,y以它

    4.goto 2

现在刚刚从MCU的数据挖掘,以计算机和查看

[注意事项]

  • 有许多什么可加入改进此...
  • 在提防布/布类材料
  • 在他们很难通过超声检测
  • 对于发射器使用他们所需的频率,以最大限度地发挥其性能
  • 冲动回声定位的最佳的功率/精度​​/范围比用于发射的7个脉冲
  • 没有人知道为什么,但它是最好的(至少对于所有的应用程序和设备,我知道的)

玩得开心:)

I have a toy car that has an arduino and 4 Ultrasonic Range Finder sensors in front, rear and both sides, they give me the distance to a wall if any exist within the range that the sensor covers, the sensors give me this data in short intervals, the car has to move around a room and plot the outline, the rooms can have columns and be kind of irregular, I don't know the algorithms involved in this plotting, any insight would be appreciated.

解决方案

heh once did a robot that was almost the same :)
bud it could turn around at one place (no turning radius)
so it was easy to drive and map environment
in your case hard to say because we do not see the car kinematics

anyway some hints:

1.while doing ultrasonic listening you should have your motors quiet

  • I used stepper motors so their pulses could be heard in receiver
  • if you use DC motor then this could be very tricky (may be you will need to do full stop)
  • or determine which echo is echo and which commutator noise
  • with brushless (BLDC) and sinusoidal driving is all OK
  • but PWM or any other impulse driving will create the same problems
  • so you need to synchronize listening times and pulse noisse times
  • without proper measure equipment will this be extremly hard (Oscilloscope is ideal for this)

2.ultrasound emitters

  • to avoid many confusions
  • either use only one at a time
    • this is easy but slow
  • or all at once and wait for first receive only
    • in this way you do not get the data from far echoes
  • it is possible to receive from all sides but it need a fairly complex filtering
  • try to optimize the receiving loop as much as you can
  • I did it in few T of the MCU which give me about 4 mm resolution
  • but it was a long time ago and the ATMEL used was old 51 clone running on 20 MHz only
  • dont know about arduino (preffer UC3) but todays MCUs are more than 10 times faster with much better timings.

3.movement

  • you will need to code movement manoeuvres
  • forwad/backward by constant step
  • turn left/right by 90 degrees
  • their must be as accurate as you can code
  • in suitable environment you can use ultrasound to be more accurate (need perpendicular sides only and no problematic material inside)
  • with these you can start mapping your 2D maze

4.mapping the room

  • create 2D map of the environment
  • you can do it by cell or vector approach
  • I strongly recommend the cell access (it is less accurate but easier for starters)
  • map can be 2D array
  • with values unknown,space,wall

    1.init

    • place the car perpendicular to some wall
    • clear map with unknown
    • set position in the middle of map (x,y)

    2.echo-locate all sides

    • if wall is found mark it in the map on (x,y)+(distance * side vector)
    • and mark all space between x,y and the wall mark as space
    • if no wall found then mark as space all cells in the map from x,y to (x,y)+(safe range*side vector)
    • side vectors can be: front(0,+1), back(0,-1), left(-1,0), right(+1,0)
    • safe range is distance from your car where wall is always detected in [cells]
    • distance is measured distance of wall in [cells]
    • do not forget to add the emitter/receiver offsets from the car position into account
    • also mark current position (x,y) as space

    3.find any or closest or fastest to move cell marked as unknown but neighbouring space cell

    • if none such found then the mapping is finished (blink by LED or do some crazy move to signal it)
    • if found then plan path and move car to it
    • set position x,y to it

    4.goto 2

now just mine the data from MCU to PC and view it

[notes]

  • there is much what can be added to improve this ...
  • beware fabric/cloth like materials
  • they are very hard to detect by ultrasound
  • for emitters use their required frequency to maximize their performance
  • for impulse echolocation the best power/accuracy/range ratio for emitting is 7 pulses
  • no one knows why but it is the best (at least for all applications and equipment I know of)

Have fun :)

这篇关于如何绘制从测距仪传感器的一个房间的轮廓在玩具车?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆