27 #include <unordered_map> 30 #include "modules/common/vehicle_state/proto/vehicle_state.pb.h" 32 #include "modules/localization/proto/localization.pb.h" 33 #include "modules/map/relative_map/proto/navigation.pb.h" 34 #include "modules/map/relative_map/proto/relative_map_config.pb.h" 35 #include "modules/perception/proto/perception_obstacle.pb.h" 42 namespace relative_map {
62 typedef std::tuple<int, double, double, std::shared_ptr<NavigationPath>>
108 void SetConfig(
const NavigationLaneConfig& config);
127 default_left_width_ = left_width;
128 default_right_width_ = right_width;
144 const perception::PerceptionObstacles& perception_obstacles) {
145 perception_obstacles_ = perception_obstacles;
155 const auto& current_navi_path = std::get<3>(current_navi_path_tuple_);
156 if (current_navi_path) {
157 return *current_navi_path;
159 return NavigationPath();
170 bool CreateMap(
const MapGenerationParam& map_config,
171 MapMsg*
const map_msg)
const;
184 double EvaluateCubicPolynomial(
const double c0,
const double c1,
185 const double c2,
const double c3,
186 const double x)
const;
197 double GetKappa(
const double c1,
const double c2,
const double c3,
210 common::PathPoint GetPathPointByS(
const common::Path& path,
211 const int start_index,
const double s,
212 int*
const matched_index);
221 void ConvertLaneMarkerToPath(
const perception::LaneMarkers& lane_marker,
222 common::Path*
const path);
233 bool ConvertNavigationLineToPath(
const int line_index,
234 common::Path*
const path);
243 void MergeNavigationLineAndLaneMarker(
const int line_index,
244 common::Path*
const path);
255 ProjIndexPair UpdateProjectionIndex(
const common::Path& path,
256 const int line_index);
265 void UpdateStitchIndexInfo();
269 NavigationLaneConfig config_;
272 perception::PerceptionObstacles perception_obstacles_;
275 NavigationInfo navigation_info_;
280 std::list<NaviPathTuple> navigation_path_list_;
286 double perceived_left_width_ = -1.0;
289 double perceived_right_width_ = -1.0;
292 double default_left_width_ = 1.875;
293 double default_right_width_ = 1.875;
297 std::unordered_map<int, ProjIndexPair> last_project_index_map_;
301 std::unordered_map<int, StitchIndexPair> stitch_index_map_;
304 localization::Pose original_pose_;
NavigationLane generates a real-time relative map based on navagation lines.
Definition: navigation_lane.h:97
The class of vehicle state. It includes basic information and computation about the state of the vehi...
Definition: vehicle_state_provider.h:46
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
NavigationPath Path() const
Get the generated lane segment where the vehicle is currently located.
Definition: navigation_lane.h:154
void UpdatePerception(const perception::PerceptionObstacles &perception_obstacles)
Update perceived lane line information.
Definition: navigation_lane.h:143
void SetDefaultWidth(const double left_width, const double right_width)
Set the default width of a lane.
Definition: navigation_lane.h:126
void SetVehicleStateProvider(common::VehicleStateProvider *vehicle_state_provider)
std::tuple< int, double, double, std::shared_ptr< NavigationPath > > NaviPathTuple
Definition: navigation_lane.h:63
bool CreateMap(const MapGenerationParam &map_config, MapMsg *const map_msg) const
Generate a real-time relative map of approximately 250 m in length based on several navigation line s...
~NavigationLane()=default
std::pair< int, double > ProjIndexPair
Definition: navigation_lane.h:74
void SetConfig(const NavigationLaneConfig &config)
Set the configuration information required by the NavigationLane.
bool GeneratePath()
Generate a suitable path (i.e. a navigation line segment).
void UpdateNavigationInfo(const NavigationInfo &navigation_info)
Update navigation line information.
std::pair< int, int > StitchIndexPair
Definition: navigation_lane.h:68