BB.Ufactory.Robots.XArm6 (bb_ufactory v0.2.0)

Copy Markdown View Source

BB robot definition for the UFactory xArm6.

6-DOF serial manipulator with revolute joints J1–J6. All joints rotate about their local Z axis. Joint limits and effort values are sourced from the xArm Developer Manual V1.10.0 and confirmed against the URDF in tmp/urdf/xarm6/.

Joint Limits

JointLower (rad)Upper (rad)Effort (N·m)Max Velocity (rad/s)
J1-2π+2π50π
J2-2.059+2.09450π
J3-3.927+0.19232π
J4-2π+2π32π
J5-1.69332π
J6-2π+2π20π

Usage

Build your own robot module from this definition, overriding what you need:

defmodule MyRobot do
  use BB.Ufactory.Robots.XArm6, host: "192.168.1.111"
end

Options

  • :host — the arm's IP address (default "192.168.1.111")
  • :loop_hz — motion-loop rate for the :xarm controller (default 100)
  • :simulation — the controller's simulation strategy (default :mock)
  • :controller — extra BB.Ufactory.Controller options merged into the child spec, e.g. [tcp_offset: {0.0, 0.0, 172.0, 0.0, 0.0, 0.0}, reduced_mode: true]
  • :cartesian — a :cartesian actuator (BB.Ufactory.Actuator.Cartesian) on a fixed mount at :link6, for CartesianMove commands. Enabled by default (it needs no extra hardware); pass false to omit, or a keyword list of actuator options (e.g. [speed: 150.0])
  • :grippertrue (or a keyword list of BB.Ufactory.Actuator.Gripper options, e.g. [speed: 1500]) adds a :gripper actuator on a fixed mount joint at :link6 (the TCP)
  • :linear_tracktrue (or BB.Ufactory.Actuator.LinearTrack options, e.g. [speed: 200]) adds a :track actuator on a fixed mount joint at the base link

Sensors compose without options — declare your own sensors do ... end block alongside the use:

defmodule MyRobot do
  use BB.Ufactory.Robots.XArm6, host: "192.168.1.111", gripper: true

  sensors do
    sensor :wrench, {BB.Ufactory.Sensor.ForceTorque, controller: :xarm}
  end
end

For a topology this definition cannot express (renamed joints, the arm mounted on a larger robot), copy the DSL from this module's source into your own use BB robot.

This module is itself a complete robot (host 192.168.1.111) and can be started directly, which the library's own simulator tests do.

Summary

Functions

Returns a child specification for starting this robot under a supervisor.

Returns the optimised robot representation.

Starts the robot's supervision tree.

Functions

child_spec(opts \\ [])

@spec child_spec(Keyword.t()) :: Supervisor.child_spec()

Returns a child specification for starting this robot under a supervisor.

robot()

@spec robot() :: BB.Robot.t()

Returns the optimised robot representation.

This struct is built at compile-time from the DSL definition and contains:

  • All physical values converted to SI base units (floats)
  • Flat maps for O(1) lookup of links, joints, sensors, and actuators
  • Pre-computed topology metadata for efficient traversal

Examples

robot = Elixir.BB.Ufactory.Robots.XArm6.robot()
{:ok, link} = BB.Robot.get_link(robot, :base_link)
{:ok, joint} = BB.Robot.get_joint(robot, :shoulder)

start_link(opts \\ [])

@spec start_link(Keyword.t()) :: Supervisor.on_start()

Starts the robot's supervision tree.

Options

All options are passed through to sensor and actuator child processes.