28#include <unordered_set>
37#include "modules/common_msgs/prediction_msgs/feature.pb.h"
38#include "modules/prediction/proto/prediction_conf.pb.h"
39#include "modules/common_msgs/prediction_msgs/prediction_obstacle.pb.h"
57 static std::unique_ptr<Obstacle>
Create(
59 const double timestamp,
const int prediction_id,
73 junction_analyzer_ = junction_analyzer;
82 const double timestamp,
const int prediction_id);
194 bool IsInJunction(
const std::string& junction_id)
const;
260 void SetIsNearJunction(
267 void SetPolygonPoints(
279 void UpdateVelocity(
const double theta,
double* velocity_x,
280 double* velocity_y,
double* velocity_heading,
288 void SetLengthWidthHeight(
298 void SetSurroundingLaneIds(
Feature*
feature,
const double radius);
300 void SetLaneSequenceStopSign(
LaneSequence* lane_sequence_ptr);
306 void SetLanePoints(
const Feature*
feature,
const double lane_point_spacing,
307 const uint64_t max_num_lane_point,
308 const bool is_bidirection,
LaneGraph*
const lane_graph);
312 void SetLaneSequencePath(
LaneGraph*
const lane_graph);
314 void SetMotionStatus();
316 void SetMotionStatusBySpeed();
320 void SetJunctionFeatureWithEnterLane(
const std::string& enter_lane_id,
323 void SetJunctionFeatureWithoutEnterLane(
Feature*
const feature_ptr);
325 void DiscardOutdatedHistory();
327 void GetNeighborLaneSegments(
328 std::shared_ptr<const apollo::hdmap::LaneInfo> center_lane_info,
329 bool is_left,
int recursion_depth,
330 std::list<std::string>*
const lane_ids_ordered,
331 std::unordered_set<std::string>*
const existing_lane_ids);
333 bool HasJunctionExitLane(
335 const std::unordered_set<std::string>& exit_lane_id_set);
340 int id_ = FLAGS_ego_vehicle_id;
345 std::deque<Feature> feature_history_;
347 std::vector<std::shared_ptr<const hdmap::LaneInfo>> current_lanes_;
bool IsInJunction(const std::string &junction_id) const
Check if the obstacle is a junction.
double timestamp() const
Get the obstacle's timestamp.
bool HasJunctionFeatureWithExits() const
Check if the obstacle has junction feature.
bool ReceivedOlderMessage(const double timestamp) const
bool IsNearJunction()
Check if the obstacle is near a junction.
void SetNearbyObstacles()
Set nearby obstacles.
Feature * mutable_feature(const size_t i)
Get a pointer to the ith feature from latest to earliest.
Feature * mutable_latest_feature()
Get a pointer to the latest feature.
void BuildLaneGraphFromLeftToRight()
Build obstacle's lane graph with lanes being ordered.
void BuildLaneGraph()
Build obstacle's lane graph
void ClearOldInformation()
bool IsPedestrian() const
perception::PerceptionObstacle::Type type() const
Get the type of perception obstacle's type.
bool IsCloseToJunctionExit() const
Check if the obstacle is close to a junction exit.
void TrimHistory(const size_t remain_size)
bool IsStill()
Check if the obstacle is still.
bool InsertFeature(const Feature &feature)
Insert a feature proto message.
void SetNonInteractiveTag()
Set the obstacle as noninteractive obstacle.
void SetInteractiveTag()
Set the obstacle as interactive obstacle.
int id() const
Get the obstacle's ID.
bool ToIgnore()
Check if the obstacle can be ignored.
size_t history_size() const
Get the number of historical features.
virtual ~Obstacle()=default
Destructor
const Feature & feature(const size_t i) const
Get the ith feature from latest to earliest.
bool IsInteractiveObstacle() const
PredictionObstacle GeneratePredictionObstacle()
bool Insert(const perception::PerceptionObstacle &perception_obstacle, const double timestamp, const int prediction_id)
Insert a perception obstacle with its timestamp.
void BuildJunctionFeature()
Build junction feature.
void SetJunctionAnalyzer(JunctionAnalyzer *junction_analyzer)
void SetEvaluatorType(const ObstacleConf::EvaluatorType &evaluator_type)
bool IsOnLane() const
Check if the obstacle is on any lane.
void SetPredictorType(const ObstacleConf::PredictorType &predictor_type)
const Feature & earliest_feature() const
Get the earliest feature.
bool IsSlow()
Check if the obstacle is slow.
void SetCaution()
Set the obstacle as caution level
static std::unique_ptr< Obstacle > Create(const perception::PerceptionObstacle &perception_obstacle, const double timestamp, const int prediction_id, ObstacleClusters *clusters_ptr)
Constructor
const Feature & latest_feature() const
Get the latest feature.
const ObstacleConf & obstacle_conf()
Defines the templated KalmanFilter class.
Defines the DigitalFilter class.