kernelvex 0.3.0

VEX Controls library
Documentation

kernelvex

A VEX robotics control library for the Vexide platform.

kernelvex provides high-level abstractions for building autonomous and driver-controlled robot programs. It includes odometry, motion control, trajectory following, and drivetrain management.

Features

  • Odometry: Track robot position using [TrackingRig] with wheel encoders and IMU
  • Drivetrains: [DifferentialDrive] with tank, arcade, and curvature control
  • Motion Profiles: [TrapezoidalConstraints] for smooth acceleration
  • Trajectory Following: [PurePursuit] and [RamseteController] for path tracking
  • PID Control: [Pid] and [AngularPid] for closed-loop control
  • Feedforward: [FeedForward] and [ArmFeedForward] for model-based control
  • Type-Safe Units: [QLength], [QAngle], [QTime] prevent unit errors

Quick Start

use kernelvex::*;

// Create a differential drivetrain
let left_motors = MotorGroup::new(vec![left1, left2]);
let right_motors = MotorGroup::new(vec![right1, right2]);
let drivetrain = DifferentialDrive::new(left_motors, right_motors, track_width);

// Set up odometry
let rig = TrackingRig::new(
    Pose::default(),
    [horizontal_wheel],
    [left_wheel, right_wheel],
    Some(imu),
);

// Create an odometry chassis for autonomous
let chassis = OdomChassis::new(drivetrain, rig, linear_pid, angular_pid);

// Drive to a point
chassis.shoot(target_pose, constraints).await?;

Module Overview

Module Description
[control] PID controllers, feedforward, RAMSETE, pure pursuit
[dt] Drivetrain models and motor groups
[motion] Motion profiles and trajectories
[odom] Odometry, pose estimation, tracking wheels
[util] Type-safe units, logging, solenoid groups