Skip to content

Commit

Permalink
Merge v6.1_turn_around to master (ApolloAuto#13970)
Browse files Browse the repository at this point in the history
  • Loading branch information
spicyog authored Jul 23, 2021
1 parent ac8cb20 commit 6db2a1b
Show file tree
Hide file tree
Showing 96 changed files with 3,872 additions and 229 deletions.
1 change: 1 addition & 0 deletions modules/common/monitor_log/proto/monitor_log.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ message MonitorMessageItem {
MOBILEYE = 18;
DELPHI_ESR = 19;
STORYTELLING = 20;
TASK_MANAGER = 21;
}

optional MessageSource source = 1 [default = UNKNOWN];
Expand Down
15 changes: 1 addition & 14 deletions modules/dreamview/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@rules_cc//cc:defs.bzl", "cc_binary")
load("//tools/platform:build_defs.bzl", "copts_if_teleop")
load("//tools/install:install.bzl", "install", "install_files")
load("//tools/install:install.bzl", "install")
load("//tools:cpplint.bzl", "cpplint")

package(default_visibility = ["//visibility:public"])
Expand Down Expand Up @@ -40,22 +40,9 @@ install(
":dreamview_conf",
":frontend",
],
runtime_dest = "modules/dreamview",
targets = ["dreamview"],
deps = [
":pb_dreamview",
"//cyber:install",
"//modules/calibration:install",
"//modules/common/data:install",
],
)

install_files(
name = "pb_dreamview",
dest = "modules/dreamview",
files = [
"//modules/dreamview/proto:chart_py_pb2",
"//modules/dreamview/proto:preprocess_table_py_pb2",
],
)

Expand Down
6 changes: 5 additions & 1 deletion modules/dreamview/backend/common/dreamview_gflags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ DEFINE_string(default_data_collection_config_path,
"/apollo/modules/dreamview/conf/data_collection_table.pb.txt",
"Data collection table config path.");

