Closed pierre-trott closed 2 years ago
Hello Pierre,
This is correct. Once a variable (scalar, vector, car, circuit) has been loaded with a name, you cannot override it. New documentation is available. Two things are possibly happening:
"run/variable"
also are in place and need to be erased before the new simulation. Call fastest_lap.clear_tables_by_prefix("run/")
after you finish downloading your variablesThe delete_vehicle
function is there in the library, but I have forgot to put a python binding for it. I will deliver it in the next release. I give you three options.
First option, in the mean time you can add to fastest_lap.py
def delete_vehicle(vehicle_name):
vehicle_name = c.c_char_p((vehicle_name).encode('utf-8'))
c_lib.delete_vehicle(vehicle_name);
return;
Second option, change the name of the car at every loop iteration (you will never run out of memory, I think...)
Third option, just create one car, and modify the parameters you are interested using
fastest_lap.set_scalar_parameter(vehicle_name,"vehicle/chassis/aerodynamics/cd", new_value)
Perfect, thank you!
Hi,
I'm trying to run the simulation multiple times and changing the vehicle model parameters between each iteration.
The first iteration works but stops after with an generic Windows Error. Could it be that it doesn't like that I am loading a vehicle that is already loaded? Is there a way to unload_vehicle before load_vehicle again on the same xml? If not, do I have to rename the car model xml to something different every iteration.
Thanks