-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the possibility to create custom LinearTasks in python #480
Conversation
eec2308
to
7ed7cc1
Compare
488a9aa
to
a46ef6e
Compare
a46ef6e
to
f90491e
Compare
On conda macos there is this nice failure
|
Probably related to conda/conda#9678 . Not sure what a quick workaround is. |
Why is this happening now? |
It is possible that the other tests were not using |
well temp = np.zeros((10, variables_handler.get_number_of_variables()))
temp[:, variable.offset] = np.ones(10)
self._b = np.ones(10) |
I suspect this is what is triggering it. Note that I guess this is a problem that will not occur on real machines, just something that is occuring with virtual machine that do not support AVX instructions. For the time being you can just skip those tests on macOS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
docs/pages/python-additional-info.md
Outdated
|
||
### Create a custom TSID or IK task directly in Python | ||
If you are a `python` user and you want create a inverse kinematics (IK) or a task based inverse | ||
dynamics (TSID) tasks, you do need to write a `C++` code. Indeed it is possible to write a class that inherits from `TSIDLinearTask` or `IKLinearTask` and pass it to `tsid` or `ik` solvers. The following snippet can be used as starting point to build a custom TSID task, a similar approach can be used to define a custom IK task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be "you don't need to write a C++
code"?
In #481 I tried to switch the blas implementation to netlib and blis, but the issue is still there, so I guess it is not a problem of blas implementation. |
Bingo this is the problem: I tested with https://github.com/GiulioRomualdi/blf-fastmac blf.tsid.TSIDLinearTask.__init__(self) however, I don't know how to fix it since that line is required as explained in https://pybind11.readthedocs.io/en/stable/advanced/classes.html#overriding-virtual-functions-in-python |
However a = blf.tsid.TSIDLinearTask() run without any problem |
Are you sure that |
|
In the recent past we had an "Illegal instruction" error for what in the end was just wrong memory access (see robotology/robometry#110). Did you tried to run python that runs this test on Linux under valgrind? |
However, at this point for me we can disable the conda/macOS test and proceed. |
a2fd93b
to
9a8ff4a
Compare
How did you found the problem (or at least a problem) of missing virtual destrutor? |
I've just tried to fix the warnings |
That one was actually the problem, the test runs on |
2dade84
to
8ddeb0d
Compare
If you are a
python
user and you want to create inverse kinematics (IK) or a task-based inversedynamics (TSID) task, you do need to write a
C++
code. Indeed it is possible to write a class that inherits fromTSIDLinearTask
orIKLinearTask
and passes it totsid
orik
solvers. The following snippet can be used as starting point to build a custom TSID task, a similar approach can be used to define a custom IK taskThen you can use your custom task as follows