Giter VIP home page Giter VIP logo

libopendrive's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libopendrive's Issues

any plan on junction element?

i'm wondering about routing(path planning) on .xodr, which may require a node-edge based data structure, is there any plan or roadmap on implementing more OpenDrive features?
ps. libOpenDRIVE is a great project

Rotation in odrviewer.io not possible, zoom mousewheel direction inconsistent

I noticed that the it is not possible to rotate the view in https://odrviewer.io/ like it is in https://sebastian-pagel.net/odrviewer/

Also the direction of the mouse wheel zoom is inconsistent (between https://odrviewer.io/ and https://sebastian-pagel.net/odrviewer/).
I recommend you to use the same direction as https://www.google.com/maps/ does (also Blender and many other tools), since most of the people are used to that:

  • Mousewheel up -> Zoom in
  • Mousewheel down -> Zoom out

get .obj file from the code

  1. I want to get .obj file from the code How Could i get it..?!

  2. In web site (https://odrviewer.io/), if i push 'export .obj' button, the screen become black like under picture.
    How could i use the function? please explain the function, thank you.
    image
    image

OSM/Lanelet export

One feature that could be quite nice would be to export the map to various different file formats, such as lanelet2, osm, rd5, etc.

Can't access to the ParamPoly3 variables.

Thank you for the great work for all of the contributors here!
I tried to access the Parampoly3 members but I think the data was not stored in the map reading step.
When I access Parampoly3, I used the code line below.
aU = road->ref_line->s0_to_geometry[0.0]->aU;

Compile error

In Util.hpp file, you using __FILE_NAME__ to get file name, but it is __FILE__ in my environment.

[ 47%] Building CXX object CMakeFiles/OpenDrive.dir/OpenDriveMap.cpp.o
In file included from /home/hero/project/simulation/libOpenDRIVE/RoadMark.h:4:0,
                 from /home/hero/project/simulation/libOpenDRIVE/Lanes.h:6,
                 from /home/hero/project/simulation/libOpenDRIVE/LaneSection.h:3,
                 from /home/hero/project/simulation/libOpenDRIVE/Road.h:4,
                 from /home/hero/project/simulation/libOpenDRIVE/OpenDriveMap.h:4,
                 from /home/hero/project/simulation/libOpenDRIVE/OpenDriveMap.cpp:1:
/home/hero/project/simulation/libOpenDRIVE/OpenDriveMap.cpp: In constructor ‘odr::OpenDriveMap::OpenDriveMap(std::__cxx11::string, bool, bool, bool)’:
/home/hero/project/simulation/libOpenDRIVE/Utils.hpp:25:53: error: ‘__FILE_NAME__’ was not declared in this scope
             printf("[%s:%d %s] check failed: %s\n", __FILE_NAME__, __LINE__, __FUNCTION__, msg);                                                     \
                                                     ^
/home/hero/project/simulation/libOpenDRIVE/OpenDriveMap.cpp:59:9: note: in expansion of macro ‘CHECK_AND_REPAIR’
         CHECK_AND_REPAIR(road->length >= 0, "road::length < 0", road->length = 0);
         ^~~~~~~~~~~~~~~~
/home/hero/project/simulation/libOpenDRIVE/Utils.hpp:25:53: note: suggested alternative: ‘__FLT_MAX__’
             printf("[%s:%d %s] check failed: %s\n", __FILE_NAME__, __LINE__, __FUNCTION__, msg);                                                     \
                                                     ^
/home/hero/project/simulation/libOpenDRIVE/OpenDriveMap.cpp:59:9: note: in expansion of macro ‘CHECK_AND_REPAIR’
         CHECK_AND_REPAIR(road->length >= 0, "road::length < 0", road->length = 0);
         ^~~~~~~~~~~~~~~~
/home/hero/project/simulation/libOpenDRIVE/Utils.hpp:25:53: error: ‘__FILE_NAME__’ was not declared in this scope
             printf("[%s:%d %s] check failed: %s\n", __FILE_NAME__, __LINE__, __FUNCTION__, msg);                                                     \

Lost laneOffset attribute

In Opendrive there is an attribute called laneOffset, it is not included in this library. It's an attribute of lanesection.
image

Viewer interface in old version

I happened to notice that the Viewer still looks like the old viewer from some months ago and not like the current one available at https://odrviewer.io/. Is there any plans to release the code for that as well and replace the current Viewer with it?

implement signal parsing

Hello author, thank you very much for open source such a powerful library, I think it fills the gap of opendrive official does not provide parsing library.
I find that the signal element of opendrive may represent the signal element differently. Is that why you didn't parse signal?

RefLine::match gives wrong result

I use the code following:
double s = odr_ref.match(destPoint[0], destPoint[1])
I want to use the destPoint to get the s,but the result of s isn't matched the real map, so can you offer some refference or the functions of the function.

<outline> should supersede the object's bounding box

As per the Opendrive (1.6 and 1.7) documentation:
Complex objects may be further described using <outline> elements. If an <outline> is defined, it supersedes the bounding box.

object_outline

Issue: In my case, element doesn't supersede object's attribute. I don't see any impact of element. As per above docs, Object should be drawn according to element if it is provided.

Here is a sample Object element with outline. This snippet can be placed inside any road object .

<objects>
            <object type="crosswalk" id="10" s="10.0" t="0.0" zOffset="0.0"
            orientation="none" length="15.0" width="10.0" hdg="0.0" pitch="0.0" roll="0.0">
            <outlines>
                  <outline id="0">
                  <cornerRoad s="5.0" t="3.5" dz="0.0" height="4.0" id="0"/>
                  <cornerRoad s="8.0" t="-3.5" dz="0.0" height="4.0" id="1"/>
                  <cornerRoad s="12.0" t="-3.5" dz="0.0" height="4.0" id="2"/>
                  <cornerRoad s="15.0" t="3.5" dz="0.0" height="4.0" id="3"/>
               </outline>
            </outlines>
            </object>
 </objects>

How to reproduce:

  1. let's open any xodr file for edit.
  2. find any road element and place above snippet just before the closing element
  3. Save the file and load this file into opendrive viewer.
  4. We will find that there is no impact of element as length and width of the object is 15 and 10 respectively. As per the outline element it should 10 and 7 respectively.
  5. Now let's remove the element from element and open it again in opendrive viewer, We will find that object looks same as before.

    References:
    OD1.6 -> https://releases.asam.net/OpenDRIVE/1.6.0/ASAM_OpenDRIVE_BS_V1-6-0.html#_objects
    OD1.7 -> https://www.asam.net/index.php?eID=dumpFile&t=f&f=4422&token=e590561f3c39aa2260e5442e29e93f6693d1cccd#top-e12007a5-2961-4fa0-9de7-cf748a4f26ab

react support

I want to use it in react, can you write a sample for me.
Thanks

Lane.cpp get_roadmarks() function may not return the correct roadmarks between the start and end range.

In Lane.cpp, the function:

std::vector<RoadMark> Lane::get_roadmarks(double s_start, double s_end) const

I think there might be a bug in the comparison code for getting the upper_bound iterator as it currently is:

[](const double& s, const RoadMarkGroup& rmg) -> bool { return (rmg.lanesection_s0 + rmg.s_offset) < s; });

I think the comparison function for upper_bound should instead be:

[](const double& s, const RoadMarkGroup& rmg) -> bool { return s < (rmg.lanesection_s0 + rmg.s_offset); });

