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
Functions
Create an Elixir.BB.Error.Kinematics.NoParentJoint without raising it.