Mecanum Drive
This class is the standard Mecanum drive class that controls a set of four mecanum wheels while integrating the RoadRunner v1.0 library in BunyipsLib.
Since
6.0.0
Constructors
Link copied to clipboard
constructor(@NonNull driveModel: DriveModel, @NonNull motionProfile: MotionProfile, @NonNull mecanumGains: MecanumGains, @Nullable leftFront: DcMotor, @Nullable leftBack: DcMotor, @Nullable rightBack: DcMotor, @Nullable rightFront: DcMotor, @Nullable lazyImu: LazyImu, @NonNull voltageSensorMapping: HardwareMap.DeviceMapping<VoltageSensor>, @NonNull startPose: Pose2d)
Create a new MecanumDrive.
constructor(@NonNull driveModel: DriveModel, @NonNull motionProfile: MotionProfile, @NonNull mecanumGains: MecanumGains, @Nullable leftFront: DcMotor, @Nullable leftBack: DcMotor, @Nullable rightBack: DcMotor, @Nullable rightFront: DcMotor, @Nullable lazyImu: LazyImu, @NonNull voltageSensorMapping: HardwareMap.DeviceMapping<VoltageSensor>)
Create a new MecanumDrive that will start at the last known pose.
Types
Properties
Link copied to clipboard
Link copied to clipboard
Gains used for holonomic drive control.
Link copied to clipboard
The minimum distance from endpoint of the trajectory to the projected pose to begin stabilisation for the path following mode of this MecanumDrive.
Link copied to clipboard
The lookahead distance used for the current implementation of the path following mode of this MecanumDrive.
Inherited properties
Link copied to clipboard
Link copied to clipboard
Get a reference to the currently running BunyipsOpMode.
Functions
Link copied to clipboard
The constants object represents all configuration options required for creating a RoadRunner trajectory.
Link copied to clipboard
Get the raw power of each motor on the drive.
Link copied to clipboard
Calculate the first derivative of the accumulated pose from an internal localizer.
Link copied to clipboard
open fun setMotorPowers(leftFrontPower: Double, leftBackPower: Double, rightBackPower: Double, rightFrontPower: Double)
Set the raw power of each motor on the drive.
Link copied to clipboard
Set the pose accumulator this drive instance should use.
Link copied to clipboard
Set a new set of error thresholds for this drive instance to use when running trajectories.
Link copied to clipboard
Set the Localizer this drive instance should use.
Inherited functions
Link copied to clipboard
Utility function to run
NullSafety.assertComponentArgs()
on the given parameters, usually on the motors/hardware/critical objects passed into the constructor.Link copied to clipboard
Cancel the current task immediately and return to the default task, if available.
Link copied to clipboard
Default task setter extension for BunyipsSubsystem to set the default task of a subsystem.
Link copied to clipboard
Call to delegate the update of this subsystem, usually a component of another subsystem, to this subsystem.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Begin building a RoadRunner trajectory from the last-known robot position when this method is called.
open fun makeTrajectory(@NonNull startVec: Vector2d, @NonNull distUnit: Distance, ang: Double, @NonNull angUnit: Angle): TaskBuilder
open fun makeTrajectory(@NonNull startVec: Vector2d, @NonNull distUnit: Distance, ang: Double, @NonNull angUnit: Angle, @NonNull poseMap: PoseMap): TaskBuilder
Begin building a RoadRunner trajectory from the supplied pose when this method is called.
Begin building a RoadRunner trajectory from the inverse (PoseMap piped) last-known robot position when this method is called.
Link copied to clipboard
Null check consumer for the opMode field which will no-op the given consumer if an active BunyipsOpMode is not present (i.e.
Link copied to clipboard
Null assertion for the opMode field which throws a NullPointerException if an active BunyipsOpMode is not present (i.e.
Link copied to clipboard
Reset stored static instances of BunyipsSubsystem.
Link copied to clipboard
Set the default task for this subsystem, which will be run when no other task is running.
Link copied to clipboard
Set the current task to the given task, overriding any current task.
Link copied to clipboard
Call to delegate all updates of this subsystem to a thread that will begin execution on this method call.
Link copied to clipboard
Call to stop delegating updates of this subsystem to a thread.
Link copied to clipboard