This project is a 2D SCARA robot forward kinematics visualizer developed using JavaFX. It allows users to interactively explore how joint angles and link lengths affect the pose and reachable workspace of a SCARA manipulator.
The application is designed for educational and demonstration purposes, with a strong focus on clarity, interactivity, and correct kinematic behavior.
-
Visualize forward kinematics of a 2-DOF SCARA robot
-
Understand the relationship between:
- Joint angles (q1, q2)
- Link lengths (a1, a2)
- End-effector position and orientation
-
Demonstrate robot workspace, joint limits, and motion history
- Forward kinematics (planar 2-link manipulator)
- World-to-screen coordinate transformation
- Workspace boundary visualization
- Joint limit checking
- Interactive UI controls using JavaFX
-
Sliders and text fields for:
- Joint 1 angle (q1)
- Joint 2 angle (q2)
- Link length a1
- Link length a2
-
Values are synchronized between sliders and input fields
-
Press Enter or click Draw to commit a pose
- Base, joint, and end-effector rendered on a canvas
- Clearly labeled joints (
Base,J1,EE) - Orientation arrow indicating end-effector direction
- Cartesian axes (+X, −X, +Y, −Y)
- Outer workspace circle: maximum reach (a1 + a2)
- Inner workspace circle: unreachable region (|a1 − a2|)
- Workspace automatically scales to fit the canvas
-
Configurable joint limits for q1 and q2
-
Visual feedback:
- Link turns red when limits are exceeded
- Angle labels turn red when out of bounds
- Toggleable end-effector trail
- Displays the historical path of the end-effector
- Automatically clears when disabled
- Reset to a predefined “home pose”
- Clears trajectory history
- Restores default parameters
The SCARA forward kinematics are defined as:
-
Joint 1:
- x₁ = a₁ cos(q₁)
- y₁ = a₁ sin(q₁)
-
End Effector:
- x = a₁ cos(q₁) + a₂ cos(q₁ + q₂)
- y = a₁ sin(q₁) + a₂ sin(q₁ + q₂)
All internal computations use radians, while the UI displays angles in degrees.
- Java (JDK 23)
- JavaFX 17 (LTS)
- FXML for UI layout
- Canvas-based rendering
-
ScaraApplicationEntry point of the JavaFX application -
ScaraControllerHandles UI logic, rendering, interaction, and validation -
Kinematics2DContains forward kinematics calculations -
scara-view.fxmlDefines the user interface layout
- Ensure Java (JDK 17 or later) is installed
- Ensure JavaFX 17 libraries are available
- Run the
ScaraApplicationclass
- Robotics coursework (e.g., CSC4702 Robotic System Development)
- Forward kinematics demonstrations
- Teaching aid for planar robot manipulators
- Interactive exploration during presentations
- Inverse kinematics solver
- Constant Cartesian-speed trajectory planning
- Collision or obstacle visualization
- Exporting trajectory data
- Multiple robot configurations
This project prioritizes correct kinematics, clear visualization, and user-friendly interaction over unnecessary complexity. All motion is deterministic and physically interpretable, making it suitable for both learning and assessment.