Junhyeok Lee

Applies to v0.1.0.

Vehicle control

How each transport moves the car, and what the numbers you send actually mean.

Moving the car

  • Python API — call set_control with a normalised throttle and steering, then tick to advance the simulation.
  • ROS 1 / ROS 2 — publish a geometry_msgs/Twist on /cmd_vel, repeatedly, with a speed in m/s and a yaw rate in rad/s.

The two take their commands in different units and opposite signs. Positive steering is a right turn on the Python API; positive angular.zis a left turn on ROS, per REP-103. The simulator's axes make a positive yaw a right turn, so the bridge negates between them.

The speed ceiling

Both transports end at the same place: a normalised throttle multiplied by the car's top speed. That value is Maximum Speed, in the Vehicle Setting panel. Open it from the menu bar with Setting → Vehicle. Whatever it is set to is the fastest the car can go; the slider itself runs from 0.05 to 2.0 m/s.

With Maximum Speed at 0.5 m/s:

linear.x sent    throttle    actual speed
  0.30            0.60        0.30 m/s     as asked
  0.50            1.00        0.50 m/s     at the ceiling
  4.00            1.00        0.50 m/s     clipped
  7.00            1.00        0.50 m/s     clipped

Saturation is silent.No error, no warning. The message arrived and was applied. A run labelled “4 m/s” that was driven at 0.5 m/s is internally consistent, and nothing in the data looks wrong. Check the limit before you command, not after.

Raising it is a vehicle-tuning decision, not a networking one. Slider changes apply to the current session only; a new default has to go in the vehicle prefab and the scene instance, or the two disagree.

Read the limits, never hard-code them

Top speed, steering lock and wheelbase are properties of the vehicle and change from the Vehicle Tuning panel at runtime, so a client holding a stale copy commands the wrong thing without knowing. Both transports publish the same block, read straight off the component:

{"wheelbase_m": 0.1657, "track_width_m": 0.11, "wheel_radius_m": 0.025,
 "max_steer_deg": 26.0, "max_steer_rate_deg_s": 80.0, "max_speed_ms": 0.5,
 "speed_time_constant_s": 0.25, "actuator_latency_s": 0.08}
  • Python API — from describe.
  • ROS — from /ego/vehicle_info, a std_msgs/String of JSON at 1 Hz.