From cc1f60c2f1f4aa33cfa2078b8792d6135c299a57 Mon Sep 17 00:00:00 2001 From: Christoph Kochendoerfer <christoph.kochendoerfer@in-tech.com> Date: Fri, 6 Aug 2021 07:58:57 +0200 Subject: [PATCH] update after review --- .../MantleAPI/Traffic/control_strategy.h | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/MantleAPI/include/MantleAPI/Traffic/control_strategy.h b/MantleAPI/include/MantleAPI/Traffic/control_strategy.h index 7c551a8c..22dffa88 100644 --- a/MantleAPI/include/MantleAPI/Traffic/control_strategy.h +++ b/MantleAPI/include/MantleAPI/Traffic/control_strategy.h @@ -132,8 +132,6 @@ struct FollowLateralOffsetSplineControlStrategy : public ControlStrategy std::vector<mantle_api::SplineSection> lateral_offset_splines; }; -// TODO: Create new control strategy for following 3D trajectories with shapes NURBS, polyline, clothoid - struct FollowRouteControlStrategy : public ControlStrategy { FollowRouteControlStrategy() @@ -166,7 +164,7 @@ struct TransitionDynamics { Dimension dimension{Dimension::kUndefined}; Shape shape{Shape::kUndefined}; - double value{0}; + double value{0.0}; }; struct AcquireLaneOffsetControlStrategy : public ControlStrategy @@ -183,19 +181,27 @@ struct AcquireLaneOffsetControlStrategy : public ControlStrategy TransitionDynamics transition_dynamics; }; +enum class ReferenceContext +{ + kAbsolute = 0, + kRelative +}; + struct FollowTrajectoryControlStrategy : public ControlStrategy { + // TODO: Extend the FollowTrajectoryControlStrategy to support shapes like NURBS and clothoid + struct TrajectoryTimeReference { - std::string domainAbsoluteRelative; - double scale; - double offset; + ReferenceContext domainAbsoluteRelative; + double scale{0.0}; + double offset{0.0}; }; FollowTrajectoryControlStrategy() { movement_domain = MovementDomain::kBoth; - type = ControlStrategyType::kAcquireLaneOffset; + type = ControlStrategyType::kFollowTrajectory; } Trajectory trajectory; -- GitLab