You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, thanks a lot for the great work on TSID!
I want to use TSID to control the force at the end effector of a manipulator, to do so I want to use the task TaskContactForceEquality. The problem is that it's python binding is not exposed.
I tried to naively expose it with these changes.
When I try to instantiate the task I get the following error:
ArgumentError: Python argument types in
TaskContactForceEquality.init(TaskContactForceEquality, str, RobotWrapper, float, Contact6d)
did not match C++ signature: init(_object*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > name, tsid::robots::RobotWrapper {lvalue} robot, double dt, tsid::contacts::ContactBase {lvalue} contact)
It seems that the problem lies in the type of contact that I am passing, which is of type tsid.tsid_pywrap.Contact6d. From the C++ signature, it appears that the constructor expects tsid::contacts::ContactBase instead.
Could anyone shed light on how I might resolve this mismatch or if there's an alternative way to expose the correct binding for Contact6d?
Hi @danielcostanzi18
it seems to me the problem is that in Python Contact6d is not recognized as a ContactBase, even though it is. Indeed if you take a look at how other Python bindings have been implemented (such as this one) you need to implement a different method for each possible child class of the input argument. In your case, you would need a constructor for each possible child of ContactBase (such as Contact6d).
Hi @andreadelprete
Thanks a lot for your help, I'm now able to instantiate the task by passing a Contact6d. These are the last changes.
I'd like to open a PR, but first would probably be better to have a working example, what do you think?
For that matter, I'd open another issue.
Hello everyone,
First off, thanks a lot for the great work on TSID!
I want to use TSID to control the force at the end effector of a manipulator, to do so I want to use the task
TaskContactForceEquality
. The problem is that it's python binding is not exposed.I tried to naively expose it with these changes.
When I try to instantiate the task I get the following error:
It seems that the problem lies in the type of
contact
that I am passing, which is of typetsid.tsid_pywrap.Contact6d
. From the C++ signature, it appears that the constructor expectstsid::contacts::ContactBase
instead.Could anyone shed light on how I might resolve this mismatch or if there's an alternative way to expose the correct binding for Contact6d?
If you want to reproduce the issue you can launch the example that I prepared exercizes/ex_5_ur5_force_task.py.
Thanks in advance for your help!
Best regards,
Daniel
The text was updated successfully, but these errors were encountered: