Skip to content

asteraaaaa/scara2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2D SCARA Forward Kinematics Visualizer (JavaFX)

📌 Overview

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.


🎯 Objectives

  • 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


🧠 Core Concepts Implemented

  • Forward kinematics (planar 2-link manipulator)
  • World-to-screen coordinate transformation
  • Workspace boundary visualization
  • Joint limit checking
  • Interactive UI controls using JavaFX

🖥️ Features

🔹 Interactive Controls

  • 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

🔹 Visual Output

  • 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)

🔹 Workspace Visualization

  • Outer workspace circle: maximum reach (a1 + a2)
  • Inner workspace circle: unreachable region (|a1 − a2|)
  • Workspace automatically scales to fit the canvas

🔹 Joint Limit Indication

  • Configurable joint limits for q1 and q2

  • Visual feedback:

    • Link turns red when limits are exceeded
    • Angle labels turn red when out of bounds

🔹 Trajectory Trail (Optional)

  • Toggleable end-effector trail
  • Displays the historical path of the end-effector
  • Automatically clears when disabled

🔹 Reset Function

  • Reset to a predefined “home pose”
  • Clears trajectory history
  • Restores default parameters

🧮 Kinematic Model

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.


🧰 Technology Stack

  • Java (JDK 23)
  • JavaFX 17 (LTS)
  • FXML for UI layout
  • Canvas-based rendering

📂 Project Structure

  • ScaraApplication Entry point of the JavaFX application

  • ScaraController Handles UI logic, rendering, interaction, and validation

  • Kinematics2D Contains forward kinematics calculations

  • scara-view.fxml Defines the user interface layout


🚀 How to Run

  1. Ensure Java (JDK 17 or later) is installed
  2. Ensure JavaFX 17 libraries are available
  3. Run the ScaraApplication class

🎓 Intended Use

  • Robotics coursework (e.g., CSC4702 Robotic System Development)
  • Forward kinematics demonstrations
  • Teaching aid for planar robot manipulators
  • Interactive exploration during presentations

📈 Possible Future Enhancements

  • Inverse kinematics solver
  • Constant Cartesian-speed trajectory planning
  • Collision or obstacle visualization
  • Exporting trajectory data
  • Multiple robot configurations

📝 Author Notes

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.


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages