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
- Odometry: Track robot position using
TrackingRigwith wheel encoders and IMU - Drivetrains:
DifferentialDrivewith tank, arcade, and curvature control - Motion Profiles:
TrapezoidalConstraintsfor smooth acceleration - Trajectory Following:
PurePursuitandRamseteControllerfor path tracking - PID Control:
PidandAngularPidfor closed-loop control - Feedforward:
FeedForwardandArmFeedForwardfor model-based control - Type-Safe Units:
QLength,QAngle,QTimeprevent 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
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§
Macros§
- shared_
motor - Creates a shared motor array wrapped in
Rc<RefCell<[Motor; N]>>.