Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions modules/dreamview/backend/sim_control/sim_control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ void SimControl::InitStartPoint(double start_velocity,
// Use the latest localization position as start point,
// fall back to a dummy point from map
localization_reader_->Observe();
if (localization_reader_->Empty()) {
const auto& localization = localization_reader_->GetLatestObserved();
if (localization == nullptr ||
localization->header().module_name() == "SimControl") {
start_point_from_localization_ = false;
apollo::common::PointENU start_point;
if (!map_service_->GetStartPoint(&start_point)) {
Expand All @@ -139,7 +141,6 @@ void SimControl::InitStartPoint(double start_velocity,
point.set_a(start_acceleration);
} else {
start_point_from_localization_ = true;
const auto& localization = localization_reader_->GetLatestObserved();
const auto& pose = localization->pose();
point.mutable_path_point()->set_x(pose.position().x());
point.mutable_path_point()->set_y(pose.position().y());
Expand Down