← Back to Home ← Back to Projects

Trajectory Planner (Trajplanner) Research & Upgrade

Sept 2023 - Jan 2024

Technologies: Python, PyQT, Embedded C, Bezier Curves, GUI Development

Background

Trajplanner is the primary tool used by the HKUST Robotics Team software sub-team to draw Bézier paths for robot navigation. It is one of our key technical advantages over other Robocon universities. My work focused on maintaining, documenting, and extending this tool to improve usability and performance for the 2024 season.

Objectives

New Features

Help Window

Previously, documentation was hard to find, so I added an in-application Help Window. New members can now learn how to use Trajplanner without searching for external docs, and experienced members can discover rare functions more easily.

Trajplanner Help Window
Help Window providing on-screen guidance

Flipping Functions

Because the 2024 game field is left-right symmetrical, I added a one-click flip button to mirror paths from red field to blue field. This saved hours of manual path tuning during test runs. Additional flip directions were included for potential future symmetrical fields.

Flipping functions
Left-right flip and other orientation flips

Start / End Velocity Control

While exploring the code, I rediscovered hidden parameters for start and end velocity. I exposed them in the GUI, allowing us to set non-zero start/end speeds. This was applied to WD R2's starting path, enabling a much faster jump start during competition.

Start/End velocity settings
Start and end velocity controls

Memory Optimization

Each Bézier path consumed about 0.5% of the mainboard's flash memory. With 10+ paths × 2 (red/blue), memory usage became significant. I analysed the output data and removed redundant information, tailoring it to our wheelbase library. The optimisation was completed just before winter training, but I did not merge it due to lack of testing time.

Test Results

Future Work & Improvements

I hope next year's software team will continue to maintain the Help Window and flipping functions to match each year's field. Start/End Velocity has great potential for connecting Bézier paths seamlessly or merging with trapezoidal motion profiles. The memory optimisation should be tested and merged - or possibly rendered unnecessary if the team switches to ROS.

Reflection

Working on Trajplanner taught me the value of digging into legacy code and the impact of small UI improvements. Even features as simple as a help button can significantly boost team productivity.