According to: https://en.cppreference.com/w/cpp/algorithm/upper_bound

The 1st argument 's' should compare less than the 2nd argument 'rmg'.

The comparison function for lower_bound later in the function is correct because 's' is the 2nd argument in that case.

parampoly3 parameters

Thank you. I appreciate it. I'd like to know how you calculated the equation for finding parampoly3 parameters at known control points. Thank you very much~

some infinite looping bug

// at Lanes.cpp#187
            for (const auto& s_roadmarks_line : roadmark_group.s_to_roadmarks_line)
            {
                const RoadMarksLine& roadmarks_line = s_roadmarks_line.second;
                if (roadmarks_line.width > 0)
                    width = roadmarks_line.width;
                // roadmarks_line.length + roadmarks_line.space equals zero in some xodr files
                for (double s_start_single_roadmark = s_roadmarks_line.first; s_start_single_roadmark < s_end_roadmark_group;
                     s_start_single_roadmark += (roadmarks_line.length + roadmarks_line.space))
                {
                    const double s_end_single_roadmark = std::min(s_end, s_start_single_roadmark + roadmarks_line.length);
                    roadmarks.push_back(
                        {s_start_single_roadmark, s_end_single_roadmark, roadmarks_line.t_offset, width, roadmark_group.type + roadmarks_line.name});
                }
            }

roadmarks_line.length + roadmarks_line.space equals zero in some xodr files

in addition, I want to further encapsulate this library with typescript. Any suggestions?

how to draw objects in js?

I see that there is parsing objects record in the c++ code, but I don't know how to draw with these data, can you please provide an example in the viewer or briefly describe how to use the road_objects_mesh data?

Thanks!

traffic rule and routing

Hello,I am very interested in your project and I benefit a lot.Do you have any plans about adding association between opendrive map elements and related traffic rules or utilizing map data to generate a routing map?

Will you have plan to add locate function?

The function likes that input the point coordinates in the world, output the point location in th map, including the RoidID, so much location infromaton as the s 、 t and LaneID.

error when 'make'

