[Feature]: Add AdvCP utilities for generating vehicle mesh and mesh-division assets

Abierto
#140 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@meaning-0f-life ya está trabajando en esto.

Desde el 25/7/2026.

  • #184 de @meaning-0f-life — abierto

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
20/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
embedded-iot

Línea de trabajo

Start by reading the AdvCP attack code and its asset-loading paths for car_mesh_path, car_mesh_divide_path, and the removal asset paths; the issue does not name specific source files or tests. Then determine how existing assets are consumed and what mesh formats and coordinate frames they require. Done means utilities generate or validate compatible assets for spoofing and removal, with a CLI and optional caching.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

AdvCP attack CoP enhancement
Problem or motivation

AdvCP integration in CAVISE currently depends on pre-generated 3D vehicle assets used by the attack pipeline to perform physically plausible spoofing and removal attacks.

At the moment, AdvCP attack configs expect assets such as:

car_mesh_path: ../../../core/attack/advcp/3d_models/car_mesh_0200.ply
car_mesh_divide_path: ../../../core/attack/advcp/3d_models/spoof/car_mesh_divide.pkl

# Optional adv-shape pretrained assets (used only when advshape: true).
# remove_adv_shape_perturb_path: ../../../core/attack/advcp/3d_models/remove/mesh_perturb.npy
# remove_adv_shape_divide_path: ../../../core/attack/advcp/3d_models/remove/mesh_divide.pkl

These files are critical for reproducing AdvCP-style attacks, but the repository does not currently provide a clear utility workflow for generating them from a CARLA vehicle model or another supported vehicle mesh source.

This creates several limitations:

  1. Experiments are tied to a small set of pre-generated vehicle assets.
  2. It is difficult to reproduce spoofing experiments with different CARLA vehicle types.
  3. Removal experiments that require mesh-based or adv-shape assets cannot be easily extended.
  4. Researchers cannot easily validate whether the generated .ply, .pkl, and optional .npy assets are compatible with the AdvCP pipeline.
  5. The asset-generation process is not transparent enough for reproducible experiments.

A similar question was raised in the original AdvCollaborativePerception repository regarding how car_0200.ply and mesh_divide.pkl were generated: https://github.com/zqzqz/AdvCollaborativePerception/issues/8

The same reproducibility problem applies to the CAVISE AdvCP integration, and it also affects removal-related assets, not only spoofing.

Proposed solution

Add utility scripts under the AdvCP module for generating and validating the 3D assets required by spoofing and removal attacks.

Suggested location:

opencda/core/attack/advcp/utils/

The utilities should support generation or validation of the following asset types:

.ply   vehicle mesh used by AdvCP ray-casting / physical attack simulation
.pkl   mesh-division metadata used by spoofing and removal pipelines
.npy   optional adversarial shape perturbation assets for removal when advshape=true

Suggested utility scripts:

generate_car_mesh.py
generate_mesh_divide.py
generate_remove_advshape_assets.py
validate_advcp_assets.py

Expected capabilities:

  1. Generate a .ply vehicle mesh compatible with car_mesh_path.
  2. Generate spoofing mesh-division metadata compatible with car_mesh_divide_path.
  3. Generate removal mesh-division metadata compatible with remove_adv_shape_divide_path.
  4. Optionally support generation, loading, or export of remove_adv_shape_perturb_path when advshape: true.
  5. Support runtime asset generation from a CARLA vehicle blueprint, so the simulation can derive the required mesh and mesh-division data on demand instead of requiring pre-generated .ply / .pkl files to be committed to the repository.
  6. Support an optional cache mode: generated .ply, .pkl, and .npy assets may be stored outside the source tree and reused across runs, but they should be treated as derived cache artifacts rather than mandatory repository files.
  7. Validate asset shape, coordinate frame, scale, file existence, and compatibility with the AdvCP attack code.
  8. Provide a CLI interface so the assets can be regenerated for different CARLA vehicle types or external mesh inputs.
  9. Document the expected input source: CARLA blueprint, CARLA mesh export, or external .obj / .ply / .fbx asset.
  10. Save outputs into the existing AdvCP asset layout when explicit file export is requested.

Example CLI for generating a vehicle mesh:

python -m opencda.core.attack.advcp.utils.generate_car_mesh \
  --vehicle-blueprint vehicle.tesla.model3 \
  --output opencda/core/attack/advcp/3d_models/car_mesh_0200.ply

Example CLI for generating spoofing mesh division:

python -m opencda.core.attack.advcp.utils.generate_mesh_divide \
  --mesh opencda/core/attack/advcp/3d_models/car_mesh_0200.ply \
  --mode spoof \
  --output opencda/core/attack/advcp/3d_models/spoof/car_mesh_divide.pkl

Example CLI for generating removal mesh division:

python -m opencda.core.attack.advcp.utils.generate_mesh_divide \
  --mesh opencda/core/attack/advcp/3d_models/car_mesh_0200.ply \
  --mode remove \
  --output opencda/core/attack/advcp/3d_models/remove/mesh_divide.pkl

Example CLI for validating generated assets:

python -m opencda.core.attack.advcp.utils.validate_advcp_assets \
  --car-mesh opencda/core/attack/advcp/3d_models/car_mesh_0200.ply \
  --spoof-divide opencda/core/attack/advcp/3d_models/spoof/car_mesh_divide.pkl \
  --remove-divide opencda/core/attack/advcp/3d_models/remove/mesh_divide.pkl \
  --remove-perturb opencda/core/attack/advcp/3d_models/remove/mesh_perturb.npy

The validation script should fail early with actionable error messages if an asset is missing, has an unexpected format, uses an incompatible coordinate frame, or cannot be consumed by the attack pipeline.

The preferred behavior should be runtime generation with optional caching. Large derived assets such as .ply, .pkl, and .npy files should not have to live in the repository unless they are intentionally included as small examples or test fixtures.

Area

Automotive cybersecurity

Alternatives considered

No response

Additional context

No response

Lenguaje dominante
Python
Estrellas
11
Forks
11
Merge medio
1 d 16 h
PR fusionados (30 d)
12

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de CAVISE/OpenCDA

Todos los issues de CAVISE/OpenCDA

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.