mix bb_ufactory.sim (bb_ufactory v0.1.0)

Copy Markdown View Source

Manages the UFACTORY firmware simulator Docker container for integration testing.

The simulator runs UFACTORY's real controller firmware, speaking the same command (502) and report (30003) protocol as a physical arm, with the UFACTORY Studio web UI on http://127.0.0.1:18333 for visual verification. See the Testing against the UFACTORY simulator tutorial and BB.Ufactory.SimulatorCase for building test suites on top of it.

mix bb_ufactory.sim start [MODEL]   # start container + firmware (default: xarm6)
mix bb_ufactory.sim stop            # stop and remove the container
mix bb_ufactory.sim status          # container / firmware readiness
mix bb_ufactory.sim logs            # print recent container logs

MODEL is one of xarm5, xarm6, xarm7, lite6, xarm850 — the same atoms BB.Ufactory.Model uses. The container ships one firmware binary per model (Lite6 is UFACTORY device type 9, UF850 is type 12; both 6-axis).

start waits for full firmware readiness (protocol-level, via BB.Ufactory.Simulator.wait_until_ready/1) — the firmware accepts TCP connections several seconds before its services respond, so a bare port probe is not enough.

Options

  • --image IMAGE — override the Docker image (default: danielwang123321/uf-ubuntu-docker, a community-published image; it is amd64-only and runs under emulation on Apple Silicon)
  • --name NAME — override the container name (default bb_ufactory_sim)

A typical test loop:

mix bb_ufactory.sim start lite6
SIM_MODEL=lite6 mix test --include simulator
mix bb_ufactory.sim stop