Waypoints fixes, but still inverted for now
This commit is contained in:
parent
e9bd864426
commit
f9dbee7ba6
|
@ -55,11 +55,12 @@ namespace geom {
|
|||
p.y = -p.y;
|
||||
start_pos.y = -start_pos.y;
|
||||
heading = -heading;
|
||||
curvature = -curvature;
|
||||
|
||||
// since this algorithm is working for positive curvatures,
|
||||
// and we are only calculating distances, we can invert the y
|
||||
// axis (along with the curvature and the heading), so if the
|
||||
// curvature is negative, so the algorithm will work as expected
|
||||
// curvature is negative, the algorithm will work as expected
|
||||
if (curvature < 0.0) {
|
||||
p.y = -p.y;
|
||||
start_pos.y = -start_pos.y;
|
||||
|
|
|
@ -214,7 +214,7 @@ namespace road {
|
|||
lane_tangent = computed_width.second;
|
||||
}
|
||||
|
||||
// get a directed pooint in s and apply the computed lateral offet
|
||||
// get a directed point in s and apply the computed lateral offet
|
||||
DirectedPoint dp = road->GetDirectedPointIn(waypoint.s);
|
||||
|
||||
geom::Rotation rot(
|
||||
|
|
|
@ -177,7 +177,7 @@ namespace road {
|
|||
const auto lane_offset = _info.GetInfo<element::RoadInfoLaneOffset>(clamped_s);
|
||||
const float offset = lane_offset->GetPolynomial().Evaluate(clamped_s);
|
||||
|
||||
element::DirectedPoint p = geometry->GetGeometry().PosFromDist(clamped_s);
|
||||
element::DirectedPoint p = geometry->GetGeometry().PosFromDist(clamped_s - geometry->GetDistance());
|
||||
p.ApplyLateralOffset(offset);
|
||||
|
||||
const auto elevation_info = GetElevationOn(s);
|
||||
|
|
|
@ -157,11 +157,11 @@ namespace element {
|
|||
assert(std::fabs(_curvature) > 1e-15);
|
||||
const double radius = 1.0 / _curvature;
|
||||
DirectedPoint p(_start_position, _heading);
|
||||
p.location.x -= radius * std::cos(p.tangent + geom::Math::pi_half());
|
||||
p.location.y -= radius * std::sin(p.tangent + geom::Math::pi_half());
|
||||
p.tangent -= dist * _curvature;
|
||||
p.location.x += radius * std::cos(p.tangent + geom::Math::pi_half());
|
||||
p.location.y += radius * std::sin(p.tangent + geom::Math::pi_half());
|
||||
p.tangent += dist * _curvature;
|
||||
p.location.x -= radius * std::cos(p.tangent + geom::Math::pi_half());
|
||||
p.location.y -= radius * std::sin(p.tangent + geom::Math::pi_half());
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue