scene:
    size: [12, 8]
    gravity: [0, -10]
    background: [230, 230, 230, 255]

entities:
    base:                       # static anchor (motor's parent)
        pose: [6.0, 4.0, 0.0]
        physics:
            mass: 0.0           # static: inv_mass = 0
            gravity_scale: 0.0
            external_forces_enabled: false
        visual:
            geometry:
                rectangle: [0.4, 0.4]
            texture: [60, 60, 60, 255]
        collision:
            geometry:
                rectangle: [0.4, 0.4]

    arm:                        # dynamic link driven by the motor
        pose: [7.0, 4.0, 0.0]
        physics:
            mass: 1.0
            inertia: 0.5        # explicit tuning value; overrides the value computed from the
                                # visual shape, and is what the PID gains below are tuned against
            gravity_scale: 0.0  # prevent gravity (10 N*m) from overpowering the P=6.0 motor (6 N*m)
        visual:
            geometry:
                rectangle: [2.0, 0.25]
            texture: [200, 80, 40, 255]
        collision:
            geometry:
                rectangle: [2.0, 0.25]

    rail:                       # static anchor (slider motor's parent)
        pose: [6.0, 1.5, 0.0]
        physics:
            mass: 0.0
            gravity_scale: 0.0
            external_forces_enabled: false
        visual:
            geometry:
                rectangle: [10.0, 0.4]
            texture: [60, 60, 60, 255]
        collision:
            geometry:
                rectangle: [10.0, 0.4]

    slider:                     # dynamic block driven along the rail
        pose: [6.0, 1.5, 0.0]   # coincident with the rail centre: starts at position 0
        physics:
            mass: 1.0
            inertia: 0.1
            gravity_scale: 0.0  # keep the demo output driven purely by the motor
        visual:
            geometry:
                rectangle: [0.8, 0.8]
            texture: [40, 160, 120, 255]
        collision:
            geometry:
                rectangle: [0.8, 0.8]

joints:
    arm_motor:
        type: revolute
        parent: base
        child: arm
        anchor: [0.0, 0.0]      # parent local frame (base centre)
        angle_min: -3.14159
        angle_max: 3.14159
        control_mode: position  # initial mode; main.cpp switches it
        target: 1.0             # radians (revolute position target)
        max_effort: 25.0
        pid: [6.0, 0.05, 0.4]

    slider_motor:
        type: prismatic
        parent: rail
        child: slider
        axis: [1.0, 0.0]        # slide along the rail's local x
        position_min: -4.0      # travel limits along the axis, in metres
        position_max: 4.0
        control_mode: position  # initial mode; main.cpp switches it
        target: 0.0             # metres along the axis
        max_effort: 20.0
        pid: [8.0, 0.2, 5.0]    # D near critical damping (2*sqrt(P*mass)) to avoid overshoot
