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.

scarajectory python checker scarajectory python package scarajectory interface checker scarajectory isp checker scarajectory srp checker gplv3 license apache license python version github issues documentation status github contributors

πŸš€ InstallationΒΆ

scarajectory python3 build

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:

Kinematic LimitsΒΆ

Parameter

Default Value

Description

l1

150.0 mm

Primary arm link length (shoulder to elbow).

l2

120.0 mm

Secondary arm link length (elbow to wrist).

r_min

30.0 mm

Inner singular deadzone radius (\(|L_1 - L_2|\)).

r_max

270.0 mm

Maximum horizontal reach boundary (\(L_1 + L_2\)).

z_min

0.0 mm

Minimum vertical height limit (bed level).

z_max

100.0 mm

Maximum vertical stroke limit.

min_speed

1.0 mm/s

Minimum allowable feedrate speed.

max_speed

100.0 mm/s

Maximum allowable safe feedrate speed.

πŸ“Š Code coverageΒΆ

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
Studio CLI OptionsΒΆ

Option

Type

Choices

Description

–file

str

File path

Path to initial trajectory JSON plan file to load on startup.

–dead-zone

str

enable, disable

Enable or disable inner deadzone geometric validation (\(R_{min}\)).

–verbose

str

enable, disable

Enable or disable verbose ATS operational logging.

Interactive Motion Planning WorkflowΒΆ

  1. 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.

  2. 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.

  3. ASCII Program Preview: * Inspect the formatted ASCII micro-command stream (<pt#...#end>) under the Program Preview tab.

  4. 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.

  5. 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ΒΆ

Contributing to scarajectory