# Constraint Balance Motion
isEnable = True
supportLeg = "Legs"
motion.wbEnableBalanceConstraint(isEnable, supportLeg)
# Com go to LLeg
supportLeg = "LLeg"
duration = 1.0
motion.wbGoToBalance(supportLeg, duration)
# RLeg is free
stateName = "Free"
supportLeg = "RLeg"
motion.wbFootState(stateName, supportLeg)
# RLeg is optimized
effectorName = "RLeg"
axisMask = 63
space = mot.FRAME_TORSO
# Motion of the RLeg
dx = 0.025
# translation axis X (meters)
dz = 0.02
# translation axis Z (meters)
dwy = 5.0*math.pi/180.0
# rotation axis Y (radian)
times = [1.0, 1.4, 2.1]
isAbsolute = False
targetList = [
[-0.7*dx, 0.0, 1.1*dz, 0.0, +dwy, 0.0],
[+2.2*dx, +dx, dz, 0.0, -dwy, 0.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0]]
motion.positionInterpolation(effectorName, space, targetList,
axisMask, times, isAbsolute)
# Example showing how to Enable Effector Control as an Optimization
isActive = False
motion.wbEnableEffectorOptimization(effectorName, isActive)
time.sleep(1.0)
# Deactivate Head tracking
isEnabled = False
motion.wbEnable(isEnabled)
# send robot to Pose Init
posture.goToPosture("StandInit", 0.5)
Yet, the high-school students complained that a function was missing.