コード例 #1
0
ファイル: test_collision.py プロジェクト: Duckkkky/smarts
def _joust(wkc: AckermannChassis, bkc: AckermannChassis, steps, throttle=1):
    collisions = ([], [])
    for _ in range(steps):
        wkc.control(throttle)
        bkc.control(throttle)
        bkc._client.stepSimulation()
        collisions[0].extend(wkc.contact_points)
        collisions[1].extend(bkc.contact_points)
    return collisions
コード例 #2
0
def step_with_vehicle_commands(
    bv: AckermannChassis, steps, throttle=0, brake=0, steering=0
):
    collisions = []
    for _ in range(steps):
        bv.control(throttle, brake, steering)
        bv._client.stepSimulation()
        collisions.extend(bv.contact_points)
    return collisions