本文整理匯總了Python中pybullet.TORQUE_CONTROL屬性的典型用法代碼示例。如果您正苦於以下問題:Python pybullet.TORQUE_CONTROL屬性的具體用法?Python pybullet.TORQUE_CONTROL怎麽用?Python pybullet.TORQUE_CONTROL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類pybullet
的用法示例。
在下文中一共展示了pybullet.TORQUE_CONTROL屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: set_torque
# 需要導入模塊: import pybullet [as 別名]
# 或者: from pybullet import TORQUE_CONTROL [as 別名]
def set_torque(self, torque):
self._p.setJointMotorControl2(bodyIndex=self.bodies[self.bodyIndex], jointIndex=self.jointIndex, controlMode=pybullet.TORQUE_CONTROL, force=torque) #, positionGain=0.1, velocityGain=0.1)
示例2: control_joint_torque
# 需要導入模塊: import pybullet [as 別名]
# 或者: from pybullet import TORQUE_CONTROL [as 別名]
def control_joint_torque(body, joint, torque):
p.setJointMotorControl2(
bodyIndex=body,
jointIndex=joint,
controlMode=p.TORQUE_CONTROL,
force=torque)
示例3: gripper
# 需要導入模塊: import pybullet [as 別名]
# 或者: from pybullet import TORQUE_CONTROL [as 別名]
def gripper(self, cmd, mode=pb.POSITION_CONTROL):
'''
Gripper commands need to be mirrored to simulate behavior of the actual
UR5. Converts one command input to 6 joint positions, used for the
robotiq gripper. This is a rough simulation of the way the robotiq
gripper works in practice, in the absence of a plugin like the one we
use in Gazebo.
Parameters:
-----------
cmd: 1x1 array of floating point position commands in [-0.8, 0]
mode: PyBullet control mode
'''
cmd = cmd[0]
# This is actually only a 1-DOF gripper
if cmd < -0.1:
cmd_array = [-cmd + 0.1, -cmd + 0.1, cmd + 0.15,
-cmd + 0.1, -cmd + 0.1, cmd + 0.15]
else:
cmd_array = [-cmd , -cmd, cmd, -cmd, -cmd, cmd]
forces = [25., 25., 25., 25., 25., 25.]
gains = [0.1, 0.1, 0.15, 0.1, 0.1, 0.15]
#if abs(cmd) < -0.01:
# mode = pb.TORQUE_CONTROL
# forces = [0.] * len(cmd_array)
#else:
#gripper_indices = [left_knuckle, left_inner_knuckle,
# left_fingertip, right_knuckle, right_inner_knuckle,
# right_fingertip]
pb.setJointMotorControlArray(self.handle, self.gripper_indices, mode,
cmd_array,
forces=forces,
positionGains=gains)
示例4: set_torque
# 需要導入模塊: import pybullet [as 別名]
# 或者: from pybullet import TORQUE_CONTROL [as 別名]
def set_torque(self, torque):
p.setJointMotorControl2(bodyIndex=self.bodies[self.bodyIndex], jointIndex=self.jointIndex, controlMode=p.TORQUE_CONTROL, force=torque) #, positionGain=0.1, velocityGain=0.1)
示例5: _SetMotorTorqueById
# 需要導入模塊: import pybullet [as 別名]
# 或者: from pybullet import TORQUE_CONTROL [as 別名]
def _SetMotorTorqueById(self, motor_id, torque):
p.setJointMotorControl2(bodyIndex=self.minitaur,
jointIndex=motor_id,
controlMode=p.TORQUE_CONTROL,
force=torque)
示例6: set_torque
# 需要導入模塊: import pybullet [as 別名]
# 或者: from pybullet import TORQUE_CONTROL [as 別名]
def set_torque(self, torque):
p.setJointMotorControl2(bodyIndex=self.bodies[self.bodyIndex], jointIndex=self.jointIndex, controlMode=p.TORQUE_CONTROL, force=torque) #, positionGain=0.1, velocityGain=0.1)
示例7: set_torque
# 需要導入模塊: import pybullet [as 別名]
# 或者: from pybullet import TORQUE_CONTROL [as 別名]
def set_torque(self, torque):
p.setJointMotorControl2(self.bodies[self.bodyIndex],self.jointIndex,p.TORQUE_CONTROL, force=torque)