Hi Have you fixed it? I also have the same problem. There is no
import carla
import random
import time
def main():
client = carla.Client('127.0.0.1', 2000)
client.set_timeout(2.0)
world = client.get_world()
actors = world.get_actors()
print([actor.type_id for actor in actors])
blueprint_library = world.get_blueprint_library()
vehicle_bp = blueprint_library.filter('vehicle.*')[0]
spawn_points = world.get_map().get_spawn_points()
# Spawn vehicle
vehicle = None
for spawn_point in spawn_points:
vehicle = world.try_spawn_actor(vehicle_bp, spawn_point)
if vehicle is not None:
print(f"Spawned vehicle at {spawn_point}")
break
if vehicle is None:
print("Failed to spawn vehicle at any spawn point.")
return
front_left_wheel = carla.WheelPhysicsControl(tire_friction=2.0, damping_rate=1.5, max_steer_angle=70.0, long_stiff_value=1000)
front_right_wheel = carla.WheelPhysicsControl(tire_friction=2.0, damping_rate=1.5, max_steer_angle=70.0, long_stiff_value=1000)
rear_left_wheel = carla.WheelPhysicsControl(tire_friction=3.0, damping_rate=1.5, max_steer_angle=0.0, long_stiff_value=1000)
rear_right_wheel = carla.WheelPhysicsControl(tire_friction=3.0, damping_rate=1.5, max_steer_angle=0.0, long_stiff_value=1000)
wheels = [front_left_wheel, front_right_wheel, rear_left_wheel, rear_right_wheel]
physics_control = vehicle.get_physics_control()
physics_control.torque_curve = [carla.Vector2D(x=0, y=400), carla.Vector2D(x=1300, y=600)]
physics_control.max_rpm = 10000
physics_control.moi = 1.0
physics_control.damping_rate_full_throttle = 0.0
physics_control.use_gear_autobox = True
physics_control.gear_switch_time = 0.5
physics_control.clutch_strength = 10
physics_control.mass = 10000
physics_control.drag_coefficient = 0.25
physics_control.steering_curve = [carla.Vector2D(x=0, y=1), carla.Vector2D(x=100, y=1), carla.Vector2D(x=300, y=1)]
physics_control.use_sweep_wheel_collision = True
physics_control.wheels = wheels
vehicle.apply_physics_control(physics_control)
time.sleep(1.0)
if hasattr(vehicle, "get_telemetry_data"):
telemetry = vehicle.get_telemetry_data()
print("Engine RPM:", telemetry.engine_rotation_speed)
for i, wheel in enumerate(telemetry.wheels):
print(f"Wheel {i}:")
print(f" Tire Force: {wheel.tire_force}")
print(f" Long Slip: {wheel.longitudinal_slip}")
print(f" Lat Slip: {wheel.lateral_slip}")
print(f" Steer Angle: {wheel.steer_angle}")
print(f" Rotation Speed: {wheel.rotation_speed}")
else:
print("there is no telemetry data available for this vehicle.")
if __name__ == '__main__':
main()