Commit d987e505 authored by Nick Dunning's avatar Nick Dunning
Browse files

Add TrafficLightStateControlStrategy

parent fbb1fa81
......@@ -17,6 +17,7 @@
#include <MantleAPI/Common/spline.h>
#include <MantleAPI/Common/vector.h>
#include <MantleAPI/Traffic/traffic_light_properties.h>
#include <vector>
......@@ -28,7 +29,8 @@ enum class MovementDomain
kUndefined = 0,
kLateral,
kLongitudinal,
kBoth
kBoth,
kNone
};
enum class ControlStrategyType
......@@ -40,7 +42,8 @@ enum class ControlStrategyType
kFollowLateralOffsetSpline,
kFollowVelocitySpline,
kFollowRoute,
kAcquireLaneOffset
kAcquireLaneOffset,
kUpdateTrafficLightStates
};
struct ControlStrategy
......@@ -181,6 +184,18 @@ struct AcquireLaneOffsetControlStrategy : public ControlStrategy
TransitionDynamics transition_dynamics;
};
struct TrafficLightStateControlStrategy : public ControlStrategy
{
TrafficLightStateControlStrategy()
{
type = ControlStrategyType::kUpdateTrafficLightStates;
movement_domain = MovementDomain::kNone;
}
std::vector<TrafficLightPhase> traffic_light_phases{};
bool repeat_states{false};
};
} // namespace mantle_api
#endif // MANTLEAPI_TRAFFIC_CONTROLSTRATEGY_H
/*******************************************************************************
* Copyright (c) 2021, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
//-----------------------------------------------------------------------------
/** @file traffic_light_properties.h */
//-----------------------------------------------------------------------------
#ifndef MANTLEAPI_TRAFFIC_TRAFFICLIGHTPROPERTIES_H
#define MANTLEAPI_TRAFFIC_TRAFFICLIGHTPROPERTIES_H
#include <vector>
namespace mantle_api
{
enum class TrafficLightBulbColor
{
kUnknown = 0,
kOther = 1,
kRed = 2,
kYellow = 3,
kGreen = 4,
kBlue = 5,
kWhite = 6
};
enum class TrafficLightBulbMode
{
kUnknown = 0,
kOther = 1,
kOff = 2,
kConstant = 3,
kFlashing = 4,
kCounting = 5
};
struct TrafficLightBulbState
{
TrafficLightBulbColor color;
TrafficLightBulbMode mode;
};
struct TrafficLightPhase
{
std::vector<TrafficLightBulbState> bulb_states;
mantle_api::Time start_time{0};
mantle_api::Time end_time{0};
};
} // namespace mantle_api
#endif // MANTLEAPI_TRAFFIC_TRAFFICLIGHTPROPERTIES_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment