BB.Robot.Joint (bb v0.27.0)

Copy Markdown View Source

An optimised joint representation with all units converted to SI floats.

Joints connect a parent link to a child link and define the kinematic relationship between them.

Summary

Types

Joint axis of rotation/translation as a normalised unit vector {x, y, z}.

Joint dynamics parameters.

Joint limits.

Joint origin transform from parent to child frame.

t()

Functions

How many degrees of freedom this joint has.

Check if this joint is linear (prismatic).

Check if this joint has any degrees of freedom.

Check if this joint is rotational (revolute or continuous).

Types

axis()

@type axis() :: {float(), float(), float()}

Joint axis of rotation/translation as a normalised unit vector {x, y, z}.

dynamics()

@type dynamics() :: %{damping: float() | nil, friction: float() | nil}

Joint dynamics parameters.

  • damping: viscous damping coefficient
    • For revolute: N·m·s/rad
    • For prismatic: N·s/m
  • friction: Coulomb friction
    • For revolute: N·m
    • For prismatic: N

joint_type()

@type joint_type() ::
  :revolute | :continuous | :prismatic | :fixed | :floating | :planar

limits()

@type limits() :: %{
  lower: float() | nil,
  upper: float() | nil,
  velocity: float(),
  effort: float(),
  acceleration: float() | nil
}

Joint limits.

For revolute/continuous joints:

  • lower/upper: angle limits in radians
  • velocity: max angular velocity in rad/s
  • effort: max torque in N·m
  • acceleration: max angular acceleration in rad/s² (optional)

For prismatic joints:

  • lower/upper: position limits in meters
  • velocity: max linear velocity in m/s
  • effort: max effort in N·m (as defined in DSL)
  • acceleration: max linear acceleration in m/s² (optional)

origin()

@type origin() :: %{
  position: {float(), float(), float()},
  orientation: {float(), float(), float()}
}

Joint origin transform from parent to child frame.

  • position: {x, y, z} translation in meters
  • orientation: {roll, pitch, yaw} rotation in radians (XYZ Euler angles)

t()

@type t() :: %BB.Robot.Joint{
  actuators: [atom()],
  axis: axis() | nil,
  child_link: atom(),
  dynamics: dynamics() | nil,
  limits: limits() | nil,
  name: atom(),
  origin: origin() | nil,
  parent_link: atom(),
  sensors: [atom()],
  type: joint_type()
}

Functions

dof(joint)

@spec dof(t()) :: 0 | 1 | 3 | 6

How many degrees of freedom this joint has.

This is the number of Jacobian columns the joint contributes, and the size of its configuration — see BB.Robot.State for the shape each type carries.

Examples

iex> BB.Robot.Joint.dof(%BB.Robot.Joint{type: :revolute})
1

iex> BB.Robot.Joint.dof(%BB.Robot.Joint{type: :floating})
6

linear?(joint)

@spec linear?(t()) :: boolean()

Check if this joint is linear (prismatic).

movable?(joint)

@spec movable?(t()) :: boolean()

Check if this joint has any degrees of freedom.

rotational?(joint)

@spec rotational?(t()) :: boolean()

Check if this joint is rotational (revolute or continuous).