3 ms·
That's odd, have you profiled it?
by 392 2y ago
That's odd, have you profiled it?
- imp0cat 2y agoI took a look at the code that I started with and... it is kinda horrible. https://github.com/AnykeyNL/Quincy/blob/master/coordcalc.py#L89 https://github.com/AnykeyNL/Quincy/blob/master/coordcalc.py#... There is a loop in a loop that goes through all the possible values of x and y to find the correct ones. No wonder it's so slow! The scipy solver - inspired by the original article, I used https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.differential_evolution.html https://docs.scipy.org/doc/scipy/reference/generated/scipy.o... - isn't much faster though (from reading the docs, it's just a smarter random search). I guess it's time to learn some linear algebra (again!) and create a custom algorithm.
- robertleoj 2y agoDid you try using the previous configuration as an initial guess to the numerical optimizer? If the next position is close to the previous one, the solver should be very quick. Also, you can probably get much faster results if you obtain the gradient of the forward kinematics.
- imp0cat 2y agoThanks, much appreciated! I will try that. I am trying multiple optimizations right now, mostly centered around reducing the amount of lookups required.