2wd icon indicating copy to clipboard operation
2wd copied to clipboard

Obstacle detection

Open japaric opened this issue 7 years ago • 3 comments

The robot has an ultrasonic sensor that can measure the distance between the robot and an obstacle ahead. I want to use that sensor to implement some form of obstacle detection. I'm not sure what should be the behavior when the robot is close to an obstacle at this point -- preventing it from moving forwards seems sensible --, but we can start with just reporting the distance measured by the ultrasonic sensor as a start.

japaric avatar Jun 21 '17 16:06 japaric

A very simple form of obstacle avoidance is Artificial Potential Fields. The basic idea is that obstacles (detected with ultrasonic sensor) "produce" a repulsion field that affect the desired driving direction. E.g. The robots want to drive to point B, the robot position is always A, we can then crate a vector from A -> B this is our desired driving direction. When an obstacle (C) is encountered it creates an opposing force, C -> A, by scaling these forces appropriately the robot will stop before hitting the obstacle, but even better, if the robot approaches the obstacle from an angle the sum of the forces will hopefully drive the robot around the obstacle. Illustrated here

nordmoen avatar Jun 22 '17 07:06 nordmoen

That's a neat idea. I would have to mount the ultrasonic sensor on top of a servo -- right now it's fixed -- to get the most out of this. Alternatively I could add more sensors with different orientations.

japaric avatar Jun 23 '17 04:06 japaric

It could probably still be done without more sensors (see Occupancy Grid), but that way lies SLAM.

Depending on how wide the sensor can go the easiest is probably more sensors.

nordmoen avatar Jun 23 '17 08:06 nordmoen