提交 dcccf41e 编写于 作者: J Jiangtao Hu 提交者: lianglia-apollo

fix trajectory relative time bug in aggregation and protect trajectory stitch with correct flag.

上级 aeb01675
......@@ -102,8 +102,7 @@ bool PlanningData::aggregate(const double time_resolution,
trajectory_point.mutable_path_point()->CopyFrom(path_point);
trajectory_point.set_v(speed_point.v());
trajectory_point.set_a(speed_point.a());
trajectory_point.set_relative_time(init_planning_point_.relative_time() +
speed_point.t());
trajectory_point.set_relative_time(speed_point.t());
trajectory->add_trajectory_point(trajectory_point);
}
return true;
......
......@@ -22,8 +22,8 @@ DEFINE_string(rtk_trajectory_filename, "modules/planning/data/garage.csv",
"Loop rate for planning node");
DEFINE_string(map_filename, "modules/map/data/base_map.txt", "map data file");
DEFINE_uint64(rtk_trajectory_backward, 10,
"The number of points to be included in RTK trajectory "
DEFINE_uint64(backward_trajectory_point_num, 10,
"The number of points to be included in planning trajectory "
"before the matched point");
DEFINE_uint64(rtk_trajectory_forward, 800,
......
......@@ -23,7 +23,7 @@ DECLARE_string(planning_config_file);
DECLARE_int32(planning_loop_rate);
DECLARE_string(rtk_trajectory_filename);
DECLARE_string(map_filename);
DECLARE_uint64(rtk_trajectory_backward);
DECLARE_uint64(backward_trajectory_point_num);
DECLARE_uint64(rtk_trajectory_forward);
DECLARE_double(replanning_threshold);
DECLARE_double(trajectory_resolution);
......
......@@ -252,7 +252,7 @@ bool Planning::Plan(const bool is_on_auto_mode, const double publish_time,
// a segment of last trajectory to be attached to planned trajectory in
// case controller needs.
GetOverheadTrajectory(static_cast<std::uint32_t>(matched_index),
static_cast<std::uint32_t>(FLAGS_rtk_trajectory_backward),
static_cast<std::uint32_t>(FLAGS_backward_trajectory_point_num),
trajectory_pb);
// store the planned trajectory and header info for next planning cycle.
......@@ -340,6 +340,10 @@ void Planning::Reset() {
void Planning::GetOverheadTrajectory(const std::uint32_t matched_index,
const std::uint32_t buffer_size,
ADCTrajectory* trajectory_pb) {
if (!FLAGS_use_stitch) {
ADEBUG << "Skip trajectory stich.";
return;
}
const std::uint32_t start_index =
matched_index < buffer_size ? 0 : matched_index - buffer_size;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册