Commit 7b759f6b authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

[cwc] minor changes in cwc helper

parent 412788bb
......@@ -28,7 +28,7 @@ class Player (object):
self.larmId : {'file': "hyq/"+self.larmId+"_com.ineq", 'effector' : self.lHand} }
def act(self,i, numOptim = 0, use_window = 1, friction = 0.5, optim_effectors = True, time_scale = 1, verbose = True, draw = False, trackedEffectors = []):
def act(self,i, numOptim = 0, use_window = 0, friction = 0.5, optim_effectors = True, time_scale = 1., verbose = True, draw = False, trackedEffectors = []):
return step(self.fullBody, self.configs, i, numOptim, self.pp, self.limbsCOMConstraints, friction, optim_effectors = optim_effectors, time_scale = time_scale, useCOMConstraints = True, use_window = use_window,
verbose = verbose, draw = draw, trackedEffectors = trackedEffectors,use_velocity=self.use_velocity, pathId = self.pathId)
......
......@@ -126,20 +126,24 @@ def __getTimes(fullBody, configs, i, time_scale):
def __getTimes(fullBody, configs, i, time_scale,use_window=0):
t = fullBody.getTimeAtState(i+1) - fullBody.getTimeAtState(i)
dt = 0.01
dt = 0.02
print "t = ",t
t = time_scale*t
print "after scale, t = ",t
trunk_distance = np.linalg.norm(np.array(configs[i+1][0:3]) - np.array(configs[i][0:3]))
distance = max(fullBody.getEffectorDistance(i,i+1), trunk_distance)
# TODO : si t = 0, hardcoded ...
"""
if t <= dt*6.:
print "WARNING : in getTime, t=0"
t = dt*6.
use_window = 2
times = [dt*2. , 0] #FIXME : hardcoded value depend on interpolation step choosen (not available here)
"""
times = [dt*5. , 0] #FIXME : hardcoded value depend on interpolation step choosen (not available here)
"""
if t > dt*14.:
times = [dt*4. , 0]
"""
times[1] = t - 2*times[0]
times[1] = float((int)(math.floor(times[1]*100.))) / 100.
print "times : ",times
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment