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?
how to change joint position
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: how to change joint position
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.
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.
-
- Posts: 7
- Joined: Sun Dec 10, 2017 3:49 pm
Re: how to change joint position
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.
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.