DEFINE_double(loop_routing_end_to_start_distance_threshold, 10.0,
DEFINE_int32(loop_routing_end_to_start_distance_threshold, 10,
"Loop routing distance threshold: start to end");

DEFINE_string(default_preprocess_config_path,
Expand All @@ -108,3 +108,7 @@ DEFINE_string(lidar_calibration_mode, "Lidar-IMU Sensor Calibration",

DEFINE_string(camera_calibration_mode, "Camera-Lidar Sensor Calibration",
"Name of camera_to_lidar calibration mode.");

DEFINE_double(parking_routing_distance_threshold, 20.0,
"For open space planner parking situation: get the routing"
"end point based on this threshold.");
4 changes: 3 additions & 1 deletion modules/dreamview/backend/common/dreamview_gflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ DECLARE_int32(monitor_msg_pending_queue_size);

DECLARE_string(default_data_collection_config_path);

DECLARE_double(loop_routing_end_to_start_distance_threshold);
DECLARE_int32(loop_routing_end_to_start_distance_threshold);

DECLARE_string(default_preprocess_config_path);

Expand All @@ -69,3 +69,5 @@ DECLARE_string(vehicle_calibration_mode);
DECLARE_string(lidar_calibration_mode);

DECLARE_string(camera_calibration_mode);

DECLARE_double(parking_routing_distance_threshold);
3 changes: 1 addition & 2 deletions modules/dreamview/backend/hmi/hmi_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,7 @@ void HMIWorker::SubmitDriveEvent(const uint64_t event_time_ms,

void HMIWorker::SensorCalibrationPreprocess(const std::string& task_type) {
std::string start_command = absl::StrCat(
"nohup bash /apollo/modules/tools/sensor_calibration/extract_data.sh -t ",
task_type, " &");
"nohup bash /apollo/scripts/extract_data.sh -t ", task_type, " &");
System(start_command);
}

Expand Down
47 changes: 47 additions & 0 deletions modules/dreamview/backend/map/map_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,36 @@ bool MapService::ConstructLaneWayPointWithHeading(
return true;
}

bool MapService::ConstructLaneWayPointWithLaneId(
const double x, const double y, const std::string id,
routing::LaneWaypoint *laneWayPoint) const {
LaneInfoConstPtr lane = HDMap()->GetLaneById(hdmap::MakeMapId(id));
if (!lane) {
return false;
}

if (!CheckRoutingPointLaneType(lane)) {
return false;
}

double s, l;
PointENU point;
point.set_x(x);
point.set_y(y);

if (!lane->GetProjection({point.x(), point.y()}, &s, &l)) {
return false;
}

laneWayPoint->set_id(id);
laneWayPoint->set_s(s);
auto *pose = laneWayPoint->mutable_pose();
pose->set_x(x);
pose->set_y(y);

return true;
}

bool MapService::CheckRoutingPoint(const double x, const double y) const {
double s, l;
LaneInfoConstPtr lane;
Expand All @@ -441,6 +471,23 @@ bool MapService::CheckRoutingPoint(const double x, const double y) const {
return true;
}

bool MapService::CheckRoutingPointLaneId(
const double x, const double y, std::vector<std::string> idsArr) const {
if (idsArr.empty()) {
return false;
}
double s, l;
LaneInfoConstPtr lane;
if (!GetNearestLane(x, y, &lane, &s, &l)) {
return false;
}
if (!CheckRoutingPointLaneType(lane)) {
return false;
}
return std::find(idsArr.begin(), idsArr.end(), lane->id().id()) !=
idsArr.end();
}

bool MapService::CheckRoutingPointLaneType(LaneInfoConstPtr lane) const {
if (lane->lane().type() != Lane::CITY_DRIVING) {
AERROR
Expand Down
11 changes: 10 additions & 1 deletion modules/dreamview/backend/map/map_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
#include <boost/thread/locks.hpp>
#include <boost/thread/shared_mutex.hpp>

#include "nlohmann/json.hpp"

#include "modules/dreamview/proto/simulation_world.pb.h"

#include "modules/map/pnc_map/pnc_map.h"
#include "nlohmann/json.hpp"

/**
* @namespace apollo::dreamview
Expand Down Expand Up @@ -76,8 +78,15 @@ class MapService {
const double x, const double y, const double heading,
routing::LaneWaypoint *laneWayPoint) const;

bool ConstructLaneWayPointWithLaneId(
const double x, const double y, const std::string id,
routing::LaneWaypoint *laneWayPoint) const;

bool CheckRoutingPoint(const double x, const double y) const;

bool CheckRoutingPointLaneId(const double x, const double y,
const std::vector<std::string> idsArr) const;

bool CheckRoutingPointLaneType(apollo::hdmap::LaneInfoConstPtr lane) const;

// Reload map from current FLAGS_map_dir.
Expand Down
7 changes: 4 additions & 3 deletions modules/dreamview/backend/sim_control/sim_control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ void SimControl::InitTimerAndIO() {
false));
}

void SimControl::Init(double start_velocity,
void SimControl::Init(bool set_start_point, double start_velocity,
double start_acceleration) {
if (!FLAGS_use_navigation_mode) {
if (set_start_point && !FLAGS_use_navigation_mode) {
InitStartPoint(start_velocity, start_acceleration);
}
}
Expand Down Expand Up @@ -252,7 +252,8 @@ void SimControl::Start() {
// When localization is already available, we do not need to
// reset/override the start point.
localization_reader_->Observe();
Init(next_point_.has_v() ? next_point_.v() : 0.0,
Init(localization_reader_->Empty(),
next_point_.has_v() ? next_point_.v() : 0.0,
next_point_.has_a() ? next_point_.a() : 0.0);

InternalReset();
Expand Down
2 changes: 1 addition & 1 deletion modules/dreamview/backend/sim_control/sim_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class SimControl : SimControlInterface {
* @brief setup callbacks and timer
* @param set_start_point initialize localization.
*/
void Init(double start_velocity = 0.0,
void Init(bool set_start_point, double start_velocity = 0.0,
double start_acceleration = 0.0) override;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class SimControlInterface {
/**
* @brief Initialization.
*/
virtual void Init(double start_velocity = 0.0,
virtual void Init(bool set_start_point, double start_velocity = 0.0,
double start_acceleration = 0.0) = 0;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,7 @@ void SimulationWorldService::UpdateSimulationWorld(const Chassis &chassis) {

auto_driving_car->set_disengage_type(DeduceDisengageType(chassis));

auto_driving_car->set_battery_percentage(
chassis.battery_soc_percentage());
auto_driving_car->set_battery_percentage(chassis.battery_soc_percentage());
auto_driving_car->set_gear_location(chassis.gear_location());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "modules/common/adapters/adapter_gflags.h"
#include "modules/common/configs/vehicle_config_helper.h"
#include "modules/common/math/quaternion.h"

#include "modules/dreamview/backend/common/dreamview_gflags.h"

using apollo::canbus::Chassis;
Expand Down
Loading

0 comments on commit 6db2a1b

Please sign in to comment.