autocore-ai / MapToolbox

Plugins to make Autoware vector maps in Unity
GNU Lesser General Public License v3.0
257 stars 101 forks source link

No Mesh Collider #55

Closed alperenbayraktar closed 3 years ago

alperenbayraktar commented 3 years ago

@MoeLang Old version used to have a collider child object under the imported pcd file's hierarchy view but for the moment it is not present. .pcd in project view: (only points as child) a .pcd in hierarchy view: (no children) image

The vector map won't snap into the ground and will always have y = 0, this causes problems when you use tilted maps.

moelang commented 3 years ago

Yes, I removed this function because this make our map cracked and uneven, we also fixed pcd height to zero.

alperenbayraktar commented 3 years ago

Alright, but how are we supposed to draw the maps now? Because I can see that some of my pcd files have like 10m+ height difference from their start to end. And when you get a map file out, all the stuff are misplaced, like wayareas are 6m down under the ground. Should we rotate the map elements by hand? @MoeLang

moelang commented 3 years ago

Config the endpoint height of line by hand, then subdivision. Dont rotate any map elements, just modity y axis value.

alperenbayraktar commented 3 years ago

I see, it will be much time consuming unfortunately though. Thanks for fast answers!

alperenbayraktar commented 3 years ago

@MoeLang Is there a way to bring back mesh collider snapping? I'm also editing the package and it could be awesome if I could use the first version's snapping combined with the new map editor scriptings

moelang commented 3 years ago

This function in code HeightMeshBuild , I will add this feature back this weekend.

alperenbayraktar commented 3 years ago

Okay, I'll test it asap, thanks!

alimhn4D commented 3 years ago

This function in c

THANKS: this would help a lot, though we can see the right and neat projection of vectors on image plane. :)

alperenbayraktar commented 3 years ago

This function in code HeightMeshBuild , I will add this feature back this weekend.

Hey @MoeLang did you add this to any branch? I can't find it.

alperenbayraktar commented 3 years ago

Hey @moelang when are you going to add this?

moelang commented 3 years ago

Hey @moelang when are you going to add this?

Yes its under testing, some api changed and cannot used in old methods.

alperenbayraktar commented 3 years ago

Alright thanks, have a nice day.

alperenbayraktar commented 3 years ago

@moelang I tried the commit, now the first node gets the actual height but the second one doesn't upload its height when you move it and always has the same height as the first node. will you add a dynamic height setting for it or should I? image

moelang commented 3 years ago

@moelang I tried the commit, now the first node gets the actual height but the second one doesn't upload its height when you move it and always has the same height as the first node. will you add a dynamic height setting for it or should I? image

Subdevision added height from pcd in last commit

alperenbayraktar commented 3 years ago

@moelang Now it works like a charm. Since setting height with subdivision (Adding ADASGoX), From and To go objects don't upload their heights after subdivision. If you add a lane and change the From position before subdivision, it looks like this, I've added some features myself but here's what I mean: image

alperenbayraktar commented 3 years ago

@moelang Now it works like a charm. Since setting height with subdivision (Adding ADASGoX), From and To go objects don't upload their heights after subdivision. If you add a lane and change the From position before subdivision, it looks like this, I've added some features myself but here's what I mean: image

            float y = Utils.GetHeight(current.From);  //Snap the first one 
            current.From = new Vector3(current.From.x, y, current.From.z);
            foreach (var point in points)
            {                
                if (Vector3.Distance(current.From, point) > distance)
                {
                    Vector3 dest = current.From + (point - current.From).normalized * distance;
                    dest.y = Utils.GetHeight(dest);
                    current.To = dest;
                    var temp = current.AddAfter().GetComponent<LineSegment<T>>();
                    temp.DataCopy(current);
                    current = temp;
                    current.From = dest;
                }
            }
            y = Utils.GetHeight(current.To); //Snap the last one 
            current.To = new Vector3(current.To.x, y, current.To.z);

Added 4 lines to LineSegment.cs so now when subdivision is clicked, from and to heights are also set. @moelang