
ExcavatorAndBucketTemplateExternal is ExcavatorExternal:
    guide_links_bucket is HeavyMachineBundle.Linkages.TelescopicLinkPair:
        separation: stick.guide_separation
        length: 0.3
    drive_links_bucket is HeavyMachineBundle.Linkages.TelescopicLinkPair:
        length: 0.5
        separation: bucket.drive_separation

    bucket_cylinder is HeavyMachineBundle.MachineComponents.HydraulicCylinder:
        max_length: 1.6
        stroke_length: 0.4
        rod.bearing_separation: bucket.drive_separation
        piston.bearing_separation: stick.ground_separation
        motor.min_effort: -2e7
        motor.max_effort: 2e7

    stick_bucket_connection is HeavyMachineBundle.Connections.LinkedBoomConnection:
        boom_1: stick
        boom_2: bucket
        cylinder: bucket_cylinder
        guide_links: guide_links_bucket
        drive_links: drive_links_bucket
        snap_range.end: 0

    bucket is ExternalCraneSystemComponent:
        input_separation: stick.output_separation
        top_edge_begin is Math.Vec3
        top_edge_end is Math.Vec3
        cutting_edge_begin is Math.Vec3
        cutting_edge_end is Math.Vec3

        shovel is Terrain.Shovel:
            body: bucket.body
            top_edge: Math.Line.from_points(bucket.top_edge_begin, bucket.top_edge_end)
            cutting_edge: Math.Line.from_points(bucket.cutting_edge_begin, bucket.cutting_edge_end)

    swing_boom_connection.boom_1_boom_2_connection.snap_hinge.initial_angle: 0.0
    boom_stick_connection.boom_1_boom_2_connection.snap_hinge.initial_angle: 0.0
    stick_bucket_connection.boom_1_boom_2_connection.snap_hinge.initial_angle: 2.2

     # Disable internal collisions
    no_collision_group.systems: [boom_cylinder, stick_cylinder, boom_swing, boom, stick, bucket_cylinder, bucket]

    signal_interface is Physics.Signals.SignalInterface:
        swing_motor_velocity_input is Physics.Signals.Input: boom_swing_motor.target_angular_velocity_input
        boom_motor_velocity_input is Physics.Signals.Input: boom_cylinder.motor.target_linear_velocity_input
        stick_motor_velocity_input is Physics.Signals.Input: stick_cylinder.motor.target_linear_velocity_input
        bucket_motor_velocity_input is Physics.Signals.Input: bucket_cylinder.motor.target_linear_velocity_input
