You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to get the acceleration of the vehicle at each time step. Since the input parameter for obtaining acceleration is the vehicle ID, I obtained the vehicle ID for each time step, but the following error was obtained . The follows are my codes :
I want to get the acceleration of the vehicle at each time step. Since the input parameter for obtaining acceleration is the vehicle ID, I obtained the vehicle ID for each time step, but the following error was obtained . The follows are my codes :
clc;
clear all;
import traci.constants
scenarioPath=['F:\software\SUMO配置文件\bin\quickstart\quickstart.sumocfg'];
system(['sumo-gui -c ' '"' scenarioPath '"' ' --remote-port 8813 --start&']);
traci.init
SIM_STEPS = [1 900];
beginTime = SIM_STEPS(1);
duration = SIM_STEPS(2);
endTime = SIM_STEPS(1) + SIM_STEPS(2) - 1;
for i = 1: duration
traci.simulation.step();
IDList{i} = traci.vehicle.getIDList();
accel{i}=traci.vehicle.getAcceleration(IDList);
end
traci.close()
I used the traci4matlab and the above are my codes , the ''duration'' is the "simulation duration time ",the error logs are :
error use uint8
Unable to convert from cell to uint8.
error traci.beginMessage (line 23)
traci.packInt32(length(objID)) uint8(objID)];
error traci.sendReadOneStringCmd (line 10)
traci.beginMessage(cmdID, varID, objID);
error traci.vehicle.getUniversal (line 21)
result = traci.sendReadOneStringCmd(constants.CMD_GET_VEHICLE_VARIABLE,varID,vehID);
error traci.vehicle.getAcceleration (line 12)
accel = traci.vehicle.getUniversal(constants.VAR_ACCELERATION, vehID);
error quickstart (line 19)
accel{i}=traci.vehicle.getAcceleration(IDList);
The text was updated successfully, but these errors were encountered: