Closed gaetjen closed 8 years ago
Parameters in form of signals, can be set by remote Api or will have default value for proper functioning -- initialize magic numbers and state information self.targetReached = simGetIntegerSignal('_targetReached') or 1 -- 0 for false and 1 for true self.gradientSpeed = simGetFloatSignal('_gradientSpeed') or 0.3 self.exploreSpeed = simGetFloatSignal('_exploreSpeed') or 2.0 self.targetEpsilon = simGetFloatSignal('_targetEpsilon') or 0.05 self.drunk = simGetIntegerSignal('_drunk') or 1 -- 0 for false and 1 for true
local lMapRes = simGetFloatSignal('_LM_SizeOfContainer')/simGetFloatSignal('_LM_SizeOfField')
myLogFile:write("GradientMap:,",mapName,"\n")
myLogFile:write("GradientMap Scale:,",simGetFloatSignal('_xScale'),"*",simGetFloatSignal('_yScale'),"\n")
myLogFile:write("LMap TotalSize:,",simGetFloatSignal('_LM_SizeOfContainer'),"\n")
myLogFile:write("LMap FieldSize:,",simGetFloatSignal('_LM_SizeOfField'),"\n")
myLogFile:write("LMap Resolution:,",lMapRes,"*",lMapRes,"\n")
myLogFile:write("Gradient Speed:,",simGetFloatSignal('_gradientSpeed') or 0.3,"\n") --,self.gradientSpeed
myLogFile:write("Explore Speed:,",simGetFloatSignal('_exploreSpeed') or 2.0,"\n") --self.exploreSpeed
myLogFile:write("Target Epsilon:,",simGetFloatSignal('_targetEpsilon') or 0.05,"\n") --self.targetEpsilon
myLogFile:write("Width Factor:,",simGetFloatSignal('_widthFactor') or 30,"\n") --self.widthFactor
myLogFile:write("Step Factor:,",simGetFloatSignal('_stepFactor') or 0.5,"\n") --self.stepFactor
myLogFile:write("CP EpsilonRatio:,",simGetFloatSignal('_checkpointEpsilonRatio') or 0.995,"\n") --self.checkpointEpsilonRatio
myLogFile:write("\n\n")
simGetStringSignal("_fileName") simGetFloatSignal('_xScale') simGetFloatSignal('_yScale')
simGetFloatSignal('_LM_SizeOfContainer') simGetFloatSignal('_LM_SizeOfField')
simGetFloatSignal('_gradientSpeed') simGetFloatSignal('_exploreSpeed') simGetFloatSignal('_targetEpsilon') simGetFloatSignal('_widthFactor') simGetFloatSignal('_stepFactor') simGetFloatSignal('_checkpointEpsilonRatio')
@lmaeurer we cannot set signals via the remote api before the simulation starts, because signals are cleared at simulation start. After simulation start is also inconvenient, because we need the values for initialization. Right now our idea is to write the relevant data into a file and then read the file from the vrep scripts. Do you know a better way?
I suppose you have had a look at the different simulation stages of VREP? My idea would have been to set the signals in the startup stage, before the simulation ist actually running. There should be a possibility to keep VREP in the different stages via the external API
Otherwise a parameter file should be fine. It might be necessary anyways when the simulation gets more complex
Gesendet von unterwegs.
gradientSpeed, drunk, targetEpsilon etc. should be settable with signals.