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
| Joint | Lower (rad) | Upper (rad) | Effort (N·m) | Max Velocity (rad/s) |
|---|---|---|---|---|
| J1 | -2π | +2π | 50 | π |
| J2 | -2.059 | +2.094 | 50 | π |
| J3 | -3.927 | +0.192 | 32 | π |
| J4 | -2π | +2π | 32 | π |
| J5 | -1.693 | +π | 32 | π |
| 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"
endOptions
:host— the arm's IP address (default"192.168.1.111"):loop_hz— motion-loop rate for the:xarmcontroller (default100):simulation— the controller's simulation strategy (default:mock):controller— extraBB.Ufactory.Controlleroptions 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:cartesianactuator (BB.Ufactory.Actuator.Cartesian) on a fixed mount at:link6, forCartesianMovecommands. Enabled by default (it needs no extra hardware); passfalseto omit, or a keyword list of actuator options (e.g.[speed: 150.0]):gripper—true(or a keyword list ofBB.Ufactory.Actuator.Gripperoptions, e.g.[speed: 1500]) adds a:gripperactuator on a fixed mount joint at:link6(the TCP):linear_track—true(orBB.Ufactory.Actuator.LinearTrackoptions, e.g.[speed: 200]) adds a:trackactuator 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
endFor 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
@spec child_spec(Keyword.t()) :: Supervisor.child_spec()
Returns a child specification for starting this robot under a supervisor.
@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)
@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.