Generating code
Two paths to actually run a toolpath on the robot, depending on whether you have the bridge:
| Path | Component | Best for |
|---|---|---|
| Live (immediate) | Live Send | Iterating, debugging, manual jog. Bridge must be running. |
| Offline Python | Code | Save a ready-to-run Python program to disk and run it later. No bridge required at run time. |
| Offline G-code | G-Code | Load into uFactory Studio's G-code panel and execute on the controller. Useful for production runs. |
| Portable .ltraj | Save Traj / Load Traj | Share toolpaths between sessions or teammates. JSON, human-readable. |
Python (Code)
- Build a target list, Pose/PTP/LIN/CIR/SPLine/G-Code Import.
- Drop Code (→ Output). Wire the targets in.
- Set IP input to your robot's IP (default 192.168.1.159).
- 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)
- Same target list as above.
- Drop G-Code (→ Output). Wire targets.
- Configure Feedrates (Fl = linear mm/min, Fr = rapid mm/min) and Gripper IO.
- Stream the G-Code output to a
.ngcor.ncfile. - 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.