moonbitstack/moonmcl/kinematics does not have a README file

    Ackermann

    pub(all) struct Ackermann {
    wheelbase : Double
    track : Double
    } derive(
    Debug
    )

    An Ackermann steering base: the inner and outer front wheels turn by different angles about a common centre.

    Ackermann::angles

    fn Ackermann::angles(self : Ackermann, curvature~ : Double) -> (Double, Double)

    The inner and outer steering angles for a curvature: the wheel on the inside of the turn has to turn further, by the angle its shorter radius demands.

    Ackermann::jacobian

    The default Jacobian: a central difference of forward, which is what a mechanism without an analytic Jacobian gets.

    Ackermann::new

    fn Ackermann::new(wheelbase~ : Double, track~ : Double) -> Ackermann raise
    Refused

    An Ackermann base with the given wheelbase and track.

    Ackermann::to_repr

    automatically derived

    Bicycle

    pub(all) struct Bicycle {
    wheelbase : Double
    } derive(
    Debug
    )

    A bicycle model: the joint space is (speed, steering angle) and the task space the body twist (vx, vy, omega).

    Bicycle::curvature

    fn Bicycle::curvature(self : Bicycle, steering~ : Double) -> Double

    The curvature a steering angle gives.

    Bicycle::jacobian

    The default Jacobian: a central difference of forward, which is what a mechanism without an analytic Jacobian gets.

    Bicycle::new

    fn Bicycle::new(wheelbase~ : Double) -> Bicycle raise
    Refused

    A bicycle with the given wheelbase.

    Bicycle::steering

    fn Bicycle::steering(self : Bicycle, curvature~ : Double) -> Double

    The steering angle a curvature needs.

    Bicycle::to_repr

    automatically derived

    Delta

    pub(all) struct Delta {
    base_radius : Double
    platform_radius : Double
    upper_arm : Double
    lower_arm : Double
    } derive(
    Debug
    )

    A delta robot: three parallel arms from a fixed base to a moving platform.

    The joint space is the three upper-arm angles measured from horizontal and the task space the platform centre (x, y, z) under the base.
    impl Kinematics for Delta

    Delta::elbows

    The three elbows, in the base frame, for the upper-arm angles q.

    A drawing of the cell needs the elbows as well as the platform, and the cell already computes them to solve its own forward map.

    Delta::inverse

    The arm angles that put the platform centre on x, by damped least squares on the forward map.

    The closed form for one arm is a two-link solve in the arm's own plane, but the platform joint is not in that plane unless the centre lies on the arm's radius, so a cell with three arms has no per-arm closed form. Iterating on the forward map instead is exact to the tolerance and costs a handful of Jacobian evaluations.

    Delta::jacobian

    The default Jacobian: a central difference of forward, which is what a mechanism without an analytic Jacobian gets.

    Delta::new

    fn Delta::new(base_radius~ : Double, platform_radius~ : Double, upper_arm~ : Double, lower_arm~ : Double) -> Delta raise
    Refused

    A delta cell with the given geometry.

    Delta::to_repr

    automatically derived

    Differential

    pub(all) struct Differential {
    wheel_radius : Double
    track : Double
    } derive(
    Debug
    )

    A two-wheel differential drive.

    track is the distance between the wheels and wheel_radius the radius of each. The joint space is (omega_left, omega_right) in radians per second and the task space (v, omega) in metres and radians per second.

    Differential::advance

    The pose after driving twist for dt seconds.

    The arc is integrated exactly: a straight chord would cut the corner of every turn, and the error grows with the square of the period.

    Differential::jacobian

    The default Jacobian: a central difference of forward, which is what a mechanism without an analytic Jacobian gets.

    Differential::new

    fn Differential::new(wheel_radius~ : Double, track~ : Double) -> Differential raise
    Refused

    A differential drive with the given wheel radius and track width.

    Differential::to_repr

    automatically derived

    Gantry

    pub(all) struct Gantry {
    track : Double
    } derive(
    Debug
    )

    A gantry: two motors drive one gantry axis from either end, so the pair sets the position and the tilt of the beam.

    The joint space is (x, y_left, y_right, z) and the task space (x, y, z, tilt), where y is the middle of the beam and tilt the angle the difference between its ends makes.

    Gantry::jacobian

    The default Jacobian: a central difference of forward, which is what a mechanism without an analytic Jacobian gets.

    Gantry::new

    A gantry with the given beam length.

    Gantry::to_repr

    automatically derived

    Mecanum

    pub(all) struct Mecanum {
    wheel_radius : Double
    half_length : Double
    half_width : Double
    } derive(
    Debug
    )

    A four-wheel mecanum base. The joint space is the four wheel speeds in the order front left, front right, rear left, rear right, and the task space the body twist (vx, vy, omega).

    Mecanum::jacobian

    The default Jacobian: a central difference of forward, which is what a mechanism without an analytic Jacobian gets.

    Mecanum::new

    fn Mecanum::new(wheel_radius~ : Double, half_length~ : Double, half_width~ : Double) -> Mecanum raise
    Refused

    A mecanum base with the given wheel radius and half extents.

    Mecanum::to_repr

    automatically derived

    Omnidirectional

    pub(all) struct Omnidirectional {
    wheel_radius : Double
    radius : Double
    angles : Array[Double]
    } derive(
    Debug
    )

    An omnidirectional base with three or more driven wheels on a circle.

    The wheels are mounted tangentially, so each one drives along theta and the map from twist to wheel speeds is one row per wheel. With three wheels it inverts exactly; with more the inverse is the least-squares one, which spreads the effort over the wheels that can help.

    Omnidirectional::jacobian

    The default Jacobian: a central difference of forward, which is what a mechanism without an analytic Jacobian gets.

    Omnidirectional::new

    fn Omnidirectional::new(wheel_radius~ : Double, radius~ : Double, angles~ : ArrayView[Double]) -> Omnidirectional raise
    Refused

    An omnidirectional base whose wheel i sits at angles[i] radians on a circle of radius.

    Omnidirectional::to_repr

    automatically derived

    PlanarArm

    pub(all) struct PlanarArm {
    lengths : Array[Double]
    } derive(
    Debug
    )

    A planar chain of n links. The joint space is the joint angles and the task space the (x, y) of the tip.

    PlanarArm::jacobian

    The default Jacobian: a central difference of forward, which is what a mechanism without an analytic Jacobian gets.

    PlanarArm::jacobian_analytic

    The analytic Jacobian of the arm at the joint angles q: how far the tip moves for a small change in each joint.

    Link k and everything outboard of it turn with joint k, so column k is that joint's direction rotated by the total angle up to k, scaled by the reach still in front of it. Kinematics::jacobian defaults to a central difference; this is the same matrix in closed form.

    PlanarArm::new

    A planar arm with the given link lengths.

    PlanarArm::solve

    fn PlanarArm::solve(self : PlanarArm, target~ :
    Vec
    , seed~ :
    Vec
    , iterations? : Int, damping? : Double, tolerance? : Double) ->
    Vec
    raise
    Refused

    The joint angles that put the tip on target, by damped least squares.

    The damping is what makes the solve usable near a singularity: without it the Jacobian's inverse blows up and the joint velocities with it, which on a real arm is a torque the drive cannot deliver. damping is the square of the smallest singular value the solve allows.

    PlanarArm::to_repr

    automatically derived

    Scara

    pub(all) struct Scara {
    upper_arm : Double
    forearm : Double
    vertical : Double
    } derive(
    Debug
    )

    A SCARA arm: two revolute joints about the vertical axis and one prismatic joint along it.

    Scara::jacobian

    The default Jacobian: a central difference of forward, which is what a mechanism without an analytic Jacobian gets.

    Scara::new

    fn Scara::new(upper_arm~ : Double, forearm~ : Double, vertical~ : Double) -> Scara raise
    Refused

    A SCARA with the two link lengths and the vertical stroke.

    Scara::to_repr

    automatically derived