Skip to content

Commit

Permalink
Adding new parameters and script to stop_simulation (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
MishkaMN committed Apr 5, 2024
1 parent 8fef003 commit fac1591
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ail_vru_uc1_scenario/cdasim_config/.env
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ VEHICLE_SELECTED_ROUTE=vru_uc1_north
# SCENARIO: South to North through (B)
SIMULATION_SCENARIO="VulnerableRoadUserCollision_ThreeTrucks_1"
VEHICLE_SPAWN_POINT="258.12,-125,0,0,0,90"
VEHICLE_ENGAGE_DELAY='105'
VEHICLE_ENGAGE_DELAY='80'
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ on_route_vehicle_collision_horizon_in_s: 10.0
# Minimum speed for moving obstacle
# Units: m/s
# Value type: Desired
min_obstacle_speed_in_ms: 0.5
min_obstacle_speed_in_ms: 0.25
# Minimum object avoidance planning time
# Units: s
# Value type: Desired
min_obj_avoidance_plan_time_in_s: 2.0
# Deceleration value used for yielding trajectories
# Units: m/s^2
# Value type: Desired
yield_max_deceleration_in_ms2: 9.0
yield_max_deceleration_in_ms2: 3.0
# Minimum safety gap with an Object/Obstacle
# Units: meters
# Value type: Desired
minimum_safety_gap_in_meters: 10.0
minimum_safety_gap_in_meters: 4.0
# Maximum speed value to consider the ego vehicle stopped
# Units: m/s
# Value type: Desired
max_stop_speed_in_ms: 1.0
max_stop_speed_in_ms: 0.25
# parameter to enable cooperative behavior
# Value type: Desired
enable_cooperative_behavior: false
Expand Down
10 changes: 10 additions & 0 deletions ail_vru_uc1_scenario/cdasim_config/stop_simulation
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
#!/bin/bash
# Script to stop simulation.
# Pulls all Kafka message data
# Pulls RTF data from MOSAIC in cdasim container
# Stops and removes all docker containers
# Prunes all Kafka related volumes
if ! [ -f /opt/carma-streets/scripts/collect_kafka_logs.py ] ; then
echo "Installing collect_kafka_logs.py into /opt/carma-streets/scripts/ ...."
wget -q https://raw.githubusercontent.com/usdot-fhwa-stol/carma-streets/release/lavida/collect_kafka_logs.py -P /opt/carma-streets/scripts
sudo chmod 777 /opt/carma-streets/scripts/collect_kafka_logs.py
fi
if ! [ -f /opt/carma-simulation/scripts/extract_rtf_data ] ; then
echo "Installing extract_rtf_data into /opt/carma-simulation/scripts/ ...."
wget -q https://raw.githubusercontent.com/usdot-fhwa-stol/carma-analytics-fotda/release/lavida/vru_use_case_scripts/extract_rtf_data -P /opt/carma-simulation/scripts
sudo chmod 777 /opt/carma-simulation/scripts/extract_rtf_data
fi
filename=carma_streets_kafka_"$(date +%F_%H-%M-%S)"
echo "Collecting CARMA Streets Kafka messages into ${filename}.zip"
python3 /opt/carma-streets/scripts/collect_kafka_logs.py --zip True "${filename}"
filename_rtf=cdasim_rtf_data_"$(date +%F_%H-%M-%S)"
echo "Collecting RTF data into ${filename_rtf}.csv"
docker logs carma-simulation 2>&1 | /opt/carma-simulation/scripts/extract_rtf_data > ${filename_rtf}.csv
echo "Stopping simulation ..."
carma stop all
# Kafka message volumes retain messages and consumer offsets from previous run
Expand Down

0 comments on commit fac1591

Please sign in to comment.