Replies: 9 comments
-
Could you share a complete but minimal reproducible test? |
Beta Was this translation helpful? Give feedback.
-
Here is the file for a minimal example: I have added the main code under consideration at line 68: |
Beta Was this translation helpful? Give feedback.
-
You can achieve your goal by using a JointPostureTask, something like:
This code was taken from this example, with the only modification being the hierarchical level at which I added the motion task, which I've changed from 1 (cost function) to 0 (constraints). Make sure to use the mask to select the joint(s) that you want to constrain. |
Beta Was this translation helpful? Give feedback.
-
Thanks @andreadelprete. In the code I shared above, I tried doing this with constraint matrices A & b (line 71 in ex_1_ur5.py) |
Beta Was this translation helpful? Give feedback.
-
Ok, now I see what you need. For this you need to create a new task, similar to the joint posture task, but that allows you to constrain the joint positions relative to each other. The task will need to be written in C++ and then binded in Python, as all the other tasks. You cannot work directly with the Constraint objects in python as you were trying to do (or at least I am not aware of anyone who tried and the library was not designed for this use case). |
Beta Was this translation helpful? Give feedback.
-
Thanks for the answer @andreadelprete. Since the underlying QP solver definitely accepts any constraint of the form Maybe you could consider adding this as an enhancement? |
Beta Was this translation helpful? Give feedback.
-
I can look into it in January. Maybe it's easy. |
Beta Was this translation helpful? Give feedback.
-
Hi @andreadelprete, |
Beta Was this translation helpful? Give feedback.
-
Installation: TSID version 1.6.3 from conda
Hello team,
I am having trouble adding an equality constraint between joints in the tsid formulation.
For context, I am trying to add a differential-drive constraint for my robot (and my code is similar to the examples: github.com/stack-of-tasks/tsid/blob/master/exercizes/ex_1_ur5.py)
I am able to create the equality constraint using the tsid.ConstraintEquality class in the following manner:
However, this ConstraintLevel can't be combined with the rest of the tasks in the tsid formulation i.e. tsid.formulation.computeProblemData()... The following code will throw an error:
Error: Python argument types in HQPData.append(HQPData, HQPData)
did not match C++ signature: append(tsid::python::HQPDatas {lvalue}, tsid::python::ConstraintLevels constraintLevel)
In essence, I need a way to either:
Option 1. Somehow insert the created ConstraintLevel at any appropriate place within the already generated HQPData from tsid.formulation.computeProblemData(t, q[:,i], v[:,I])
OR
Option 2: Somehow create a task in the tsid formulation that can handle this kind of diff-drive constraint (equality constraint between joints)
How can I go about this?
Beta Was this translation helpful? Give feedback.
All reactions