more formatting.
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
import sys
|
|
||||||
sys.path.append('/Users/bingjeff/Documents/projects/walkman/bullet3/bin/')
|
|
||||||
import pybullet as p
|
import pybullet as p
|
||||||
|
|
||||||
|
|
||||||
@@ -14,12 +12,9 @@ def setJointPosition(robot, position, kp=1.0, kv=0.3):
|
|||||||
num_joints = p.getNumJoints(robot)
|
num_joints = p.getNumJoints(robot)
|
||||||
zero_vec = [0.0] * num_joints
|
zero_vec = [0.0] * num_joints
|
||||||
if len(position) == num_joints:
|
if len(position) == num_joints:
|
||||||
p.setJointMotorControlArray(robot, range(num_joints),
|
p.setJointMotorControlArray(robot, range(num_joints), p.POSITION_CONTROL,
|
||||||
p.POSITION_CONTROL,
|
targetPositions=position, targetVelocities=zero_vec,
|
||||||
targetPositions=position,
|
positionGains=[kp] * num_joints, velocityGains=[kv] * num_joints)
|
||||||
targetVelocities=zero_vec,
|
|
||||||
positionGains=[kp] * num_joints,
|
|
||||||
velocityGains=[kv] * num_joints)
|
|
||||||
else:
|
else:
|
||||||
print("Not setting torque. "
|
print("Not setting torque. "
|
||||||
"Expected torque vector of "
|
"Expected torque vector of "
|
||||||
|
|||||||
@@ -7411,12 +7411,12 @@ static PyMethodDef SpamMethods[] = {
|
|||||||
"Get the state (position, velocity etc) for multiple joints on a body."},
|
"Get the state (position, velocity etc) for multiple joints on a body."},
|
||||||
|
|
||||||
{"getLinkState", (PyCFunction)pybullet_getLinkState, METH_VARARGS | METH_KEYWORDS,
|
{"getLinkState", (PyCFunction)pybullet_getLinkState, METH_VARARGS | METH_KEYWORDS,
|
||||||
"position_linkcom_world, world_rotation_linkcom, "
|
"position_linkcom_world, world_rotation_linkcom,\n"
|
||||||
"position_linkcom_frame, frame_rotation_linkcom, "
|
"position_linkcom_frame, frame_rotation_linkcom,\n"
|
||||||
"position_frame_world, world_rotation_frame, "
|
"position_frame_world, world_rotation_frame,\n"
|
||||||
"linearVelocity_linkcom_world, angularVelocity_linkcom_world = "
|
"linearVelocity_linkcom_world, angularVelocity_linkcom_world\n"
|
||||||
"getLinkState(objectUniqueId, linkIndex, computeLinkVelocity=0, "
|
" = getLinkState(objectUniqueId, linkIndex, computeLinkVelocity=0,\n"
|
||||||
"computeForwardKinematics=0, physicsClientId=0)\n"
|
" computeForwardKinematics=0, physicsClientId=0)\n"
|
||||||
"Provides extra information such as the Cartesian world coordinates"
|
"Provides extra information such as the Cartesian world coordinates"
|
||||||
" center of mass (COM) of the link, relative to the world reference"
|
" center of mass (COM) of the link, relative to the world reference"
|
||||||
" frame."},
|
" frame."},
|
||||||
|
|||||||
Reference in New Issue
Block a user