Skip to main content

Crate kernelvex

Crate kernelvex 

Source
Expand description

§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

§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

ModuleDescription
controlPID controllers, feedforward, RAMSETE, pure pursuit
dtDrivetrain models and motor groups
motionMotion profiles and trajectories
odomOdometry, pose estimation, tracking wheels
utilType-safe units, logging, solenoid groups

Re-exports§

pub use odom::wheel::OmniWheel;
pub use odom::wheel::TrackingWheel;
pub use odom::wheel::TrackingRig;
pub use odom::chassis::DriveError;
pub use odom::chassis::OdomChassis;
pub use control::ramsete::RamseteController;
pub use control::ramsete::RamseteReference;
pub use motion::profile::TrapezoidalConstraints;
pub use motion::trajectory::Trajectory;
pub use motion::trajectory::TrajectoryPoint;
pub use odom::pose::Pose;
pub use util::si::QAngle;
pub use util::si::QLength;
pub use util::si::QTime;
pub use util::solenoidgroup::SolenoidGroup;
pub use dt::differential::DifferentialDrive;
pub use dt::motorgroup::MotorGroup;
pub use util::logger::Logger;
pub use control::pid::AngularPid;
pub use control::pid::Pid;
pub use control::purepursuit::PurePursuit;
pub use util::controller::*;
pub use odom::wheel::*;
pub use dt::model::*;
pub use util::si::*;
pub use util::utils::*;
pub use control::feedforward::*;
pub use dt::differential::*;

Modules§

control
dt
motion
odom
util

Macros§

shared_motor
Creates a shared motor array wrapped in Rc<RefCell<[Motor; N]>>.