cmower / optas

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

Naming convention violated for jacobian methods in models.py #68

Closed cmower closed 1 year ago

cmower commented 1 year ago

Almost all the get methods in RobotModel use incorrect naming conventions. They all miss the word link. These should be replaced.

There is lots of code that is using the incorrect naming convention, so I think it would be best for a while to add deprecation warnings.

cmower commented 1 year ago

Added a deprecation warning to multiple functions. However, now when running the example python example_planar_idk.py I get the following error:

example_planar_idk.py:27: DeprecationWarning: 'get_global_linear_jacobian_function' will be deprecated, please use 'get_global_link_linear_jacobian_function' instead
  J = robot.get_global_linear_jacobian_function(link=link_ee)
Traceback (most recent call last):
  File "example_planar_idk.py", line 27, in <module>
    J = robot.get_global_linear_jacobian_function(link=link_ee)
  File ".local/lib/python3.8/site-packages/optas/models.py", line 63, in wrapper
    return new_function(*args, **kwargs)
TypeError: get_global_link_linear_jacobian_function() got multiple values for argument 'link'
cmower commented 1 year ago

Fixed issues above. In first official release I will need to actually deprecate these methods. Closing for now.