SCARA Robot Python Emulator & 2D/3D Kinematic VisualizerΒΆ
scaraemu is a standalone kinematic emulator, real-time 2D/3D visualizer, and hardware communication bridge for 4-DOF 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 scaraemu type the following
tar xvzf scaraemu-x.y.z.tar.gz
cd scaraemu-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/scaraemu-*-py3-none-any.whl
rm -f get-pip.py
chmod 755 /usr/local/lib/python3.10/dist-packages/usr/local/bin/scaraemu_run.py
ln -s /usr/local/lib/python3.10/dist-packages/usr/local/bin/scaraemu_run.py /usr/local/bin/scaraemu_run.py
You can use Docker to create image/container, or You can use pip to install
# python3
pip3 install scaraemu
π¦ DependenciesΒΆ
scaraemu requires next modules and libraries
π Tool structureΒΆ
scaraemu is based on OOP and Hexagonal Architecture.
Tool structure
scaraemu/
βββ core/
βΒ Β βββ __init__.py
βΒ Β βββ model/
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ kinematics_config_dto.py
βΒ Β βΒ Β βββ scara_geometry.py
βΒ Β βΒ Β βββ scara_joints.py
βΒ Β βΒ Β βββ scara_pose.py
βΒ Β βΒ Β βββ scara_step_coords.py
βΒ Β βΒ Β βββ simulation_state_dto.py
βΒ Β βΒ Β βββ telemetry_dto.py
βΒ Β βββ service/
βΒ Β βββ demo_generator.py
βΒ Β βββ emulator_service.py
βΒ Β βββ engine.py
βΒ Β βββ iemulator_service.py
βΒ Β βββ ikinematics_service.py
βΒ Β βββ __init__.py
βΒ Β βββ iservice.py
βΒ Β βββ kinematics_service.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
βΒ Β βΒ Β βββ emulator_command_definition.py
βΒ Β βΒ Β βββ emulator_command_executor.py
βΒ Β βΒ Β βββ icommand_definition.py
βΒ Β βΒ Β βββ icommand_executor.py
βΒ Β βΒ Β βββ __init__.py
βΒ Β βββ communication/
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ protocol/
βΒ Β βΒ Β βΒ Β βββ command_formatter.py
βΒ Β βΒ Β βΒ Β βββ command_templates.py
βΒ Β βΒ Β βΒ Β βββ firmware_response_dto.py
βΒ Β βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βΒ Β βββ protocol_parser.py
βΒ Β βΒ Β βββ serial_port_scanner.py
βΒ Β βΒ Β βββ transport/
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ itransport.py
βΒ Β βΒ Β βββ serial_transport.py
βΒ Β βΒ Β βββ tcp_transport.py
βΒ Β βββ config/
βΒ Β βΒ Β βββ scara_geometry.json
βΒ Β βΒ Β βββ scaraemu.cfg
βΒ Β βΒ Β βββ scaraemu.logo
βΒ Β βΒ Β βββ scheme.json
βΒ Β βββ gui/
βΒ Β βββ canvas_xy.py
βΒ Β βββ canvas_z.py
βΒ Β βββ components/
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ jog_panel.py
βΒ Β βΒ Β βββ serial_bar.py
βΒ Β βΒ Β βββ serial_console_panel.py
βΒ Β βΒ Β βββ telemetry_panel.py
βΒ Β βΒ Β βββ trajectory_demo_panel.py
βΒ Β βββ engine.py
βΒ Β βββ hardware_bridge_controller.py
βΒ Β βββ icanvas_xy.py
βΒ Β βββ icanvas_z.py
βΒ Β βββ igui.py
βΒ Β βββ __init__.py
βΒ Β βββ theme.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, 79 files
β¨ FeaturesΒΆ
2D Planar Dual-Link Visualizer: Real-time rendering of primary ($L_1$) and secondary ($L_2$) arm links, active joint angles, target crosshair, and animated motion path trail.
Side Elevation Z-Tower View: Multi-rod lead screw carriage elevation, active tool height, and radial extension profile visualization.
Interactive Targeting & Jogging: Direct mouse click position targeting on both XY and Z canvases, Cartesian delta jogging ($X, Y, Z, Phi$), Lefty/Righty elbow toggling, and Emergency Stop.
Autonomous Trajectory Demos: Pre-programmed autonomous demonstration trajectories (Circle, Square, 5-Point Star, 3D Helical Coil).
Hardware Serial Bridge & Protocol Parser: Bidirectional streaming over USB Serial (RP2040 micro-commands) with raw terminal telemetry log and manual 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, high 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 |
|---|---|---|---|
scaraemu/__init__.py |
9 |
0 |
100% |
scaraemu/core/__init__.py |
9 |
0 |
100% |
scaraemu/core/model/__init__.py |
9 |
0 |
100% |
scaraemu/core/model/kinematics_config_dto.py |
18 |
0 |
100% |
scaraemu/core/model/scara_geometry.py |
24 |
0 |
100% |
scaraemu/core/model/scara_joints.py |
17 |
0 |
100% |
scaraemu/core/model/scara_pose.py |
16 |
0 |
100% |
scaraemu/core/model/scara_step_coords.py |
16 |
0 |
100% |
scaraemu/core/model/simulation_state_dto.py |
17 |
0 |
100% |
scaraemu/core/model/telemetry_dto.py |
21 |
0 |
100% |
scaraemu/core/service/__init__.py |
9 |
0 |
100% |
scaraemu/core/service/demo_generator.py |
55 |
0 |
100% |
scaraemu/core/service/emulator_service.py |
120 |
28 |
77% |
scaraemu/core/service/engine.py |
24 |
0 |
100% |
scaraemu/core/service/iemulator_service.py |
30 |
0 |
100% |
scaraemu/core/service/ikinematics_service.py |
24 |
0 |
100% |
scaraemu/core/service/iservice.py |
17 |
0 |
100% |
scaraemu/core/service/kinematics_service.py |
97 |
4 |
96% |
scaraemu/engine.py |
64 |
64 |
0% |
scaraemu/infrastructure/cli/__init__.py |
9 |
0 |
100% |
scaraemu/infrastructure/cli/engine.py |
40 |
7 |
82% |
scaraemu/infrastructure/cli/icli.py |
15 |
0 |
100% |
scaraemu/infrastructure/cli/setup/__init__.py |
9 |
0 |
100% |
scaraemu/infrastructure/cli/setup/bundle.py |
22 |
1 |
95% |
scaraemu/infrastructure/cli/setup/dep_validator.py |
36 |
1 |
97% |
scaraemu/infrastructure/cli/setup/dependencies.py |
18 |
0 |
100% |
scaraemu/infrastructure/cli/setup/factory.py |
37 |
1 |
97% |
scaraemu/infrastructure/cli/setup/keys.py |
28 |
0 |
100% |
scaraemu/infrastructure/cli/setup/opt_validator.py |
35 |
1 |
97% |
scaraemu/infrastructure/cli/setup/options.py |
17 |
0 |
100% |
scaraemu/infrastructure/cli/setup/registry.py |
31 |
1 |
97% |
scaraemu/infrastructure/cli/setup/validator.py |
43 |
5 |
88% |
scaraemu/infrastructure/command/__init__.py |
9 |
0 |
100% |
scaraemu/infrastructure/command/command.py |
16 |
0 |
100% |
scaraemu/infrastructure/command/emulator_command_definition.py |
24 |
1 |
96% |
scaraemu/infrastructure/command/emulator_command_executor.py |
32 |
5 |
84% |
scaraemu/infrastructure/command/icommand_definition.py |
14 |
0 |
100% |
scaraemu/infrastructure/command/icommand_executor.py |
14 |
0 |
100% |
scaraemu/infrastructure/communication/__init__.py |
9 |
0 |
100% |
scaraemu/infrastructure/communication/protocol/__init__.py |
9 |
0 |
100% |
scaraemu/infrastructure/communication/protocol/command_formatter.py |
38 |
0 |
100% |
scaraemu/infrastructure/communication/protocol/command_templates.py |
20 |
0 |
100% |
scaraemu/infrastructure/communication/protocol/firmware_response_dto.py |
17 |
0 |
100% |
scaraemu/infrastructure/communication/protocol/protocol_parser.py |
64 |
3 |
95% |
scaraemu/infrastructure/communication/serial_port_scanner.py |
43 |
3 |
93% |
scaraemu/infrastructure/communication/transport/__init__.py |
9 |
0 |
100% |
scaraemu/infrastructure/communication/transport/itransport.py |
22 |
5 |
77% |
scaraemu/infrastructure/communication/transport/serial_transport.py |
102 |
59 |
42% |
scaraemu/infrastructure/communication/transport/tcp_transport.py |
96 |
55 |
43% |
scaraemu/infrastructure/gui/__init__.py |
9 |
0 |
100% |
scaraemu/infrastructure/gui/canvas_xy.py |
105 |
71 |
32% |
scaraemu/infrastructure/gui/canvas_z.py |
74 |
46 |
38% |
scaraemu/infrastructure/gui/components/__init__.py |
9 |
0 |
100% |
scaraemu/infrastructure/gui/components/jog_panel.py |
76 |
47 |
38% |
scaraemu/infrastructure/gui/components/serial_bar.py |
70 |
46 |
34% |
scaraemu/infrastructure/gui/components/serial_console_panel.py |
56 |
35 |
38% |
scaraemu/infrastructure/gui/components/telemetry_panel.py |
62 |
34 |
45% |
scaraemu/infrastructure/gui/components/trajectory_demo_panel.py |
46 |
25 |
46% |
scaraemu/infrastructure/gui/engine.py |
174 |
114 |
34% |
scaraemu/infrastructure/gui/hardware_bridge_controller.py |
93 |
19 |
80% |
scaraemu/infrastructure/gui/icanvas_xy.py |
19 |
2 |
89% |
scaraemu/infrastructure/gui/icanvas_z.py |
17 |
2 |
88% |
scaraemu/infrastructure/gui/igui.py |
16 |
2 |
88% |
scaraemu/infrastructure/gui/theme.py |
28 |
0 |
100% |
scaraemu/setup/__init__.py |
9 |
0 |
100% |
scaraemu/setup/bundle.py |
25 |
1 |
96% |
scaraemu/setup/dep_validator.py |
36 |
1 |
97% |
scaraemu/setup/dependencies.py |
21 |
0 |
100% |
scaraemu/setup/factory.py |
80 |
3 |
96% |
scaraemu/setup/keys.py |
39 |
0 |
100% |
scaraemu/setup/opt_validator.py |
36 |
2 |
94% |
scaraemu/setup/options.py |
22 |
0 |
100% |
scaraemu/setup/registry.py |
34 |
1 |
97% |
scaraemu/setup/validator.py |
53 |
5 |
91% |
Total |
2683 |
700 |
74% |
π UsageΒΆ
Install package
pip3 install scaraemu
Prepare main entry point by downloading main.py or create your own.
wget -O main.py https://raw.githubusercontent.com/vroncevic/scaraemu/main/main.py
CLI Command OptionsΒΆ
Launch the graphical emulator with default configuration:
python3 main.py emulator
Launch with custom geometry overrides:
python3 main.py emulator --l1 160.0 --l2 110.0 --verbose
Option |
Type |
Choices |
Description |
|---|---|---|---|
βl1 |
|
Length in mm |
Override primary arm length L1 in millimeters. |
βl2 |
|
Length in mm |
Override secondary arm length L2 in millimeters. |
βz-min |
|
Limit in mm |
Minimum vertical Z boundary in millimeters. |
βz-max |
|
Limit in mm |
Maximum vertical Z boundary in millimeters. |
βrobot-config |
|
File path |
Path to custom robot geometry JSON file. |
βverbose |
|
Flag |
Enable verbose ATS operational logging. |
Interactive Emulation & Control WorkflowΒΆ
2D/3D Kinematic Visualizer: * Inspect top-down planar canvas (XY) and side elevation carriage (Z). * Directly click anywhere inside reachable annular workspace to command moves.
Manual Jogging & Axis Control: * Step along \(X, Y, Z, \Phi\) with configurable step sizes under Monitor & Jog. * Toggle between Lefty and Righty elbow configurations or toggle motor power.
Autonomous Demo Trajectories: * Under the Trajectories tab, select Circle, Square, 5-Star, or 3D Helix. * Watch the real-time simulation interpolator render toolhead paths.
Hardware Bridge & Telemetry Streaming: * Connect to physical SCARA microcontroller via
/dev/ttyACM0or TCP socket. * Telemetry updates synchronize live hardware position with the visualizer.Serial Command Console: * Inspect incoming raw protocol packets (
<TELEM...>,<RESP:...>) and send custom commands.
π DocsΒΆ
More documentation and info at
π₯ ContributingΒΆ
π Copyright and licenceΒΆ
Copyright (C) 2026 by vroncevic.github.io/scaraemu
scaraemu 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.

