-
Notifications
You must be signed in to change notification settings - Fork 265
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
Forward kinematics fail for models with different numbers of joints and links #382
Comments
Does this mean there should be a joint inside every body-labels? I met the same issue as you mentioned.
I got 32 joints but 38 links, I suppose it's because I have nested body in my model. |
I'm not sure - the bug I'm seeing here is more like an "off by 1" situation where the first (inferred) dummy joint that fixes the base of the robot to the world isn't being parsed correctly. The examples in this repo don't trigger the bug because they seem to all be floating-body models, so there's an explicit "free" joint connecting the base of the robot to the world. In your case, you seem to have even more discrepancies between the number of joints and the number of links. If your kinematics satisfy a tree structure (so no loops), then it's not obvious to me where this discrepancy comes from. |
So I think it's quite clear. If we want to model fixed stuff, like Franka panda, all the |
I haven't tried this yet, but to my understanding, part of the reason why this might be difficult to do is that |
Dear alberthli, Would you mind sharing your modified Franka panda with me? I met other issues with the actuators. |
@baixianger See below. All the assets for this MJCF can be found here.
|
For robots like fixed-base serial manipulators, it is not uncommon to have
n
joints andn+1
links, as there will be a nontrivial base link with inertial properties. For example, consider the Franka Panda arm with the following MJCF slightly modified from the mujoco_menagerie repo.We can load this model and try to run forward kinematics on it, but it fails:
The error message reads
This is because
brax.kinematics
tries to applyvmap
over joints and links, but there are more links (8) than joints (7). For these fixed-base type systems, the model loader should detect that the first link has no joint to world (i.e., it is implicitly fixed to the world body) and modify the forward kinematics to take that into account.As a workaround, I am currently adding a dummy joint between the base link and the world and then doing some bookkeeping to ensure the joint always has some fixed value and ignoring those DOFs.
The text was updated successfully, but these errors were encountered: