zm0612 / Minimum-Snap

使用C++对Minimum Snap算法进行了实现,实现的结果超过了论文中给出的计算速度。并且实现了三维和二维的Minimum Snap轨迹生成算法
189 stars 43 forks source link

computation of matrix Q #1

Open huiwenzhang opened 2 years ago

huiwenzhang commented 2 years ago

Hi, According to the formula given in the blog, the code below https://github.com/zm0612/Minimum-Snap/blob/0a31cc9c723e4fc8af81835277a1cbc342160788/src/waypoint_trajectory_generator/src/trajectory_generator.cpp#L129-L132 should be

 sub_Q(i, l) = (Factorial(p_order - i) / Factorial(p_order - order - i)) *
                              (Factorial(p_order - l) / Factorial(p_order - order - l)) /
                              (p_order - i + p_order - l - 2 * order + 1) *
                              pow(Time(k), p_order - i + p_order - l - 2 * order + 1);

The integral of term $t^{(p{order} - i - order + p{order} - l -order)}$ gives p_order - i + p_order - l - 2 * order + 1. I modified the code to my version, however it fails to give a solution, I guess somewhere else wrong with this modification. Please have a look.

zm0612 commented 2 years ago

Hi, thank you very much for your suggestion. But when I compare the code you gave, it looks like you just removed the parentheses, but in fact their operations are still the same.

huiwenzhang commented 2 years ago

Hi, thank you very much for your suggestion. But when I compare the code you gave, it looks like you just removed the parentheses, but in fact their operations are still the same.

different, the symbol '1' and 'l' are very confusion, here 'l' stands for column index. my answer is $p{order} - i + p{order} - l - 2order + 1$, you code is $p{order} - i + p{order} - l - 2order + 2$

zm0612 commented 2 years ago

I found the difference, I'll take the time to test it, thank you very much.

HongweiSunny commented 1 year ago

so this question has been fixed?