Skip to content

[Bug]: Fixed joint in mujoco as first joint does not take body position into account #2782

@MegMll

Description

@MegMll

🐞 Bug

@Ipuch
In a mjcf model, when the first body is fixed in worldbody (no joint attached to it) the position and orientation of said body is not taken into account when building the pinocchio model.

Please use the model here to test out the reproduction steps.

Reproduction steps

import pinocchio as pin
import numpy as np

model = pin.buildModelFromMJCF("arm26_mujoco.xml")
data = model.createData()

q = np.zeros((model.nq,))

pin.framesForwardKinematics(model, data, q)
print(data.oMf[model.getFrameId("base", pin.FrameType.BODY)]) # should be non identity, since it's position in the worldbody is non identity in the model

Relevant log output / Error message

System Info

pinocchio version is 3.8.0

Checklist

  • I have checked that all my packages are installed from the same package manager (conda-forge, Nix, PyPI, robotpkg, ROS, ...)
  • I have checked that there is no similar issue/discussion in the repo
  • I have provided a minimal and working example to reproduce the bug
  • I have used Markdown code blocks for both code and stack traces/compiler errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions