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
- Keep Trajplanner bug-free and compatible with current libraries.
- Make it easier to learn for new recruits.
- Understand and improve upon the code written by previous generations.
- Rediscover hidden or forgotten features.
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.
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.
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.
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
- Help Window: Juniors learned Trajplanner much faster during winter training, spending less time guessing and more time tuning.
- Flipping Functions: Greatly improved path tuning efficiency for all four robots, especially during test room and test run sessions.
- Start / End Velocity: Allowed WD R2 to jump-start quickly; potential for seamless path-to-path transitions remains to be explored.
- Memory Optimization: Not yet merged; needs thorough testing before deployment.
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.