cmower / optas

OpTaS: An optimization-based task specification library for trajectory optimization and model predictive control.
https://cmower.github.io/optas/
Other
107 stars 14 forks source link

Nice to have: deg 2 rad and viceversa #26

Closed joaomoura24 closed 2 years ago

joaomoura24 commented 2 years ago

We usually use the numpy functions and it is a easy conversion, but maybe nice to have it from optas.

I realized that once i was trying to write down the simplest example possible with minimum use of other packages. Code example: deg2rad = @(deg) deg(optas.pi/180.) % convert degrees into radians rad2deg = @(rad) rad(180./optas.pi) % convert radians into degrees

cmower commented 2 years ago

Agreed. Could you add these to the init.py script and setup a PR.

Please define as functions with "def" rather than using a lambda function though.

Also, you should use the "arrayify_args" decorator from the spatialmath.py script.

joaomoura24 commented 2 years ago

Ok, i'll check that.