-1

Do you think that the RobOptim optimization library (which I read about in C++ library for nonlinear constrained minimization) could be used for real-time optimization for the velocity control of a robot? Being more specific, I have a distance function that I want to minimize between a point of the robot and an obstacle and I have constraints on the maximum velocity/acceleration/jerk of the robot joints, and I want to find the velocities needed to drive the robot away from the obstacle. Do you think I can solve such an optimization problem respecting the real-time requirements of my robot, considering that the iteration time is 1 ms. I know the question may be very vague, and more details should be provided about the algorithm, but for now I am just interested in the order of magnitude of the time needed by this optimization library to provide a result. For example, if the library is generally used for problems that need a solution after a time in the order of seconds it is clearly not suitable for my application.

Thanks for any suggestion

  • A much better strategy would be to ask the developers of the package in question. – Johan Löfberg May 30 '22 at 15:32
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 31 '22 at 22:29

1 Answers1

1

Your problem can be approximated as a discrete time forward Euler integration, therefore it can be cast as a linear program. The osqp library will give you C code that will meet your performance constraints.

I have no idea about the RobOptim library.

2022-06-14 Update

You've mentioned that your objective function has sines and cosines. These functions are non-convex, so they cannot be handled well by any non-convex programming library.

However, if you want a fast solver, then using a non-convex optimizer such as the one you link to won't get you there. Though such a solver may still work for your use case, you're leaving a lot of performance on the table. Convex solvers are also guaranteed to find a globally optimal solution which nonconvex solvers do not offer such a guarantee. Therefore, it's worth figuring out if your problem can be modified to make a convex program.

The solution is to build a convex approximation of the sine/cosine functions. This paper surveys several possibilities.

As you can see below, the approximations are quite good!

Convex approximations of sine and cosine functions

Richard
  • 3,961
  • 13
  • 34
  • Thank you for yout reply @Richard. Actually it seems to me that the osqp library cannot be used for my case, because the distance cost function involves sines and cosines, so it's non linear. However I may have found the library I was looking for https://alphaville.github.io/optimization-engine/. Unfortunately I am having some linking problems when running my code, which I report here https://scicomp.stackexchange.com/questions/41470/problem-with-optimization-engine-library-when-linking – Eugenio Monari Jun 14 '22 at 09:46
  • @EugenioMonari - I've edited my answer to address your concern. – Richard Jun 14 '22 at 20:10