A high-performance, real-time motion profiling library designed specifically for VEX Robotics competitions. This library generates smooth, kinematics-constrained trajectories for autonomous robot movement.
- Real-time trajectory generation optimized for rapid regeneration in under 5ms
- Differential drive kinematics with configurable robot parameters
- Multi-path support for complex autonomous routines
- Physics-based constraints including friction, acceleration, and velocity limits
- CubicBezier: Implements smooth parametric curves using control points
- MultiPath: Concatenates multiple path segments for complex trajectories
- Mathematical derivatives: Calculated first and second derivatives using Eigen
- DifferentialKinematics: Models tank drive/differential drive robots
- Configurable parameters: Track width, maximum velocity, acceleration, and friction coefficients
- Wheel velocity calculations: Converts linear and angular velocities to individual wheel speeds for use on a robot
- Double pass: Calculates maximum safe velocities considering robot constraints
- Time-optimal profiling: Minimizes trajectory execution time while respecting physical limits
- C++17 compatible compiler (GCC 7.0+ recommended)
- Eigen3 library (included in
include/Eigen/) - Make build system
# Clone the repository
git clone https://github.com/Cooper7196/Real-Time-Motion-Profiling.git
cd Real-Time-Motion-Profiling
# Build the project
make
# Run the example
./main#include "kinematics.hpp"
#include "path.hpp"
#include "trajectoryGenerator.hpp"
int main() {
// Define robot parameters
double trackWidth = 12.0; // inches
double maxVel = 75.0; // inches/second
double maxAccel = 75.0; // inches/second²
double friction = 0.4; // coefficient of friction
// Create kinematics model
auto kinematics = new DifferentialKinematics(trackWidth, maxVel, maxAccel, friction);
// Define path using control points
auto path = new CubicBezier({0, 0}, {24, 0}, {24, 24}, {48, 24});
// Generate trajectory
TrajectoryGenerator generator(kinematics, 0.01); // 1cm resolution
generator.generateTrajectory(path);
// Get trajectory points
std::vector<Pose> trajectory = generator.getTrajectory();
// Use trajectory for robot control...
return 0;
}This repository includes a comprehensive technical document Motion Profiling.pdf that provides:
- Theoretical foundations of motion profiling algorithms
- Mathematical derivations for trajectory generation
- Step-by-step implementation guidance for building your own motion profiling system
- VEX-specific considerations and optimization strategies
- Visual examples and diagrams explaining key concepts
This document is generated based on the typst document in typst/, any contributions are welcome.
I am also availible on discord at @comodomo, and am happy to respond to any queries about motion profiling.
This project was developed for VEX Robotics applications and is open to contributions from the VEX community:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.