/install adaptive-cruise-control-vehicle-dynamics
Vehicle Dynamics Simulation
Basic Kinematic Model
For vehicle simulations, use discrete-time kinematic equations.
Speed Update:
new_speed = current_speed + acceleration * dt
new_speed = max(0, new_speed) # Speed cannot be negative
Position Update:
new_position = current_position + speed * dt
Distance Between Vehicles:
# When following another vehicle
relative_speed = ego_speed - lead_speed
new_distance = current_distance - relative_speed * dt
Safe Following Distance
The time headway model calculates safe following distance:
def safe_following_distance(speed, time_headway, min_distance):
"""
Calculate safe distance based on current speed.
Args:
speed: Current vehicle speed (m/s)
time_headway: Time gap to maintain (seconds)
min_distance: Minimum distance at standstill (meters)
"""
return speed * time_headway + min_distance
Time-to-Collision (TTC)
TTC estimates time until collision at current velocities:
def time_to_collision(distance, ego_speed, lead_speed):
"""
Calculate time to collision.
Returns None if not approaching (ego slower than lead).
"""
relative_speed = ego_speed - lead_speed
if relative_speed \x3C= 0:
return None # Not approaching
return distance / relative_speed
Acceleration Limits
Real vehicles have physical constraints:
def clamp_acceleration(accel, max_accel, max_decel):
"""Constrain acceleration to physical limits."""
return max(max_decel, min(accel, max_accel))
State Machine Pattern
Vehicle control often uses mode-based logic:
def determine_mode(lead_present, ttc, ttc_threshold):
"""
Determine operating mode based on conditions.
Returns one of: 'cruise', 'follow', 'emergency'
"""
if not lead_present:
return 'cruise'
if ttc is not None and ttc \x3C ttc_threshold:
return 'emergency'
return 'follow'
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install adaptive-cruise-control-vehicle-dynamics - After installation, invoke the skill by name or use
/adaptive-cruise-control-vehicle-dynamics - Provide required inputs per the skill's parameter spec and get structured output
What is vehicle-dynamics?
Use this skill when simulating vehicle motion, calculating safe following distances, time-to-collision, speed/position updates, or implementing vehicle state... It is an AI Agent Skill for Claude Code / OpenClaw, with 99 downloads so far.
How do I install vehicle-dynamics?
Run "/install adaptive-cruise-control-vehicle-dynamics" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is vehicle-dynamics free?
Yes, vehicle-dynamics is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does vehicle-dynamics support?
vehicle-dynamics is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created vehicle-dynamics?
It is built and maintained by wu-uk (@wu-uk); the current version is v0.1.0.