本文整理汇总了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)