Discover Learn Reference Get OpenPLXSearch Contact

Vehicles/DumpTruck/Interfaces/SixWheels.openplx

SixWheels

trait SixWheels:
    .doc: """
    Trait for adding wheels to a 6 wheel vehicle.
    """

    left_front_wheel is Vehicles.Wheels.Base
    right_front_wheel is Vehicles.Wheels.Base
    left_rear_wheel_1 is Vehicles.Wheels.Base
    right_rear_wheel_1 is Vehicles.Wheels.Base
    left_rear_wheel_2 is Vehicles.Wheels.Base
    right_rear_wheel_2 is Vehicles.Wheels.Base

    front_wheel_axle is MachineModeling.Components.Primitive.Base with DumpTruck.Interfaces.WheelAxle.WheelConnectors, Vehicles.DumpTruck.Interfaces.Chassis.AFrame
    rear_wheel_axle_1 is MachineModeling.Components.Primitive.Base with DumpTruck.Interfaces.WheelAxle.WheelConnectors, Vehicles.DumpTruck.Interfaces.Chassis.AFrame
    rear_wheel_axle_2 is MachineModeling.Components.Primitive.Base with DumpTruck.Interfaces.WheelAxle.WheelConnectors, Vehicles.DumpTruck.Interfaces.Chassis.AFrame

    front_axle_connection.left_axle_connector: front_wheel_axle.left_wheel_connector
    front_axle_connection.right_axle_connector: front_wheel_axle.right_wheel_connector
    rear_axle_connection.left_axle_connector_1: rear_wheel_axle_1.left_wheel_connector
    rear_axle_connection.right_axle_connector_1: rear_wheel_axle_1.right_wheel_connector
    rear_axle_connection.left_axle_connector_2: rear_wheel_axle_2.left_wheel_connector
    rear_axle_connection.right_axle_connector_2: rear_wheel_axle_2.right_wheel_connector

    front_axle_connection.left_wheel_connection is Physics3D.Interactions.Hinge:
        connectors: [front_axle_connection.left_axle_connector, left_front_wheel.connector]
    front_axle_connection.right_wheel_connection is Physics3D.Interactions.Hinge:
        connectors: [front_axle_connection.right_axle_connector, right_front_wheel.connector]
    rear_axle_connection.left_wheel_connection_1 is Physics3D.Interactions.Hinge:
        connectors: [rear_axle_connection.left_axle_connector_1, left_rear_wheel_1.connector]
    rear_axle_connection.right_wheel_connection_1 is Physics3D.Interactions.Hinge:
        connectors: [rear_axle_connection.right_axle_connector_1, right_rear_wheel_1.connector]
    rear_axle_connection.left_wheel_connection_2 is Physics3D.Interactions.Hinge:
        connectors: [rear_axle_connection.left_axle_connector_2, left_rear_wheel_2.connector]
    rear_axle_connection.right_wheel_connection_2 is Physics3D.Interactions.Hinge:
        connectors: [rear_axle_connection.right_axle_connector_2, right_rear_wheel_2.connector]

    axle_collision_group is Simulation.CollisionGroup:
        bodies: [front_wheel_axle.body, rear_wheel_axle_1.body, rear_wheel_axle_2.body]

    wheel_collision_group is Simulation.CollisionGroup:
        systems: [
            left_front_wheel,
            right_front_wheel,
            left_rear_wheel_1,
            right_rear_wheel_1,
            left_rear_wheel_2,
            right_rear_wheel_2
        ]

    disable_axle_wheel_collisions is Simulation.DisableCollisionPair:
        group1: axle_collision_group
        group2: wheel_collision_group

OpenPLX is a work in progress. This draft version will evolve with user feedback and experience. We welcome your input and collaboration.
X