Generating code

Two paths to actually run a toolpath on the robot, depending on whether you have the bridge:

PathComponentBest for
Live (immediate)Live SendIterating, debugging, manual jog. Bridge must be running.
Offline PythonCodeSave a ready-to-run Python program to disk and run it later. No bridge required at run time.
Offline G-codeG-CodeLoad into uFactory Studio's G-code panel and execute on the controller. Useful for production runs.
Portable .ltrajSave Traj / Load TrajShare toolpaths between sessions or teammates. JSON, human-readable.

Python (Code)

  1. Build a target list, Pose/PTP/LIN/CIR/SPLine/G-Code Import.
  2. Drop Code (→ Output). Wire the targets in.
  3. Set IP input to your robot's IP (default 192.168.1.159).
  4. Wire the Script output to a Panel, then copy the code straight out of the panel. (Or right-click the Panel → Stream Contents to save it to a file.)

That code is a complete, ready-to-run program for your uFactory arm, Egret writes all of it for you. Take it and run it however suits your setup.

G-code (G-Code)

  1. Same target list as above.
  2. Drop G-Code (→ Output). Wire targets.
  3. Configure Feedrates (Fl = linear mm/min, Fr = rapid mm/min) and Gripper IO.
  4. Stream the G-Code output to a .ngc or .nc file.
  5. In uFactory Studio, open the G-code panel and load the file. Run.

The dialect is RS-274 / LinuxCNC-compatible, which is what uFactory's controller actually executes. CIR is decomposed into 2× G1 segments (real G2/G3 with I/J/K is deferred). WAIT_FOR_DI is emitted as a comment, use Python codegen if you need IO gating.

Tool offsets in codegen

If any target carries a ToolOffset (stamped by Custom Tool or Tool (TCP)), both Python and G-code emit a single set_tcp_offset(...) at the top of the script. Mixed offsets in one script get a warning + the first one wins. Split into multiple scripts if you need to change tools mid-run.

Blend radius

For smooth multi-segment motion (no decel-at-each-waypoint), stamp a Blend Radius onto your target list. 1-5mm for tight, 10-50mm for sweeping. Goes into the SDK's radius= kwarg.