- JavaScript 81.1%
- CSS 18.7%
- HTML 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- Record the redesigned dark IDE layout and verification results - Prevent duplicate React keys for command library and program tree |
||
| scripts | ||
| src | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| DESIGN.md | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
URP Workbench — PolyScope 5
An independent, offline browser programming environment prototype for classic Universal Robots .urp files. No VM, Docker, Java runtime or backend is needed to use the built page. It does not connect to or run a robot.
Use
Open the standalone urp-workbench.html in a modern browser, choose a program and select a command. Files stay in browser memory; no account, server upload or CDN is used.
- Program tree: readable folders, Move nodes, waypoints, assignments, expressions, scripts, I/O, branches, loops, threads and URCaps.
- Command library: 26 native entries grouped into Basic, Advanced and Templates, plus a separate URCaps group. Search across groups, inspect support notes, or jump to an existing command of that type. Entries distinguish Add from Inspect.
- Command panels: edit Wait durations, digital outputs, folder names, popup messages, comments, timer actions, thread repetition and stored Move speed/acceleration.
- Add commands: Wait, Set, Popup, Halt, Comment, Folder, Assignment, If, Loop, Script, Thread and Timer. If also has an Add Else branch action. Select a sequence to add inside, or a command to insert after. Threads are always inserted at program top level. Set uses a known digital output and defaults to Off.
- Expressions: edit supported Assignment values, If/While conditions and inline Script lines. Known variables become XML reference tokens; strings/comments stay literal. New Assignment/Timer/Thread names are checked for collisions and basic identifier validity. Defaults are
0,False,sync()and run-once threads; empty sequences need a body before use. This is not a URScript compiler or scope validator. - Tree edits: move eligible nodes up/down or delete them. Internal references are rebased to their original targets. Deleting externally referenced data is blocked, as are direct URCap/If/sequence and waypoint operations with structural constraints.
- Advanced: raw attributes, text and complete XML; explicit apply/discard; undo/redo and edit history.
- URCaps: load
.urcappackages locally to inspect their manifests and enable a matching, purpose-built browser adapter. Java bytecode is never executed. Unrecognized/custom blocks are protected, including their nested commands and raw XML. - Export: download a separate gzip
.urp, uncompressed.urp, or.xml. An unchanged copy in the original format is byte-identical. Changed URP export is blocked if internal references cannot be resolved.
The illustrative demo is not robot-ready and exports as .xml only. The HTML does not embed the supplied robot program. Reopen your file each session; there is no autosave or local-storage persistence.
Native command coverage
The catalog follows the official PolyScope 5.24 handbook: its 25 top-level commands plus the contextual Until command. Visibility does not imply full authoring support.
| Group | Can create in this page | Visible, creation not implemented |
|---|---|---|
| Basic | Wait (time), Set (known digital output), Popup, Halt, Comment, Folder | Move, Waypoint, Direction, Set Payload, Until |
| Advanced | Assignment (new variable), If/Else, Loop (While), Script (inline), Thread, Timer | SubProgram, Event, Switch, Home |
| Templates | None yet | Seek, Force, Palletizing, Conveyor Tracking, Screwdriving |
Existing supported fields remain editable even when new-node creation is unavailable, such as Move speed/acceleration. Complex motion/template nodes need teaching data, installation dependencies and verified serialization; the catalog explains each limitation. ElseIf creation, loop mode changes, event registration, subprogram management, existing-variable assignment selection, rich expression tokens and timer-variable reuse are not implemented.
Native XML structures were compared with the supplied program and Universal Robots' official URScript examples, including Comment/Halt/Timer examples. No sample programs or vendor packages are bundled. The serializer is experimental, not an official or stable URP API; successful XML round trips do not establish controller acceptance.
Browser-only URCaps
Click URCaps → Load URCap package. The page reads the ZIP/JAR manifest and computes a SHA-256 fingerprint in the browser. A matching filename, vendor or version alone does not enable an adapter. Packages are held for this session and are cleared on reload.
The first partial adapter supports the reviewed Szaidel URCap 1.1.2 installer with SHA-256 c75b913d5ff9b03f6b72739c240218feeb1bb73bd5e96fdbd57025dd860b7794:
- Grip / Release: add stateless nodes in eligible sequences, change the action, and move/delete eligible nodes. The instruction preview shows the plugin's fixed Tool Output 1 behavior. No instruction is executed.
- Measure Box: show the two taught poses and known retract/contact-speed defaults. Patch recognized, already-stored
Double/doublescalar values forsecond.retract.mmandcontact.speed.mm_s, within the plugin's bounds. This scalar patching is tested against synthetic input, not controller acceptance. - Still unsupported: inserting Measure Box from scratch, creating absent settings, feature selection, MoveJ/MoveL configuration, changing poses/joints, robot teaching, full script generation and plugin-specific validation.
The supplied Measure Box block stores its two poses/joint positions but not those scalar settings. Its numeric defaults therefore appear read-only. A PolyScope-saved example with non-default settings is needed before implementing their insertion; the app does not guess the serialization.
Other URCaps, including the unreviewed Szaidel 1.1.1 package, receive metadata-only support. They are not installed or executed as Java plugins. Their complete XML is preserved, and edits that would alter it are rejected. Full XML editing cannot bypass this protection. Only explicit adapter actions can change their reviewed fields/nodes.
Supporting arbitrary PolyScope 5 Java/Swing plugins unchanged would require a compatible runtime. This project deliberately uses browser adapters instead, keeping the user's no-VM/no-backend requirement. It is not a complete PolyScope implementation.
Package limits: 8 MiB input, 64 KiB manifest, 10,000 archive entries, 128 MiB declared total uncompressed size, and 32 packages per session. Only the manifest is decompressed; class files are never extracted or run. These checks identify packages, not certify their publisher or behavior. No proprietary URCap binaries are bundled in this repository.
Develop
Requires a Node.js version supported by Vite 7 (20.19+ or 22.12+) and npm.
npm ci
npm run dev
npm test
npm run build
Development binds to 127.0.0.1. Build output: standalone/urp-workbench.html. To place it elsewhere after building:
node scripts/standalone.mjs /path/to/output
Read-only inspection and original-byte verification:
node scripts/check-urp.mjs /path/to/program.urp
Preservation and validation boundaries
Gzip/plain UTF-8 XML with a URProgram root is supported. Field edits patch the original source, retaining unrelated whitespace, attribute order, comments, scripts and unknown elements. Structural edits preserve original tag content and XML gaps; affected XStream-style relative references are updated and checked against stable target identities.
Limits: 8 MiB input; 16 MiB decoded XML; 12,000 elements; 128 nesting levels; 40 edits or 48 MiB of XML history. DTD/entity declarations and malformed input are rejected. The standalone content security policy blocks network requests and external assets.
This is not a full replacement for PolyScope. New movement/waypoint teaching, installation editing, persistent/installation-variable management, arbitrary URCap configuration, 3D simulation, collision checks and full URScript generation are not implemented. Unsupported expression tokens remain read-only with their original data preserved; advanced XML editing remains available outside protected blocks.
Name-based references, scope, execution order, physical limits, TCP/coordinate frames, payload, calibration and plugin-specific semantics are not validated. Reordering a program changes its behavior even when XML references resolve. Reference checks do not prove correctness or safety.
The embedded crcValue and version metadata are retained, not reverse-engineered or regenerated. Gzip stream checksums are generated by the browser. Controller acceptance of an edited file is not verified.
Keep the original backup. Open and save any edited copy in the matching PolyScope/URSim version with the matching installation, URCaps and external scripts. Have qualified personnel verify the program and cell before a physical run.
Verification completed
- 37 tests cover compression, exact round trips, XML escaping, source patches, CDATA/mixed content, malformed/oversized input, reference-aware moves/deletes/additions, native command creation, branch/thread placement, expression links and literal strings, package inspection, fingerprint gating, opaque-block preservation and Szaidel adapter operations.
- Supplied robot file: saved in 5.24.0, with 2,538 XML elements, 261 commands and 227 internal references. Every internal reference resolved.
- That file passed unchanged-byte round trip, Wait insertion, assignment reordering, URCap/script/calibration preservation and gzip export checks. Its original SHA-256 remained unchanged.
- Browser-only URCap update: the real Szaidel 1.1.2 package matched its adapter, while 1.1.1 remained metadata-only. Real-file Grip/Release switching, Grip insertion, Wait insertion, protected-block preservation, all 227 references and gzip export passed independent checks. The original file was not modified.
- In-app browser checks covered gzip/plain input, search, command forms, drafts, invalid XML, failed imports, undo/redo, insertion and export. A synthetic downloaded gzip copy independently matched the expected edit exactly.
- Expanded catalog: real-file checks added Assignment, If/Else, Wait, Comment, Loop, Script, Timer, Thread and Halt. The original 227 references remained valid, four new variable references resolved, protected blocks were unchanged, and gzip export round-tripped. Browser checks covered the new command forms, nested insertion, draft rejection/discard, catalog search, template limitations, existing Move navigation and URCap insertion. All test edits were undone; the browser was reopened with the original program.
- Desktop and mobile layouts were visually inspected. See
DESIGN.mdfor concept comparison and intentional differences.
Not performed: actual PolyScope/URSim loading or a robot run. Direct file:// navigation was blocked by browser automation policy; the same standalone HTML was tested via loopback HTTP. One download notification timed out although the file was saved and verified.
How URP files are made
PolyScope or URSim saves the graphical program as compressed XML in .urp. .script is generated URScript; .txt is a readable outline. The XML includes nodes, parameters and links, while installation files and URCaps supply other dependencies. The format is version-sensitive and is not a documented stable editing API.