error: no matching function for call to ‘isnan<double>(const double&)’
change isnan<double> to isnan  (delete <double>)

about obj file

Hi I'm trying to import obj file (exported from odrviewer) to Unreal Engine4.
When I import obj file, It shows shape of the road but I can't see any roadmarks, lane, reference line, and etc.
Am I missing any procedure or is this feature not supported originally?
I will be glad to receive any recommendations to help solving this problem.

image

RoadLink is empty

In my using case, i want to use link information, but it's all empty, but i checked xodr file, there is link node and has value for each key.Then i try to print it's value, but i got empty. After i check other node, you using attribute function to extract it's value, then it appeared.
image
image

optimization

I'm sorry to bother you again. I try to fit this road like number 8 with Bezier curve, but I find that my result is wavy line. Do I want to know what optimization method is available,thank you very much

ParamPoly3 :need help

First ,It's a great project. I am doing something like converting some data to opendrive files,but i met some problems by converting to ParamPoly3 geometry . I think maybe I will be inspired by this project,but i really don't understand how to build ParamPoly3 after i read the code. Could you please give me some explanations ? Thanks a lot~

Mouse posion does not response correctly

Firstly, this is a really nice project.
There is a issue , i can not pick the road with my mouse point over the road, there is an offset between mouse and road.

feature: add scenario?

Any plans about adding OpenScenario? like playing Scenarios according to the .xodr and .xosc files and make web animation.

All values in vertices is nan

Hi, I can't get valid lane coordinates, just added output in test.cpp of lane points, my output is all nan
for(auto p: lane_pts) { printf("%.2f %.2f %.2f\n", p[0], p[1], p[2]); }

./test-xodr ../Viewer/data.xodr

road: 500, length: 16.52
road: 501, length: 4.00
road: 502, length: 4.00
road: 503, length: 16.52
road: 504, length: 20.00
road: 505, length: 20.00
road: 506, length: 20.00
road: 507, length: 20.00
road: 508, length: 541.50
road: 509, length: 541.50
road: 510, length: 16.12
road: 511, length: 16.12
road: 512, length: 16.12
road: 513, length: 16.12
road: 514, length: 4.00
road: 515, length: 16.52
road: 516, length: 4.00
road: 517, length: 16.52
Finished, got 320 lane points, 256 roadmark points
-nan -nan -nan
-nan -nan -nan
-nan -nan -nan
-nan -nan -nan
-nan -nan -nan
-nan -nan -nan
-nan -nan -nan
-nan -nan -nan
-nan -nan -nan

Compilation Error on Ubuntu 22.04 (error: ‘plus’ is not a member of ‘std’)

Somehow on my machine (Ubuntu 22.04 LTS) compilation fails with the following errors:

libOpenDRIVE/include/Math.hpp:47:35: error: ‘plus’ is not a member of ‘std’
libOpenDRIVE/include/Math.hpp:53:35: error: ‘minus’ is not a member of ‘std’; did you mean ‘min’?
libOpenDRIVE/include/Math.hpp:80:66: error: ‘multiplies’ is not a member of ‘std’

Even though it should be in the standard of c++14 (https://en.cppreference.com/w/cpp/utility/functional/plus) compilation fails.
I've tried to update gcc and c++ from 9.4.0 to 11.3.0 but this did not resolve the issues.

After changing CMAKE_CXX_STANDARD to 17 or above, the issues are resolved (I still need to resolve #46 but after that, it works).

So for anyone else with issues like that, change https://github.com/grepthat/libOpenDRIVE/blob/master/CMakeLists.txt#L8 to set(CMAKE_CXX_STANDARD 17).

From my side this issue can immediately be resolved since it isn't an issue regarding this lib. But wanted to share the issue for anyone else having trouble.

Some infinite looping bug occurred

// at Lanes.cpp#187
            for (const auto& s_roadmarks_line : roadmark_group.s_to_roadmarks_line)
            {
                const RoadMarksLine& roadmarks_line = s_roadmarks_line.second;
                if (roadmarks_line.width > 0)
                    width = roadmarks_line.width;
                // roadmarks_line.length + roadmarks_line.space equals zero in some xodr files
                for (double s_start_single_roadmark = s_roadmarks_line.first; s_start_single_roadmark < s_end_roadmark_group;
                     s_start_single_roadmark += (roadmarks_line.length + roadmarks_line.space))
                {
                    const double s_end_single_roadmark = std::min(s_end, s_start_single_roadmark + roadmarks_line.length);
                    roadmarks.push_back(
                        {s_start_single_roadmark, s_end_single_roadmark, roadmarks_line.t_offset, width, roadmark_group.type + roadmarks_line.name});
                }
            }

roadmarks_line.length + roadmarks_line.space equals zero in some xodr files

in addition, I want to further encapsulate this library with typescript. Any suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.