ZJU-FAST-Lab / large_scale_traj_optimizer

Fast (Fastest?) Minimum Snap Trajectory Generation with Analytical Gradient
203 stars 43 forks source link

How to get the snap or jerk value of a trajectory #7

Closed HZhang1003 closed 1 year ago

HZhang1003 commented 1 year ago

Very nice work! Thank you for your contributions to the open source. The trajectory with minimum snap can be obtained using the published example, but there does not appear to be a function to obtain the snap value. How can I get the minimum snap value? Looking forward to your reply and thanks a lot.

sritank commented 1 year ago

You can use the getObjective() method of SnapOpt to get the snap value. For instance in example1/src/example1_node.cpp after line 138 (snapOpt.getTraj(minSnapTraj);), you can call snapOpt.getObjective() to get the snap value of minSnapTraj

HZhang1003 commented 1 year ago

Thank you very much. I didn't notice this function before. Now I found it and my problem has been solved.