Page 1 of 1

how to change joint position

Posted: Tue Dec 12, 2017 8:07 am
by hotgarlic
There are two ways to create(or set) joint between links. Declare it when create multibody and create constrain.
As my understanding of the guide manual.

But it is strange. I can not change the position of revolute joint in createMultiBody command. Is there some API to change the position?
Also, createConstrain has only 3 kind constrain:point2point, fix, prismatic. Why revolute(hinge) is absent?

Re: how to change joint position

Posted: Wed Dec 13, 2017 2:17 am
by Erwin Coumans
The main way to create a robot is creating a URDF file. Aside from that, you can use createMultiBody.
get the Bullet source code, and see Bullet/examples/pybullet/examples/createMultiBodyLinks.py for an example (this is in the Pybullet Quickstart Guide)

The 'createConstraint' is only to attach multiple multibodies together, not to create regular joints.

Re: how to change joint position

Posted: Wed Dec 13, 2017 4:03 am
by hotgarlic
Thanks!

I have read the example code by code. But I can not find out the code which define the location of joint.
The location of joint is always on the center of mass despite I change some arguments.

In the createMultiBodyLinks.py, the only codes about joint I could find as follows.

26 jointTypes=[p.JOINT_REVOLUTE] # type definition
27 axis=[[0,0,1]] # roll about z axis of the link
41 p.setJointMotorControl2(sphereUid,joint,p.VELOCITY_CONTROL,targetVelocity=1,force=10) # no relative to joint location.