Open pRosenberger opened 9 years ago
I get a similar error for the same lines of code, only it's global name 'math' not defined. This is using the example code from the Git page.
I manage to fix mine by changing the following code in robotmodel.py:
def calc_base_parms(self, verbose=False):
. . .
global sin, cos, sign
sin = math.sin # used to be numpy.sin
cos = math.cos # used to be numpy.cos
sign = numpy.sign
. . .
Since sin, cos and sign are exported to regressor_fun, they need to be from the correct library, which I guess is math instead of numpy. This seemed to do the trick.
Thanks @ashlin-k , I remember I had some trouble with the sin, cos, sign being local or global or whatever when developing the package, and I had never fully understood if that was the right way to do it.
The model in the following code leads to an error:
Whereby changing the offsets of the first four joints works fine:
Console output and error message: