pageldev / libOpenDRIVE

Small, lightweight C++ library for handling OpenDRIVE files
Apache License 2.0
401 stars 141 forks source link

Some infinite looping bug occurred #12

Closed CodeBiang closed 2 years ago

CodeBiang commented 3 years ago
// 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?

pageldev commented 2 years ago

duplicate of #13