Saltar al contenido
Skillpedia
Agentes15 mil · #11083

write-leaderboard-agent

Qué hace

La skill crea un agente de conducción inicial para el Leaderboard de CARLA y revisa sus sensores. Está pensada para desarrolladores que escriben su propio agente de conducción autónoma para el simulador.

Cuándo usarla

  • ✓Cuando quieres escribir un nuevo agente de conducción para el Leaderboard de CARLA.
  • ✓Cuando necesitas elegir una configuración de sensores que encaje con los límites de un circuito.
  • ✓Cuando tu agente no carga y el nombre de la clase puede ser incorrecto.

Link de la skill

https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/leaderboard/write-leaderboard-agent/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/leaderboard/write-leaderboard-agent/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Escribe un agente de conducción con cámara y lidar para el circuito de sensores del Leaderboard, con un archivo inicial que funcione.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

El agente genera una clase base con funciones de configuración, de sensores y de paso, usa el constructor que corresponde a tu versión del Leaderboard y comprueba la configuración de sensores frente a los límites del circuito antes de cualquier prueba.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Write a Leaderboard agent

Paths. scripts/… and references/… below are relative to the directory holding this SKILL.md. Your working directory is the user's project, not that directory, so prefix them with its absolute path or the command is not found.

An agent is one Python file with one class. The Leaderboard imports it by path and instantiates it by a name derived from the file name:

module_name = os.path.basename(args.agent).split('.')[0]   # my_agent.py -> my_agent
# ... the evaluator then looks for the TitleCase, underscore-stripped class

so my_agent.py must contain class MyAgent. That is the first thing that goes wrong, and the error is a bare AttributeError.

Instructions

Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh) — confirms the LB version
- [ ] Step 2: Generate the skeleton for your track and version
- [ ] Step 3: Declare sensors inside the budget; validate offline
- [ ] Step 4: Implement run_step
- [ ] Step 5: Smoke-test on routes_devtest.xml

Step 2: Skeleton

source scripts/env.sh

python3 scripts/agent_tools.py scaffold --name MyAgent --track SENSORS --out ~/team_code
python3 scripts/agent_tools.py scaffold --name MyMapAgent --track MAP --out ~/team_code

The scaffold reads the detected leaderboard version and emits the correct constructor for it — this is the one hard API break between 1.0 and 2.x:

# 1.0 — the base class calls setup() from __init__
def __init__(self, path_to_conf_file): ...

# 2.0 / 2.1 — the evaluator constructs, then calls setup() itself
def __init__(self, carla_host, carla_port, debug=False): ...

A 1.0 agent run under a 2.x evaluator receives a host string where it expects a config path. If you override __init__ at all, match the version; if you do not override it, both work.

Step 3: Sensors

def sensors(self):
    return [
        {'type': 'sensor.camera.rgb', 'id': 'Center',
         'x': 0.7, 'y': 0.0, 'z': 1.60, 'roll': 0.0, 'pitch': 0.0, 'yaw': 0.0,
         'width': 800, 'height': 600, 'fov': 100},
        {'type': 'sensor.lidar.ray_cast', 'id': 'LIDAR',
         'x': 0.7, 'y': 0.0, 'z': 1.60, 'roll': 0.0, 'pitch': 0.0, 'yaw': 0.0},
        {'type': 'sensor.other.imu',  'id': 'IMU', 'x': 0.7, 'y': 0.0, 'z': 1.60,
         'roll': 0.0, 'pitch': 0.0, 'yaw': 0.0},
        {'type': 'sensor.other.gnss', 'id': 'GPS', 'x': 0.7, 'y': -0.4, 'z': 1.60},
        {'type': 'sensor.speedometer', 'id': 'Speed'},
    ]
python3 scripts/agent_tools.py validate --agent ~/team_code/my_agent.py --track SENSORS

validate runs the actual validate_sensor_configuration() from your checkout, so it enforces the real budget for your version and track rather than a copy of it. Budgets (2.0/2.1; qualifier tracks halve them, and match 1.0's):

Sensor SENSORS / MAP *_QUALIFIER and LB 1.0
sensor.camera.rgb 8 4
sensor.lidar.ray_cast 2 1
sensor.other.radar 4 2
sensor.other.gnss 1 1
sensor.other.imu 1 1
sensor.speedometer 1 1
sensor.opendrive_map 1 (MAP tracks only) 1

Three constraints beyond the counts:

  • Every id must be unique — duplicates are rejected outright.
  • Mount radius ≤ 3.0 m from the ego origin: sqrt(x²+y²+z²) > 3.0 is rejected.
  • sensor.opendrive_map on a SENSORS track is rejected, which is the entire difference between the SENSORS and MAP tracks.

You do not control sensor attributes except camera resolution/fov and the mount. agent_wrapper.py hard-codes the rest: lidar is always 64 channels, 85 m range, 10 Hz, 600k points/s with fixed dropoff; radar 1500 points, 100 m; GNSS and IMU noise are fixed. Setting range or channels in your sensor dict is silently ignored. That is deliberate — it is what makes submissions comparable.

Step 4: run_step

def run_step(self, input_data, timestamp):
    # input_data is {id: (frame, data)} for every sensor in sensors()
    frame, img = input_data['Center']          # numpy BGRA, (height, width, 4)
    _, gnss    = input_data['GPS']            # [lat, lon, alt]
    _, imu     = input_data['IMU']            # [ax, ay, az, gx, gy, gz, compass]
    _, speed   = input_data['Speed']          # {'speed': m/s}

    control = carla.VehicleControl()
    control.steer, control.throttle, control.brake = 0.0, 0.5, 0.0
    return control
  • Return a `carla.VehicleContro
Preguntas frecuentes

¿Por qué no carga mi agente?

El nombre del archivo debe coincidir con el de la clase: my_agent.py necesita una clase llamada MyAgent.

¿Las versiones del Leaderboard usan el mismo constructor?

No. Las versiones 1.0 y 2.x difieren, así que la skill genera el que corresponde a tu versión.

¿Cubre ROS?

Sí. Cubre las clases base de agentes para ROS 1 y ROS 2.

Detalles

Descripción original del autor

Writes an autonomous agent for the CARLA Leaderboard — an AutonomousAgent subclass with setup/sensors/run_step/destroy, a sensor suite inside the track's budget, and the right constructor signature for the leaderboard version (1.0 and 2.x differ). Generates a working skeleton, validates the sensor configuration against the real per-track limits offline, and covers the ROS1/ROS2 agent base classes. Use when the user asks to "write a leaderboard agent", "make my agent work with the leaderboard", "add sensors to my agent", "port my agent to 2.1", or hits SensorConfigurationInvalid.

repo: carla-simulator/carla

Popularidad

Estrellas en GitHub
15 mil
Posición en el ranking
#11083
Licencia
MIT
Actualizada
2/11/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas