Skip to content

Commit b9872d5

Browse files
stephane-caronStéphane Caron
authored andcommitted
Update default behavior of Pinocchio loader to no root joint
Same as in the Python API of Pinocchio.
1 parent fe1040f commit b9872d5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file.
1616
### Changed
1717

1818
- Cassie: update to description from MuJoCo Menagerie
19+
- Pinocchio loader: no root joint by default
1920

2021
## [0.4.0] - 2022/09/14
2122

robot_descriptions/loaders/pinocchio.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import os.path
2323
from importlib import import_module # type: ignore
24-
from typing import Union
24+
from typing import Optional, Union
2525

2626
import pinocchio as pin
2727

@@ -42,15 +42,16 @@
4242

4343
def load_robot_description(
4444
description_name: str,
45-
root_joint_type: PinocchioJoint = pin.JointModelFreeFlyer,
45+
root_joint: Optional[PinocchioJoint] = None,
4646
) -> pin.RobotWrapper:
4747
"""
4848
Load a robot description in Pinocchio.
4949
5050
Args:
5151
description_name: Name of the robot description.
52-
root_joint_type: Type of the first joint of the kinematic chain,
53-
typically a free flyer (a.k.a. floating base) for mobile robots.
52+
root_joint (optional): First joint of the kinematic chain, for example
53+
a free flyer between the floating base of a mobile robot and an
54+
inertial frame. Defaults to no joint, i.e., a fixed base.
5455
5556
Returns:
5657
Robot models for Pinocchio.
@@ -68,7 +69,7 @@ def load_robot_description(
6869
robot = pin.RobotWrapper.BuildFromURDF(
6970
filename=module.URDF_PATH,
7071
package_dirs=package_dirs,
71-
root_joint=root_joint_type(),
72+
root_joint=root_joint,
7273
)
7374

7475
return robot

0 commit comments

Comments
 (0)