Code: Select all
y=os.date("%Y")
m=os.date("%m")
d=os.date("%d")
h=os.date("%H")
M=os.date("%M")
S=os.date("%S")
aa=y..'.'..m..'.'..d..' '..h..'--'..M..S
fp=io.open('.\\temp\\data'..aa..'.csv',"a")
fp:write('Time',',','x',',','y',',','oriente',',','m_state',',','collide_T',',','Latency',',','map',',','clearance','\n')
Code: Select all
fp:write(string.format('%.2f',simulationtime),',',string.format('%.2f',current_position[1]),',',string.format('%.2f',current_position[2]),',',string.format('%.2f',math.deg(current_orientation[3])),',',current_moving(m),',',collisionTimes,',',X[b][1],',',current_map(p),',',current_clearance(c),'\n')
but the time interval of recoding is inconsistent(it it randomly). At the "Simulation Setting" dialog, I've set dt=50.0ms(custom), Time step[s]0.05, and enabled the Real-time simulation, but it's not effective. I want the time interval of recording is consistent, Please help solve this problem, thanks you so much.