CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
osm2odr
PlanView.h
Go to the documentation of this file.
1
// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2
// de Barcelona (UAB).
3
//
4
// This work is licensed under the terms of the MIT license.
5
// For a copy, see <https://opensource.org/licenses/MIT>.
6
7
#pragma once
8
9
#include <array>
10
#include <vector>
11
12
#include "
Geometry.h
"
13
14
namespace
twinmodel
{
15
16
/// A vertex whose rounding would pull the curve further than this off the
17
/// polyline becomes a corner instead; export/xodr.py's MAX_PLANVIEW_OFFSET.
18
constexpr
double
kMaxPlanViewOffset
= 0.25;
19
20
struct
Geom
{
21
double
s
= 0.0;
22
double
x
= 0.0;
23
double
y
= 0.0;
24
double
hdg
= 0.0;
25
double
length
= 0.0;
26
bool
is_line
=
true
;
27
/// aU bU cU dU aV bV cV dV, with aU = aV = bV = 0 by construction.
28
std::array<double, 8>
coeffs
{};
29
};
30
31
/// Fit a polyline as a piecewise cubic paramPoly3 planview. Tangent
32
/// directions are Catmull-Rom, magnitudes the chord length, each segment
33
/// expressed in the frame rotated to its start tangent so hdg stays G1.
34
std::vector<Geom>
FitPlanView
(
const
geom::Line3
&line,
35
double
max_offset =
kMaxPlanViewOffset
);
36
37
}
// namespace twinmodel
twinmodel::geom::Line3
std::vector< Point3 > Line3
Definition
osm2odr/Geometry.h:41
twinmodel
Definition
Frame.cpp:12
twinmodel::FitPlanView
std::vector< Geom > FitPlanView(const geom::Line3 &line, double max_offset)
Fit a polyline as a piecewise cubic paramPoly3 planview.
Definition
PlanView.cpp:102
twinmodel::kMaxPlanViewOffset
constexpr double kMaxPlanViewOffset
A vertex whose rounding would pull the curve further than this off the polyline becomes a corner inst...
Definition
PlanView.h:18
Geometry.h
twinmodel::Geom
Definition
PlanView.h:20
twinmodel::Geom::is_line
bool is_line
Definition
PlanView.h:26
twinmodel::Geom::length
double length
Definition
PlanView.h:25
twinmodel::Geom::x
double x
Definition
PlanView.h:22
twinmodel::Geom::coeffs
std::array< double, 8 > coeffs
aU bU cU dU aV bV cV dV, with aU = aV = bV = 0 by construction.
Definition
PlanView.h:28
twinmodel::Geom::s
double s
Definition
PlanView.h:21
twinmodel::Geom::y
double y
Definition
PlanView.h:23
twinmodel::Geom::hdg
double hdg
Definition
PlanView.h:24
Generated by
1.18.0