ethz-asl / mav_trajectory_generation

Polynomial trajectory generation and optimization, especially for rotary-wing MAVs.
Apache License 2.0
528 stars 222 forks source link

wrong number of all constraints #125

Open huiwenzhang opened 2 years ago

huiwenzhang commented 2 years ago

Hi, as explained in the code below, you pre-allocate n_vertices * N / 2 memories for vector all_constraints.

https://github.com/ethz-asl/mav_trajectory_generation/blob/7aeebd9f819217502fd1c5489da49efadf90d411/mav_trajectory_generation/include/mav_trajectory_generation/impl/polynomial_optimization_linear_impl.h#L192-L194

I think the right size should be (n_vertices - 1) * N, i.e. Num. of all constraints = Num. segments * N. But this result is still correct, because you re-calculate the size of total constraints.