BB.Error.Kinematics.NoParentJoint exception (bb v0.28.0)

Copy Markdown View Source

A link has no parent joint because it is the root of the kinematic tree.

Distinct from BB.Error.Kinematics.UnknownLink on purpose. The root link having no parent joint is a true structural fact, not a typo, so a caller walking up the tree gets a termination signal it can match on rather than being told its perfectly valid root link doesn't exist:

defp ancestors(robot, link, acc) do
  case BB.Robot.parent_joint(robot, link) do
    {:ok, joint} -> ancestors(robot, joint.parent_link, [joint | acc])
    {:error, %NoParentJoint{}} -> {:ok, acc}
    {:error, reason} -> {:error, reason}
  end
end

Summary

Types

t()

@type t() :: %BB.Error.Kinematics.NoParentJoint{
  __exception__: term(),
  bread_crumbs: term(),
  class: term(),
  link: atom(),
  path: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}

Functions

exception(args)

@spec exception(opts :: Keyword.t()) :: %BB.Error.Kinematics.NoParentJoint{
  __exception__: term(),
  bread_crumbs: term(),
  class: term(),
  link: term(),
  path: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}

Create an Elixir.BB.Error.Kinematics.NoParentJoint without raising it.

Keys

  • :link