Joint

class urdfgenpy.Joint(name, joint_type, parent, child, origin=<factory>, axis=(1.0, 0.0, 0.0), limit=None, dynamics=None, mimic=None)[source]

Bases: object

Kinematic connection between two links.

Parameters:
  • name (str) – Unique joint name.

  • joint_type (Literal['fixed', 'prismatic', 'revolute', 'continuous', 'planar', 'floating']) – One of “fixed”, “prismatic”, “revolute”, “continuous”, “planar” or “floating”.

  • parent (str) – Name of the parent link.

  • child (str) – Name of the child link.

  • origin (Origin) – Transform from parent link frame to joint frame.

  • axis (tuple[float, float, float]) – Unit vector defining the joint axis (ignored for ‘fixed’/’floating’).

  • limit (Optional[JointLimit]) – Optional motion limits (:class:’JointLimit’).

  • dynamics (Optional[JointDynamics]) – Optional damping/friction (:class:’JointDynamics’).

  • mimic (Optional[JointMimic]) – Optional mimic constraint (:class:’JointMimic’).

name: str
joint_type: Literal['fixed', 'prismatic', 'revolute', 'continuous', 'planar', 'floating']
parent: str
child: str
origin: Origin
axis: tuple[float, float, float] = (1.0, 0.0, 0.0)
limit: JointLimit | None = None
dynamics: JointDynamics | None = None
mimic: JointMimic | None = None
to_xml(indent='')[source]

Return the ‘<joint>’ XML block string.

Parameters:

indent (str) – Leading whitespace prepended to each line.

Return type:

str

Returns:

A multi-line ‘<joint>…</joint>’ XML string.

class urdfgenpy.JointLimit(lower=0.0, upper=0.0, effort=0.0, velocity=0.0)[source]

Bases: object

Motion limits for a joint.

Parameters:
  • lower (float) – Lower position limit (rad or m).

  • upper (float) – Upper position limit (rad or m).

  • effort (float) – Maximum effort (N.m or N).

  • velocity (float) – Maximum velocity (rad/s or m/s).

lower: float = 0.0
upper: float = 0.0
effort: float = 0.0
velocity: float = 0.0
to_xml(indent='')[source]

Return the ‘<limit>’ XML element string.

Parameters:

indent (str) – Leading whitespace prepended to the element.

Return type:

str

Returns:

A single-line ‘<limit … />’ XML string.

class urdfgenpy.JointDynamics(damping=0.0, friction=0.0)[source]

Bases: object

Physical damping and friction for a joint.

Parameters:
  • damping (float) – Viscous damping coefficient (N.m.s/rad).

  • friction (float) – Coulomb friction coefficient (N.m).

damping: float = 0.0
friction: float = 0.0
to_xml(indent='')[source]

Return the ‘<dynamics>’ XML element string.

Parameters:

indent (str) – Leading whitespace prepended to the element.

Return type:

str

Returns:

A single-line ‘<dynamics … />’ XML string.

class urdfgenpy.JointMimic(joint, multiplier=1.0, offset=0.0)[source]

Bases: object

Constraint that mirrors another joint’s motion.

Parameters:
  • joint (str) – Name of the joint to mimic.

  • multiplier (float) – Scale factor applied to the mimicked joint’s value.

  • offset (float) – Constant offset added after scaling.

joint: str
multiplier: float = 1.0
offset: float = 0.0
to_xml(indent='')[source]

Return the ‘<mimic>’ XML element string.

Parameters:

indent (str) – Leading whitespace prepended to the element.

Return type:

str

Returns:

A single-line ‘<mimic … />’ XML string.