提交 443923b9 编写于 作者: L Liangliang Zhang 提交者: Jiangtao Hu

Relative Map: fixed a bug and added topic config in adapter.conf

上级 cda1059a
......@@ -168,8 +168,9 @@ double Gaussian(const double u, const double std, const double x);
// Sigmoid
double Sigmoid(const double x);
// Rotate Axis (2D): the theta represents the angle when rotate axis of (x0, y0)
// to axis of (x1, y1)
// Rotate Axis (2D):
// convert a point (x0, y0) in axis1 to a point (x1, y1) in axis2 where the
// angle from axis1 to axis2 is theta
void RotateAxis(const double theta, const double x0, const double y0,
double *x1, double *y1);
......
......@@ -4,13 +4,28 @@ config {
message_history_limit: 1
}
config {
type: RELATIVE_MAP
mode: PUBLISH_ONLY
latch: true
type: NAVIGATION
mode: RECEIVE_ONLY
message_history_limit: 1
}
config {
type: MONITOR
mode: PUBLISH_ONLY
message_history_limit: 1
}
config {
type: LOCALIZATION
mode: RECEIVE_ONLY
message_history_limit: 1
}
config {
type: CHASSIS
mode: RECEIVE_ONLY
message_history_limit: 1
}
config {
type: RELATIVE_MAP
mode: PUBLISH_ONLY
latch: true
}
is_ros: true
--flagfile=modules/common/data/global_flagfile.txt
--use_navigation_mode
......@@ -37,8 +37,8 @@ bool NavigationLane::Update(const PerceptionObstacles& perception_obstacles) {
// update adc_state_ from VehicleStateProvider
adc_state_ = VehicleStateProvider::instance()->vehicle_state();
// TODO(All): lane_marker --> navigation path
// TODO(All): consider lane_marker qualities when converting lane_marker to
// navigation path
navigation_path_.Clear();
auto* path = navigation_path_.mutable_path();
ConvertLaneMarkerToPath(perception_obstacles_.lane_marker(), path);
......
......@@ -77,6 +77,12 @@ Status RelativeMap::Init() {
AERROR << error_msg;
return Status(ErrorCode::RELATIVE_MAP_ERROR, error_msg);
}
if (AdapterManager::GetNavigation() == nullptr) {
std::string error_msg(
"Navigation should be configured as dependency in adapter.conf");
AERROR << error_msg;
return Status(ErrorCode::RELATIVE_MAP_ERROR, error_msg);
}
return Status::OK();
}
......@@ -94,8 +100,9 @@ apollo::common::Status RelativeMap::Start() {
}
void RelativeMap::RunOnce(const PerceptionObstacles& perception_obstacles) {
MapMsg map_msg;
AdapterManager::Observe();
MapMsg map_msg;
CreateMapFromPerception(perception_obstacles, &map_msg);
Publish(&map_msg);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册