Robonix primitive for the XYZ Cartesian pen plotter. It is the only
package that speaks TCP to the PLC and owns the
robonix/primitive/plotter/* namespace: framing, CRC16-Modbus, point-by-point
ACKs, homing, global motion parameters, and the synthesized status stream.
The wire protocol and the reference client live in
cartesian_plotter/sdk/. Skills never import that
transport; they call the contracts below over gRPC.
Capability surface
Contract
Mode
Transport
Source / handler
robonix/primitive/plotter/driver
rpc
gRPC
Driver(CMD_INIT, config_json) — lifecycle gate; connects and PINGs the PLC
robonix/primitive/plotter/trajectory
rpc
gRPC
Trajectory(waypoints) — one MOVE_LINEAR per point, blocks for the ACK
SetParams(vel, acc, dec, jerk, z_up, z_down); MCP tool plotter_set_params; 0 keeps the current value
robonix/primitive/plotter/geometry
rpc
gRPC
Geometry(Empty) → drawable area + pen heights from config
robonix/primitive/plotter/status
topic_out
gRPC stream
Status(Empty) → stream PlotterStatus
status is a msg-backed topic. The current PLC firmware has no STATUS
query, so the stream is synthesized from local state: socket connectivity,
busy flag, last commanded position, and the most recent error.
home and set_params are registered as both gRPC and MCP so Pilot/LLM can
call them directly without going through a skill. The PLC cannot read
parameters back; the primitive caches the last successfully sent profile.
Boot ordering
This primitive must boot before any text or draw skill in the deployment
manifest. rbnx boot has no defer/retry, and each skill resolves
primitive/plotter/{trajectory,home} during activation.
Driver-init lifecycle
scripts/start.sh execs python3 -m cartesian_plotter.main; it does not spawn ROS
or a PLC subprocess.
CMD_INIT: parse and validate the manifest config: block. With
connect_on_init: true (default), connect to the PLC, PING it, and push
the default SET_PARAM profile. Failure returns Err, so a missing PLC
fails boot immediately.
CMD_ACTIVATE: mark the primitive active; reconnect if the PLC dropped
while inactive.
CMD_DEACTIVATE: stop the status stream. The protocol has no STOP, so a
motion already in flight is not aborted.
CMD_SHUTDOWN: best-effort CLOSE(0x0A), wait for its ACK, then close the
socket. Skipping CLOSE can leave the PLC stuck between its 20/60
states.
cartesian_plotter/main.py maps Robonix contracts onto the transport client.
The modules under cartesian_plotter/sdk/ are transport only and exist for
this primitive; skills never import them.
Config (passed via Driver(CMD_INIT, config_json))
host: "" # PLC IPv4 / hostname (required, no default)
port: 2000 # PLC TCP port
timeout_s: 30.0 # connect timeout and per-point ACK floor
connect_on_init: true # false -> first motion call connects
units: mm # only "mm" is supported
z_up: -46.0 # pen-up height
z_down: -50.0 # pen-down height; calibrate by hand
z_min: -50.0 # lower Z travel limit (pen-height validation)
z_max: 0.0 # upper Z travel limit
area_x_max: 180.0 # drawable width, mm (default for this rig)
area_y_max: 150.0 # drawable height, mm
velocity: 20.0 # mm/s
acceleration: 300.0 # mm/s^2
deceleration: 300.0 # mm/s^2
jerk: 3000.0 # mm/s^3
status_rate_hz: 2.0 # synthesized status stream rate
max_points: 100000 # max waypoints in one trajectory
Pen heights must satisfy the configured z_min <= z_down < z_up <= z_max (defaults -50 / 0).
Machine zero (0,0,0) is 50 mm above the paper’s lower-left corner, so the
paper surface and z_down are -50.
The global profile is sent with the PLC’s SET_PARAM (six float32 values:
velocity, acceleration, deceleration, jerk, z_up, z_down). It affects
every subsequent MOVE_LINEAR until changed or the PLC restarts.
Protocol limits
No STOP command. Once MOVE_LINEAR is sent, Robonix cannot abort it;
emergency stop is PLC-side only.
No position readback.x/y/z are the last commanded/successful points,
not encoder or limit-switch feedback.
No batched paths. One motion command is in flight at a time;
BufferMode has no effect.
Global parameters only. There is no per-point speed or acceleration.
Home after power-up. The axis group needs a valid reference position;
run plotter_home before moving.
Pen-up guard. If the last known position is below z_up, the primitive
lifts the pen before starting a trajectory.
This primitive knows coordinates, frames, CRC, and ACKs. It does not know
what a glyph or an image is; that belongs to the skills.
Build / run inside a deployment
This package is not standalone: both scripts resolve the deployment root by
going three levels up (the layouts rbnx uses are
<deploy>/packages/primitives/<pkg> and <deploy>/rbnx-boot/cache/<pkg>) and
share the deployment-wide .venv. Set RBNX_DEPLOY_ROOT to override.
bash scripts/build.sh # uv sync + rbnx codegen
ROBONIX_ATLAS=127.0.0.1:50051 \
bash scripts/start.sh # registers with Atlas and awaits Init
Tests run against the deployment venv:
cd "${RBNX_DEPLOY_ROOT:?set RBNX_DEPLOY_ROOT}" && \
uv run pytest packages/primitives/primitive-hdu-cartesian-plotter-rbnx/tests -q
Normally rbnx boot launches the primitive from the manifest.
Then ask Pilot to run plotter_home and confirm the status stream reports
connected and IDLE. A successful home followed by a one-point dry run is
the minimum end-to-end check before drawing.
License
MIT. See the deployment repository’s LICENSE file.
primitive-hdu-cartesian-plotter-rbnx
Robonix primitive for the XYZ Cartesian pen plotter. It is the only package that speaks TCP to the PLC and owns the
robonix/primitive/plotter/*namespace: framing, CRC16-Modbus, point-by-point ACKs, homing, global motion parameters, and the synthesized status stream.The wire protocol and the reference client live in
cartesian_plotter/sdk/. Skills never import that transport; they call the contracts below over gRPC.Capability surface
robonix/primitive/plotter/driverDriver(CMD_INIT, config_json)— lifecycle gate; connects and PINGs the PLCrobonix/primitive/plotter/trajectoryTrajectory(waypoints)— oneMOVE_LINEARper point, blocks for the ACKrobonix/primitive/plotter/homeHome(Empty)→ PLCMC_GroupHome(fixed(0,0,0)); MCP toolplotter_homerobonix/primitive/plotter/set_paramsSetParams(vel, acc, dec, jerk, z_up, z_down); MCP toolplotter_set_params;0keeps the current valuerobonix/primitive/plotter/geometryGeometry(Empty)→ drawable area + pen heights from configrobonix/primitive/plotter/statusStatus(Empty) → stream PlotterStatusstatusis a msg-backed topic. The current PLC firmware has no STATUS query, so the stream is synthesized from local state: socket connectivity, busy flag, last commanded position, and the most recent error.homeandset_paramsare registered as both gRPC and MCP so Pilot/LLM can call them directly without going through a skill. The PLC cannot read parameters back; the primitive caches the last successfully sent profile.Boot ordering
This primitive must boot before any text or draw skill in the deployment manifest.
rbnx boothas no defer/retry, and each skill resolvesprimitive/plotter/{trajectory,home}during activation.Driver-init lifecycle
scripts/start.shexecspython3 -m cartesian_plotter.main; it does not spawn ROS or a PLC subprocess.CMD_INIT: parse and validate the manifestconfig:block. Withconnect_on_init: true(default), connect to the PLC,PINGit, and push the defaultSET_PARAMprofile. Failure returnsErr, so a missing PLC fails boot immediately.CMD_ACTIVATE: mark the primitive active; reconnect if the PLC dropped while inactive.CMD_DEACTIVATE: stop the status stream. The protocol has noSTOP, so a motion already in flight is not aborted.CMD_SHUTDOWN: best-effortCLOSE(0x0A), wait for its ACK, then close the socket. SkippingCLOSEcan leave the PLC stuck between its20/60states.Layout
cartesian_plotter/main.pymaps Robonix contracts onto the transport client. The modules undercartesian_plotter/sdk/are transport only and exist for this primitive; skills never import them.Config (passed via
Driver(CMD_INIT, config_json))Pen heights must satisfy the configured
z_min <= z_down < z_up <= z_max(defaults-50/0). Machine zero(0,0,0)is 50 mm above the paper’s lower-left corner, so the paper surface andz_downare-50.The global profile is sent with the PLC’s
SET_PARAM(sixfloat32values: velocity, acceleration, deceleration, jerk,z_up,z_down). It affects every subsequentMOVE_LINEARuntil changed or the PLC restarts.Protocol limits
MOVE_LINEARis sent, Robonix cannot abort it; emergency stop is PLC-side only.x/y/zare the last commanded/successful points, not encoder or limit-switch feedback.BufferModehas no effect.plotter_homebefore moving.z_up, the primitive lifts the pen before starting a trajectory.This primitive knows coordinates, frames, CRC, and ACKs. It does not know what a glyph or an image is; that belongs to the skills.
Build / run inside a deployment
This package is not standalone: both scripts resolve the deployment root by going three levels up (the layouts
rbnxuses are<deploy>/packages/primitives/<pkg>and<deploy>/rbnx-boot/cache/<pkg>) and share the deployment-wide.venv. SetRBNX_DEPLOY_ROOTto override.Tests run against the deployment venv:
Normally
rbnx bootlaunches the primitive from the manifest.Verification
Then ask Pilot to run
plotter_homeand confirm the status stream reportsconnectedandIDLE. A successful home followed by a one-point dry run is the minimum end-to-end check before drawing.License
MIT. See the deployment repository’s LICENSE file.