RoadRunnerBotEntity

class RoadRunnerBotEntity(val meepMeep: MeepMeep, constraints: Constraints, width: Double, height: Double, var pose: Pose2d, val colorScheme: ColorScheme, opacity: Double, driveTrainType: DriveTrainType = DriveTrainType.MECANUM, listenToSwitchThemeRequest: Boolean = false) : BotEntity, EntityEventListener

Represents a RoadRunner bot entity in the MeepMeep simulation.

Parameters

meepMeep

The MeepMeep instance.

constraints

The motion constraints for the bot.

width

The width of the bot.

height

The height of the bot.

pose

The initial pose of the bot.

colorScheme

The color scheme for the bot.

opacity

The opacity of the bot.

driveTrainType

The type of drivetrain used by the bot.

listenToSwitchThemeRequest

Flag to listen to theme switch requests.

Constructors

Link copied to clipboard
constructor(meepMeep: MeepMeep, constraints: Constraints, width: Double, height: Double, pose: Pose2d, colorScheme: ColorScheme, opacity: Double, driveTrainType: DriveTrainType = DriveTrainType.MECANUM, listenToSwitchThemeRequest: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

The current trajectory sequence the bot is following.

Link copied to clipboard

Drive shim for the bot, initialized with the drivetrain type, constraints, and initial pose.

Link copied to clipboard

Flag indicating if the trajectory sequence is paused.

Link copied to clipboard

Flag indicating if the bot should loop the trajectory sequence.

Link copied to clipboard
open override val meepMeep: MeepMeep

The MeepMeep instance.

Link copied to clipboard
var pose: Pose2d

The pose of the bot.

Link copied to clipboard
open override val tag: String

Tag for the bot entity.

Link copied to clipboard
open override var zIndex: Int

Z-index for rendering order.

Functions

Link copied to clipboard

Follows the given trajectory sequence.

Link copied to clipboard
open override fun onAddToEntityList()

Called when the bot is added to the entity list.

Link copied to clipboard
open override fun onRemoveFromEntityList()

Called when the bot is removed from the entity list.

Link copied to clipboard
fun pause()

Pauses the trajectory sequence.

Link copied to clipboard
open override fun render(gfx: Graphics2D, canvasWidth: Int, canvasHeight: Int)

Renders the bot on the given graphics context.

Link copied to clipboard
fun resume()

Resumes the trajectory sequence.

Link copied to clipboard
open override fun setCanvasDimensions(canvasWidth: Double, canvasHeight: Double)

Sets the dimensions of the canvas.

Link copied to clipboard
fun setConstraints(constraints: Constraints)

Sets the motion constraints for the bot.

Link copied to clipboard
fun setDimensions(width: Double, height: Double): BotEntity

Sets the dimensions of the bot.

Link copied to clipboard
fun setDriveTrainType(driveTrainType: DriveTrainType)

Sets the drivetrain type for the bot.

Link copied to clipboard

Sets the trajectory progress in seconds.

Link copied to clipboard

Sets the trajectory progress slider master.

Link copied to clipboard
fun start()

Starts the trajectory sequence.

Link copied to clipboard
open override fun switchScheme(scheme: ColorScheme)

Switches the color scheme of the bot.

Link copied to clipboard
fun unpause()

Unpauses the trajectory sequence.

Link copied to clipboard
open override fun update(deltaTime: Long)

Updates the bot entity.