add yapf style and apply yapf to format all Python files

This recreates pull request #2192
This commit is contained in:
Erwin Coumans
2019-04-27 07:31:15 -07:00
parent c591735042
commit ef9570c315
347 changed files with 70304 additions and 22752 deletions

View File

@@ -7,16 +7,24 @@ pr2_gripper = 2
pr2_cid = 1
CONTROLLER_ID = 0
POSITION=1
ORIENTATION=2
ANALOG=3
BUTTONS=6
POSITION = 1
ORIENTATION = 2
ANALOG = 3
BUTTONS = 6
gripper_max_joint = 0.550569
while True:
events = p.getVREvents()
for e in (events):
if e[CONTROLLER_ID] == 3: # To make sure we only get the value for one of the remotes
p.changeConstraint(pr2_cid, e[POSITION], e[ORIENTATION], maxForce=500)
p.setJointMotorControl2(pr2_gripper, 0, controlMode=p.POSITION_CONTROL,targetPosition=gripper_max_joint - e[ANALOG] * gripper_max_joint,force=1.0)
p.setJointMotorControl2(pr2_gripper, 2, controlMode=p.POSITION_CONTROL,targetPosition=gripper_max_joint - e[ANALOG] * gripper_max_joint,force=1.1)
events = p.getVREvents()
for e in (events):
if e[CONTROLLER_ID] == 3: # To make sure we only get the value for one of the remotes
p.changeConstraint(pr2_cid, e[POSITION], e[ORIENTATION], maxForce=500)
p.setJointMotorControl2(pr2_gripper,
0,
controlMode=p.POSITION_CONTROL,
targetPosition=gripper_max_joint - e[ANALOG] * gripper_max_joint,
force=1.0)
p.setJointMotorControl2(pr2_gripper,
2,
controlMode=p.POSITION_CONTROL,
targetPosition=gripper_max_joint - e[ANALOG] * gripper_max_joint,
force=1.1)