提交 67ad6208 编写于 作者: J JasonZhou404 提交者: Qi Luo

Planning: fix bug in open space wrapper

上级 0d53925e
......@@ -488,13 +488,13 @@ void DistanceGetResult(ResultContainer* result_ptr,
size_t size_by_distance = result_ptr->PrepareStateResult()->cols();
AERROR_IF(size != size_by_distance)
<< "sizes by hybrid A and distance approach not consistent";
for (size_t i = 0; i < size; i++) {
for (size_t i = 0; i < size; ++i) {
x[i] = result_ptr->GetX()->at(i);
y[i] = result_ptr->GetY()->at(i);
phi[i] = result_ptr->GetPhi()->at(i);
v[i] = result_ptr->GetV()->at(i);
}
for (size_t i = 0; i < size - 1; i++) {
for (size_t i = 0; i + 1 < size; ++i) {
a[i] = result_ptr->GetA()->at(i);
steer[i] = result_ptr->GetSteer()->at(i);
}
......@@ -502,7 +502,7 @@ void DistanceGetResult(ResultContainer* result_ptr,
size_t obstacles_edges_sum = obstacles_ptr->GetObstaclesEdgesNum().sum();
size_t obstacles_num_to_car = 4 * obstacles_ptr->GetObstaclesNum();
for (size_t i = 0; i < size_by_distance; i++) {
for (size_t i = 0; i < size_by_distance; ++i) {
opt_x[i] = (*(result_ptr->PrepareStateResult()))(0, i);
opt_y[i] = (*(result_ptr->PrepareStateResult()))(1, i);
opt_phi[i] = (*(result_ptr->PrepareStateResult()))(2, i);
......@@ -511,19 +511,19 @@ void DistanceGetResult(ResultContainer* result_ptr,
if (result_ptr->PrepareLResult()->cols() != 0 &&
result_ptr->PrepareTimeResult() != 0 &&
result_ptr->PrepareNResult() != 0) {
for (size_t i = 0; i < size_by_distance; i++) {
for (size_t i = 0; i + 1 < size_by_distance; ++i) {
opt_time[i] = (*(result_ptr->PrepareTimeResult()))(0, i);
for (size_t j = 0; j < obstacles_edges_sum; j++) {
for (size_t j = 0; j < obstacles_edges_sum; ++j) {
opt_dual_l[i * obstacles_edges_sum + j] =
(*(result_ptr->PrepareLResult()))(j, i);
}
for (size_t k = 0; k < obstacles_num_to_car; k++) {
for (size_t k = 0; k < obstacles_num_to_car; ++k) {
opt_dual_n[i * obstacles_num_to_car + k] =
(*(result_ptr->PrepareNResult()))(k, i);
}
}
}
for (size_t i = 0; i < size_by_distance - 1; i++) {
for (size_t i = 0; i + 1 < size_by_distance; ++i) {
opt_a[i] = (*(result_ptr->PrepareControlResult()))(0, i);
opt_steer[i] = (*(result_ptr->PrepareControlResult()))(1, i);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册