Skip to content

[Bug]: Changing Root Joint doesn't do anything #2862

Description

@raabuchanan

🐞 Bug

Maybe I am misunderstanding the purpose of root_joint but I want to use Pinocchio to get forward kinematics and dynamics expressed in a different frame from the base_link frame. Specifically I want it in the imu_link frame. However when I build the model and get the forward kinematics like below, it's always expressed in the base_link frame.

Reproduction steps

std::string root_joint = "joint_imu"; // I also tried a link in the urdf "imu_link"
pinocchio::Model model_;

pinocchio::urdf::buildModel(urdf_file_, JointModelFreeFlyer(), root_joint, robot_model_);

pinocchio::Data data_(model_);

 forwardKinematics(model_, data_, q_);
 updateFramePlacements(model_, data_);

data_.oMf[limb_frame_idx_[leg]].translation(); // right gives the foot position relative to the base_link frame not imu_link or joint_imu

Relevant log output / Error message

System Info

No response

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

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions