-1
$\begingroup$

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

$\endgroup$
2
  • $\begingroup$ A much better strategy would be to ask the developers of the package in question. $\endgroup$ Commented May 30, 2022 at 15:32
  • $\begingroup$ 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. $\endgroup$
    – Community Bot
    Commented May 31, 2022 at 22:29

1 Answer 1

1
$\begingroup$

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

$\endgroup$
2
  • $\begingroup$ 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 alphaville.github.io/optimization-engine. Unfortunately I am having some linking problems when running my code, which I report here scicomp.stackexchange.com/questions/41470/… $\endgroup$ Commented Jun 14, 2022 at 9:46
  • $\begingroup$ @EugenioMonari - I've edited my answer to address your concern. $\endgroup$
    – Richard
    Commented Jun 14, 2022 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.