SCARA Motion Trajectory Studio & StreamerΒΆ
scarajectory is a standalone CAD/CAM motion planning, kinematic validation, and real-time trajectory streaming software for SCARA robotic manipulators.
Developed in python code.
The README is used to introduce the tool and provide instructions on how to install the tool, any machine dependencies it may have and any other information that should be provided before the tool is installed.
π InstallationΒΆ
Navigate to release page download and extract release archive.
To install scarajectory type the following
tar xvzf scarajectory-x.y.z.tar.gz
cd scarajectory-x.y.z/
# python3
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
python3 -m pip install --upgrade setuptools
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade build
pip3 install -r requirements.txt
python3 -m build --no-isolation --wheel
pip3 install ./dist/scarajectory-*-py3-none-any.whl
rm -f get-pip.py
chmod 755 /usr/local/lib/python3.10/dist-packages/usr/local/bin/scarajectory_run.py
ln -s /usr/local/lib/python3.10/dist-packages/usr/local/bin/scarajectory_run.py /usr/local/bin/scarajectory_run.py
You can use Docker to create image/container, or You can use pip to install
# python3
pip3 install scarajectory
π¦ DependenciesΒΆ
scarajectory requires next modules and libraries
π Tool structureΒΆ
scarajectory is based on OOP and Clean Architecture.
Tool structure
scarajectory/
βββ core/
βΒ Β βββ __init__.py
βΒ Β βββ model/
βΒ Β βΒ Β βββ canvas_interaction_state.py
βΒ Β βΒ Β βββ canvas_settings_dto.py
βΒ Β βΒ Β βββ canvas_tool_mode.py
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ itrajectory_plan.py
βΒ Β βΒ Β βββ plan_history.py
βΒ Β βΒ Β βββ point_dto.py
βΒ Β βΒ Β βββ scara_bounds.py
βΒ Β βΒ Β βββ stream_config_dto.py
βΒ Β βΒ Β βββ stream_progress.py
βΒ Β βΒ Β βββ stream_state.py
βΒ Β βΒ Β βββ trajectory_metrics.py
βΒ Β βΒ Β βββ trajectory_plan.py
βΒ Β βΒ Β βββ trajectory_serializer.py
βΒ Β βΒ Β βββ validation_result_dto.py
βΒ Β βΒ Β βββ viewport_transform.py
βΒ Β βΒ Β βββ waypoint.py
βΒ Β βββ service/
βΒ Β βββ engine.py
βΒ Β βββ __init__.py
βΒ Β βββ iplan_storage_service.py
βΒ Β βββ iservice.py
βΒ Β βββ istream_observer.py
βΒ Β βββ itrajectory_observer.py
βΒ Β βββ itrajectory_streamer.py
βΒ Β βββ itrajectory_validator.py
βΒ Β βββ plan_storage_service.py
βΒ Β βββ trajectory_validator.py
βββ engine.py
βββ infrastructure/
βΒ Β βββ cli/
βΒ Β βΒ Β βββ engine.py
βΒ Β βΒ Β βββ icli.py
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ setup/
βΒ Β βΒ Β βββ bundle.py
βΒ Β βΒ Β βββ dep_validator.py
βΒ Β βΒ Β βββ dependencies.py
βΒ Β βΒ Β βββ factory.py
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ keys.py
βΒ Β βΒ Β βββ opt_validator.py
βΒ Β βΒ Β βββ options.py
βΒ Β βΒ Β βββ registry.py
βΒ Β βΒ Β βββ validator.py
βΒ Β βββ command/
βΒ Β βΒ Β βββ command.py
βΒ Β βΒ Β βββ icommand_definition.py
βΒ Β βΒ Β βββ icommand_executor.py
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ studio_command_definition.py
βΒ Β βΒ Β βββ studio_command_executor.py
βΒ Β βββ communication/
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ protocol/
βΒ Β βΒ Β βΒ Β βββ command_formatter.py
βΒ Β βΒ Β βΒ Β βββ command_templates.py
βΒ Β βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βΒ Β βββ protocol_parser.py
βΒ Β βΒ Β βΒ Β βββ robot_response_dto.py
βΒ Β βΒ Β βββ serial_port_scanner.py
βΒ Β βΒ Β βββ serial_streamer.py
βΒ Β βΒ Β βββ stream_session.py
βΒ Β βΒ Β βββ transport/
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ itransport.py
βΒ Β βΒ Β βββ serial_transport.py
βΒ Β βΒ Β βββ tcp_transport.py
βΒ Β βββ config/
βΒ Β βΒ Β βββ scara_geometry.json
βΒ Β βΒ Β βββ scarajectory.cfg
βΒ Β βΒ Β βββ scarajectory.logo
βΒ Β βΒ Β βββ scheme.json
βΒ Β βββ gui/
βΒ Β βΒ Β βββ canvas.py
βΒ Β βΒ Β βββ components/
βΒ Β βΒ Β βΒ Β βββ canvas_renderer.py
βΒ Β βΒ Β βΒ Β βββ canvas_tool_handler.py
βΒ Β βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βΒ Β βββ jog_tab.py
βΒ Β βΒ Β βΒ Β βββ menu_bar.py
βΒ Β βΒ Β βΒ Β βββ preview_tab.py
βΒ Β βΒ Β βΒ Β βββ serial_console.py
βΒ Β βΒ Β βΒ Β βββ stream_status_bar.py
βΒ Β βΒ Β βΒ Β βββ streamer_tab.py
βΒ Β βΒ Β βΒ Β βββ toolbar.py
βΒ Β βΒ Β βΒ Β βββ validation_tab.py
βΒ Β βΒ Β βΒ Β βββ waypoint_editor.py
βΒ Β βΒ Β βββ controls.py
βΒ Β βΒ Β βββ engine.py
βΒ Β βΒ Β βββ icanvas.py
βΒ Β βΒ Β βββ icontrols.py
βΒ Β βΒ Β βββ igui.py
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ itable.py
βΒ Β βΒ Β βββ table.py
βΒ Β βΒ Β βββ theme.py
βΒ Β βββ __init__.py
βββ __init__.py
βββ py.typed
βββ setup/
βββ bundle.py
βββ dep_validator.py
βββ dependencies.py
βββ factory.py
βββ __init__.py
βββ keys.py
βββ opt_validator.py
βββ options.py
βββ registry.py
βββ validator.py
15 directories, 100 files
β¨ FeaturesΒΆ
Interactive Vector CAD Editor: Real-time vector drafting with dedicated Point, Line, Rectangle, Circle, and Freehand tools with live vertex dragging and viewport zoom/pan.
Kinematic Reachability & Deadzone Enforcement: Annular geometric validation ensuring trajectories stay within reachable workspace boundaries (\(R_{min} = |L_1 - L_2|\), \(R_{max} = L_1 + L_2\)).
Undo / Redo Transaction Stack: Non-destructive history management for waypoint additions, modifications, insertions, and deletions (
Ctrl+Z,Ctrl+Y).ASCII Protocol Generation: Generates micro-command streaming packets for RP2040 firmware (
<pt#X#Y#Z#PHI#SPEED#end>).Sliding Window Hardware Streaming: Multi-threaded USB serial (
/dev/ttyACM0) and TCP socket streaming with dynamic ACK tracking, auto-pause on buffer full, and progress monitoring.Manual Jogging & Diagnostics: Interactive jog grid (X, Y, Z, Phi), vacuum pump and release valve toggles, homing, status queries, and raw serial command console.
Configurable Kinematics & Dimensions: Dynamic robot link lengths (\(L_1, L_2\)), stroke limits (\(Z_{min}, Z_{max}\)), and speed bounds configurable via CLI options and JSON schema.
Strict Quality & SOLID Standards: 100% protocol conformity, zero ISP/SRP violations, 81% test coverage, and 10.00 / 10.00 Pylint score.
π SCARA Kinematic & Geometric ConfigurationΒΆ
The robot dimensions and physical boundaries can be customized in scara_geometry.json or injected programmatically:
Parameter |
Default Value |
Description |
|---|---|---|
l1 |
|
Primary arm link length (shoulder to elbow). |
l2 |
|
Secondary arm link length (elbow to wrist). |
r_min |
|
Inner singular deadzone radius (\(|L_1 - L_2|\)). |
r_max |
|
Maximum horizontal reach boundary (\(L_1 + L_2\)). |
z_min |
|
Minimum vertical height limit (bed level). |
z_max |
|
Maximum vertical stroke limit. |
min_speed |
|
Minimum allowable feedrate speed. |
max_speed |
|
Maximum allowable safe feedrate speed. |
π Code coverageΒΆ
Name |
Stmts |
Miss |
Cover |
|---|---|---|---|
scarajectory/__init__.py |
9 |
0 |
100% |
scarajectory/core/__init__.py |
9 |
0 |
100% |
scarajectory/core/model/__init__.py |
9 |
0 |
100% |
scarajectory/core/model/canvas_interaction_state.py |
26 |
0 |
100% |
scarajectory/core/model/canvas_settings_dto.py |
15 |
0 |
100% |
scarajectory/core/model/canvas_tool_mode.py |
17 |
0 |
100% |
scarajectory/core/model/itrajectory_plan.py |
31 |
0 |
100% |
scarajectory/core/model/plan_history.py |
34 |
1 |
97% |
scarajectory/core/model/point_dto.py |
18 |
0 |
100% |
scarajectory/core/model/scara_bounds.py |
18 |
0 |
100% |
scarajectory/core/model/stream_config_dto.py |
15 |
0 |
100% |
scarajectory/core/model/stream_progress.py |
25 |
3 |
88% |
scarajectory/core/model/stream_state.py |
17 |
0 |
100% |
scarajectory/core/model/trajectory_metrics.py |
37 |
7 |
81% |
scarajectory/core/model/trajectory_plan.py |
100 |
14 |
86% |
scarajectory/core/model/trajectory_serializer.py |
29 |
0 |
100% |
scarajectory/core/model/validation_result_dto.py |
15 |
0 |
100% |
scarajectory/core/model/viewport_transform.py |
48 |
0 |
100% |
scarajectory/core/model/waypoint.py |
42 |
4 |
90% |
scarajectory/core/service/__init__.py |
9 |
0 |
100% |
scarajectory/core/service/engine.py |
45 |
3 |
93% |
scarajectory/core/service/iplan_storage_service.py |
16 |
0 |
100% |
scarajectory/core/service/iservice.py |
26 |
0 |
100% |
scarajectory/core/service/istream_observer.py |
15 |
0 |
100% |
scarajectory/core/service/itrajectory_observer.py |
14 |
0 |
100% |
scarajectory/core/service/itrajectory_streamer.py |
25 |
0 |
100% |
scarajectory/core/service/itrajectory_validator.py |
18 |
0 |
100% |
scarajectory/core/service/plan_storage_service.py |
17 |
0 |
100% |
scarajectory/core/service/trajectory_validator.py |
69 |
9 |
87% |
scarajectory/engine.py |
64 |
30 |
53% |
scarajectory/infrastructure/__init__.py |
9 |
0 |
100% |
scarajectory/infrastructure/cli/__init__.py |
9 |
0 |
100% |
scarajectory/infrastructure/cli/engine.py |
39 |
7 |
82% |
scarajectory/infrastructure/cli/icli.py |
15 |
0 |
100% |
scarajectory/infrastructure/cli/setup/__init__.py |
9 |
0 |
100% |
scarajectory/infrastructure/cli/setup/bundle.py |
22 |
1 |
95% |
scarajectory/infrastructure/cli/setup/dep_validator.py |
36 |
5 |
86% |
scarajectory/infrastructure/cli/setup/dependencies.py |
18 |
0 |
100% |
scarajectory/infrastructure/cli/setup/factory.py |
37 |
1 |
97% |
scarajectory/infrastructure/cli/setup/keys.py |
28 |
0 |
100% |
scarajectory/infrastructure/cli/setup/opt_validator.py |
36 |
5 |
86% |
scarajectory/infrastructure/cli/setup/options.py |
17 |
0 |
100% |
scarajectory/infrastructure/cli/setup/registry.py |
24 |
1 |
96% |
scarajectory/infrastructure/cli/setup/validator.py |
43 |
5 |
88% |
scarajectory/infrastructure/command/__init__.py |
9 |
0 |
100% |
scarajectory/infrastructure/command/command.py |
16 |
0 |
100% |
scarajectory/infrastructure/command/icommand_definition.py |
14 |
0 |
100% |
scarajectory/infrastructure/command/icommand_executor.py |
14 |
0 |
100% |
scarajectory/infrastructure/command/studio_command_definition.py |
24 |
1 |
96% |
scarajectory/infrastructure/command/studio_command_executor.py |
38 |
15 |
61% |
scarajectory/infrastructure/communication/__init__.py |
9 |
0 |
100% |
scarajectory/infrastructure/communication/protocol/__init__.py |
8 |
0 |
100% |
scarajectory/infrastructure/communication/protocol/command_formatter.py |
58 |
9 |
84% |
scarajectory/infrastructure/communication/protocol/command_templates.py |
35 |
2 |
94% |
scarajectory/infrastructure/communication/protocol/protocol_parser.py |
64 |
17 |
73% |
scarajectory/infrastructure/communication/protocol/robot_response_dto.py |
17 |
0 |
100% |
scarajectory/infrastructure/communication/serial_port_scanner.py |
36 |
7 |
81% |
scarajectory/infrastructure/communication/serial_streamer.py |
150 |
83 |
45% |
scarajectory/infrastructure/communication/stream_session.py |
18 |
0 |
100% |
scarajectory/infrastructure/communication/transport/__init__.py |
8 |
0 |
100% |
scarajectory/infrastructure/communication/transport/itransport.py |
19 |
0 |
100% |
scarajectory/infrastructure/communication/transport/serial_transport.py |
104 |
63 |
39% |
scarajectory/infrastructure/communication/transport/tcp_transport.py |
120 |
80 |
33% |
scarajectory/infrastructure/gui/__init__.py |
9 |
0 |
100% |
scarajectory/infrastructure/gui/canvas.py |
170 |
92 |
46% |
scarajectory/infrastructure/gui/components/__init__.py |
9 |
0 |
100% |
scarajectory/infrastructure/gui/components/canvas_renderer.py |
79 |
23 |
71% |
scarajectory/infrastructure/gui/components/canvas_tool_handler.py |
42 |
0 |
100% |
scarajectory/infrastructure/gui/components/jog_tab.py |
67 |
8 |
88% |
scarajectory/infrastructure/gui/components/menu_bar.py |
75 |
14 |
81% |
scarajectory/infrastructure/gui/components/preview_tab.py |
32 |
4 |
88% |
scarajectory/infrastructure/gui/components/serial_console.py |
34 |
6 |
82% |
scarajectory/infrastructure/gui/components/stream_status_bar.py |
29 |
4 |
86% |
scarajectory/infrastructure/gui/components/streamer_tab.py |
96 |
31 |
68% |
scarajectory/infrastructure/gui/components/toolbar.py |
73 |
9 |
88% |
scarajectory/infrastructure/gui/components/validation_tab.py |
35 |
5 |
86% |
scarajectory/infrastructure/gui/components/waypoint_editor.py |
71 |
17 |
76% |
scarajectory/infrastructure/gui/controls.py |
44 |
3 |
93% |
scarajectory/infrastructure/gui/engine.py |
98 |
19 |
81% |
scarajectory/infrastructure/gui/icanvas.py |
20 |
0 |
100% |
scarajectory/infrastructure/gui/icontrols.py |
16 |
0 |
100% |
scarajectory/infrastructure/gui/igui.py |
17 |
0 |
100% |
scarajectory/infrastructure/gui/itable.py |
14 |
0 |
100% |
scarajectory/infrastructure/gui/table.py |
77 |
29 |
62% |
scarajectory/infrastructure/gui/theme.py |
58 |
0 |
100% |
scarajectory/setup/__init__.py |
9 |
0 |
100% |
scarajectory/setup/bundle.py |
25 |
1 |
96% |
scarajectory/setup/dep_validator.py |
36 |
5 |
86% |
scarajectory/setup/dependencies.py |
21 |
0 |
100% |
scarajectory/setup/factory.py |
84 |
4 |
95% |
scarajectory/setup/keys.py |
37 |
0 |
100% |
scarajectory/setup/opt_validator.py |
36 |
5 |
86% |
scarajectory/setup/options.py |
20 |
0 |
100% |
scarajectory/setup/registry.py |
34 |
1 |
97% |
scarajectory/setup/validator.py |
53 |
5 |
91% |
Total |
3455 |
658 |
81% |
π UsageΒΆ
Install package
pip3 install scarajectory
Prepare main entry point by downloading main.py or create your own.
wget -O main.py https://raw.githubusercontent.com/vroncevic/scarajectory/main/main.py
CLI Command OptionsΒΆ
Launch the graphical studio with default configuration:
python3 main.py studio
Launch with initial trajectory plan file and disabled deadzone restriction:
python3 main.py studio --file ./trajectories/rectangle_demo.json --dead-zone disable --verbose enable
Option |
Type |
Choices |
Description |
|---|---|---|---|
βfile |
|
File path |
Path to initial trajectory JSON plan file to load on startup. |
βdead-zone |
|
|
Enable or disable inner deadzone geometric validation (\(R_{min}\)). |
βverbose |
|
|
Enable or disable verbose ATS operational logging. |
Interactive Motion Planning WorkflowΒΆ
Design Trajectory & Geometry: * Use Point, Line, Rectangle, Circle, or Freehand tools directly on the interactive vector canvas. * Fine-tune Cartesian parameters (\(X, Y, Z, \phi, \text{speed}\)) using the Waypoint Data Table or interactive vertex drag.
Kinematic Validation: * Open the Plan Validation tab and run validation against reachability limits (\(L_1 = 150\text{ mm}, L_2 = 120\text{ mm}\)). * Verify total path length and estimated execution time.
ASCII Program Preview: * Inspect the formatted ASCII micro-command stream (
<pt#...#end>) under the Program Preview tab.Hardware Streaming & Execution: * Connect to
/dev/ttyACM0(or TCP host) under the Hardware Streamer tab. * Trigger streaming to execute real-time motion on the physical SCARA robot.Manual Jogging & Diagnostics: * Use the Manual Jog tab for directional jog movements, vacuum pump activation, release valve triggers, and homing.
π DocsΒΆ
More documentation and info at
π₯ ContributingΒΆ
π Copyright and licenceΒΆ
Copyright (C) 2026 by vroncevic.github.io/scarajectory
scarajectory is free software; you can redistribute it and/or modify it under the same terms as Python itself, either Python version 3.x or, at your option, any later version of Python 3 you may have available.
Special thanks to Google and the Google developer ecosystem for their tremendous support and innovative tools from the Google bundle that empowered the development and realization of this project. Google, you make this world a better place! πβ¨
Lets help and support PSF.

