RobotSpeedSim demonstrates a robot being propelled by a motor.

Hierarchy (view full)

Implements

Constructors

Properties

Nf_: number = 0

Normal force at front axle.

Nr_: number = 0

Normal force at rear axle.

cm_pct_: number = 50

center of mass, as percentage. 50% is midway between wheels. Higher percentage means closer to rear wheel.

engineForce_: number = 0

Force applied at the wheel.

freeSpeed_: number = 317

Free speed rpm.

friction_: number = 1

coefficient of static friction

gravityForce_: number = 0

Gravity force on robot, full downward force.

gravityRampForce_: number = 0

Gravity force on robot, along direction of ramp.

initialState_: null | number[] = null

Initial values.

limitTorque_: boolean = true

limit torque by how much wheel can push

mass_: number = 2.5

units are kg

radius_: number = 0.045

radius of wheel, in meters

slope_: number = 0

slope of track in radians

start_: Vector = Vector.ORIGIN

starting point of track

torque_: number = 1.98

Stall torque; units are N m

vwf_: Vector = Vector.ORIGIN

Vector to front wheel axle, from center of mass, in body coords.

vwr_: Vector = Vector.ORIGIN

Vector to rear wheel axle, from center of mass, in body coords.

wheelf_: PointMass = ...

front wheel

wheelr_: PointMass = ...

rear wheel

Methods

  • Adds the given Observer to this Subject's list of Observers, so that the Observer will be notified of changes in this Subject. An Observer may call Subject.addObserver during its observe method.

    Parameters

    Returns void

  • Defines the differential equations of this ODESim; for an input set of variables, returns the current rate of change for each variable (the first derivative of each variable with respect to time).

    The timeStep is the time since the state variables were last fully calculated, which can be and often is zero. The current time can be regarded as getTime() + timeStep. The input variables correspond to the Simulation state at that time. Note that timeStep is different from the time step used to advance the Simulation (as in AdvanceStrategy.advance). The timeStep is typically used when finding collisions in CollisionSim.findCollisions.

    Parameters

    • vars: number[]

      the current array of state variables (input), corresponding to the state at getTime() + timeStep

    • change: number[]

      array of change rates for each variable (output), all values are zero on entry.

    • _timeStep: number

      the current time step (might be zero)

    Returns null | object

    null if the evaluation succeeds, otherwise an object relating to the error that occurred. The change array contains the output results.

  • Returns center of mass as percentage from rear wheel to front wheel. 99% means almost all the way to rear wheel. 1% means almost all the way to front wheel.

    Returns number

    percentage between 1% and 99%

  • Sets whether this Subject will broadcast events, typically used to temporarily disable broadcasting. Intended to be used in situations where a subclass overrides a method that broadcasts an event. This allows the subclass to prevent the superclass broadcasting that event, so that the subclass can broadcast the event when the method is completed.

    Parameters

    • value: boolean

      whether this Subject should broadcast events

    Returns boolean

    the previous value

  • Sets center of mass as percentage from rear wheel to front wheel. 99% means almost all the way to rear wheel. 1% means almost all the way to front wheel.

    Parameters

    • value: number

      percentage between 1% and 99%

    Returns void

  • Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.

    For an object whose main purpose is to represent another Printable object, it is recommended to include the result of calling toStringShort on that other object. For example, calling toStringShort() on a DisplayShape might return something like this:

    DisplayShape{polygon:Polygon{'chain3'}}
    

    Returns string

    a minimal string representation of this object.

Generated using TypeDoc