UBC-Snowbots / Snowflake

UBC Snowbots Codebase
10 stars 42 forks source link

Create an Obstacle Manager #231

Closed garethellis0 closed 5 years ago

garethellis0 commented 7 years ago

This will act like a global map for us, general structure would be:

Note There is a lot of complexity in the above structure that likely needs to be hashed out some more before we implement this. For example:

garethellis0 commented 7 years ago

After some thought (pictured below):

Determining If Two Obstacles are Close together

Merging Two Obstacles

My Thoughts (In Text Form)

img_20171104_134623 img_20171104_134631

raadkhan commented 7 years ago

After doing some searching/thinking about lines, (assuming the line segments are a vector of (x,y) points) we could determine if two line segments are the "same" by seeing if two conditions are both true: Condition 1: take dot product of the lines, that gives cosine of angle between them, if the value is above some threshold (close to 1) then we can declare them as "same" in terms of slope. Condition 2: compare how close is new line's start point to the old line's end point or if the line segments intersect, then we can determine if the lines are close enough to be merged.

garethellis0 commented 7 years ago

Just to be clear here, we're actually dealing with n-ary polynomial lines, rather then just straight lines.

garethellis0 commented 6 years ago

Splines may be a good way of storing a longer line made up of several polynomials: https://en.wikipedia.org/wiki/Spline_(mathematics)

Note to self: Investigate and expand this.

garethellis0 commented 6 years ago

After some consideration, here are my thoughts on how to use splines to represent lines (and merge other lines in) img_20180127_111245 a possible additional step (4) might be to recompute the spline such that we only keep points that are in areas of significant change (ie. corners, etc)

garethellis0 commented 5 years ago

Resolved last year.