Solve Geometry Problem for Senior Design Project

  • Thread starter Thread starter Abyss
  • Start date Start date
  • Tags Tags
    Geometry
Click For Summary

Discussion Overview

The discussion revolves around solving a geometry problem related to determining the location of a robot within a square arena using distance measurements from sensors positioned on the robot. Participants explore various methods for calculating the robot's position based on these measurements and the robot's orientation.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant proposes using a function that calculates distances to the walls based on the robot's position and angle, suggesting an iterative approach to refine the position estimate.
  • Another participant mentions a method involving finding all possible solutions for a sensor's distance and angle per quadrant, intersecting these solutions to determine the robot's location.
  • There is a recognition that while the proposed solutions are not perfect, they are considered elegant enough for the project's needs.
  • Concerns are raised about maintaining accuracy in the angle measurement (phi) and the need to correct it using the distance measurements.

Areas of Agreement / Disagreement

Participants generally agree on the feasibility of the proposed methods, but there is no consensus on a single best solution. Multiple approaches are discussed, and the effectiveness of each remains open to further exploration.

Contextual Notes

Participants note that the graphical representation of the problem is complex, and the solutions involve intersecting geometric shapes based on sensor data. There are also implications that the accuracy of angle measurements may affect the overall solution.

Who May Find This Useful

Readers interested in robotics, geometry, sensor data interpretation, and algorithm development for position estimation may find this discussion relevant.

Abyss
Messages
6
Reaction score
0
Hi guys, I'm doing my senior design project and we've decided upon a method for finding the location of our robot in the square arena that we have built. The method we are using involves sensors on all four sides of the robot (each at 90 degrees of the two adjacent) that return the distance to one of the straight walls of the arena.

I am sure that given the 4 lengths from the robot to the walls of the arena, and knowing the angle that the robot is at, that it is possible to find the location the robot is at. I've spent a couple days on this problem though, and I haven't been able to come up with a general solution.

I know that with about 200 if-else statements I could program a solution but we need our code to be as elegant as possible.

I have a dozen pages of notes, and I have written an application to help me visualize the problem and test potential solutions, if anyone has any ideas I'd love to hear them.

I attached two pictures of the app, but they really aren't necessary, they may help explain the problem more clearly though.
 

Attachments

  • Problem1.jpg
    Problem1.jpg
    23.4 KB · Views: 416
  • Problem2.jpg
    Problem2.jpg
    23.3 KB · Views: 431
Physics news on Phys.org
A possible solution is to write a function that given an input (x,y,phi) calculates the 4 distances to the wall.
You can do this by intersecting the lines with all the walls.
In each heading you need the nearest intersection that lies in the proper direction.

Then write a second function that approximates your position.
That is:
1. start in the middle with your angle phi.
2. calculate the 4 distances
3. take a small step in the direction with the greatest mismatch
4. repeat 2 & 3 until you cannot get closer any more
5. if your mismatches are reasonably small you have found your position.
 
Thanks for the suggestion, I agree that solution would work. In fact we use something similar in our inverse kinematic solution.

In the end after working with it some more I decided to find all the possible solutions that a single sensors distance/angle could return per quadrant (which look like two line segments connected in a right angle). Then intersect those elbows until a solution is found.

It isn't perfect but elegant enough for my tastes. I've included a screeny which looks quite complicated but alas no graphical depiction of this problem will be simple. The solution for sensor A (in direction of the robot depicted by a small circle a short distance away from the central circle) is in Red, the solution for sensor B is +90 off of sensor A and is green, the solution for C is 180 off of A and is blue and the solution for D is 270 off of A and is yellow. The region enclosed by each solution is shaded in the solutions color, which can help to highlight the different solutions.
 

Attachments

  • problem3.jpg
    problem3.jpg
    25.6 KB · Views: 399
Abyss said:
Thanks for the suggestion, I agree that solution would work. In fact we use something similar in our inverse kinematic solution.

In the end after working with it some more I decided to find all the possible solutions that a single sensors distance/angle could return per quadrant (which look like two line segments connected in a right angle). Then intersect those elbows until a solution is found.

It isn't perfect but elegant enough for my tastes. I've included a screeny which looks quite complicated but alas no graphical depiction of this problem will be simple. The solution for sensor A (in direction of the robot depicted by a small circle a short distance away from the central circle) is in Red, the solution for sensor B is +90 off of sensor A and is green, the solution for C is 180 off of A and is blue and the solution for D is 270 off of A and is yellow. The region enclosed by each solution is shaded in the solutions color, which can help to highlight the different solutions.

That works too. As yet I don't see a more elegant solution.

Note that I expect that you won't be able to keep your phi accurate.
So I think you'll need to use your measurements too to correct phi back to the proper angle.
 

Similar threads

Replies
3
Views
2K
Replies
31
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 18 ·
Replies
18
Views
2K
  • · Replies 1 ·
Replies
1
Views
23K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K