tesseract-robotics / trajopt

Trajectory Optimization Motion Planner for ROS
385 stars 103 forks source link

OSQP infinity #373

Closed rjoomen closed 10 months ago

rjoomen commented 10 months ago

It seems to me the OSQP Eigen interface (in SQP) should use INFINITY instead of OSQP_INFTY, as SCO also uses that.

Otherwise the initial bounds do not match between Trajopt and TrajoptIfopt.

Levi-Armstrong commented 10 months ago

I think this slight discrepancy should be fine. In my testing I did not see any difference in the output table data. Are you seeing anything significant?

rjoomen commented 10 months ago

No, it does not seem to make a difference, but it shows in OSQP_COMPARE_DEBUG_MODE. I'll PR it sometime, if that's OK with you.

Levi-Armstrong commented 10 months ago

I have reviewed several issue posted on OSQP and I think it would be best to use OSQP_INFTY instead because it looks like it can lead to failures like iteration limits, etc. See the discussion here. I would be in favor in updating the legacy version of using OSQP_INFTY if you want to make that change.

rjoomen commented 10 months ago

Seems to me only this line, right?

Levi-Armstrong commented 10 months ago

I think so

rjoomen commented 10 months ago

But if we really always want to use OSQP_INFTY when OSQP is the solver we also need to deal with lines like this and probably this. Although I did some quick testing and changing this did not change my results.

Levi-Armstrong commented 10 months ago

Yea, I would just update those also.

rjoomen commented 9 months ago

I fixed it in osqp_interface.cpp.

Doing the same in trajopt_qp_problem.cpp and modelling.cpp is not possible though, as the type of solver is not known at these points, so other infinity limits might apply, depending on the solver. As the current infinity does not seem to create problems, I'll leave it at this.