hungpham2511 / toppra

robotic motion planning library
https://hungpham2511.github.io/toppra/index.html
MIT License
612 stars 169 forks source link

[CPP] Limit on the sd variable #156

Closed jmirabel closed 3 years ago

jmirabel commented 3 years ago

Dear @hungpham2511,

is there a rationale for the hardcoded values

  x << 0, 100;
  x_next << 0, 1;

at line https://github.com/hungpham2511/toppra/blob/ec723091a717373413d5747d6c1e56d57a646fa1/cpp/src/toppra/algorithm.cpp#L40 ?

I couldn't find such a limit in the Python implementation.

hungpham2511 commented 3 years ago

You are right, there is no reason particular reason for that upper limit to be there.

However, we have had problems in the past when x is too large, the optimizer behaves quite badly. In the Python implementation, there is a scaling step to address this problem. See https://github.com/hungpham2511/toppra/blob/644e263269e45be8fc595bae59e959b9570edaa3/toppra/solverwrapper/hot_qpoases_solverwrapper.py#L120

This step should, however, be implemented by the solver wrappers like in the Python implementation because solvers are generally different when it comes to numerical instability.

jmirabel commented 3 years ago

Thank you. I added a comment in the code. 5099b23f06acb28e822e99e65dbda08c886b69d7