Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Joint axes are incorrect. #6

@rohit-kumar-j

Description

@rohit-kumar-j

Hi! Thank you for this Addin!
It saves a lot of time, as before we had to export each mesh file in a separate format(via fusion2urdf) in-order for Pybullet to accept the mesh file format. This takes care of it instantaneously.

Although I ran into a joint axes mismatch (below). I think that you can use the mesh exporter that you have here, and fusion2urdf's original code for joint axes and urdf creation and it would be perfect

I have also provided the video of how it should actually look like (which was made with fusion2urdf)

Output: (Please excuse the music. This is my first time using screenrecord application )

Fusion to Pybullet Video:

simplescreenrecorder-2021-02-13_00.25.49.mp4

Fusion to URDF Video:

simplescreenrecorder-2021-02-13_00.45.38.mp4

My modified hello_bullet.py code, video output:

#!/usr/bin/env python3
import pybullet as p
import time
import pybullet_data
physicsClient = p.connect(p.GUI)#or p.DIRECT for non-graphical version
p.setAdditionalSearchPath(pybullet_data.getDataPath()) #optionally
p.setGravity(0,0,0)
# planeId = p.loadURDF("plane.urdf")
cubeStartPos = [0,0,0]
cubeStartOrientation = p.getQuaternionFromEuler([0,0,0])
robotId = p.loadURDF("V14_URDF.urdf",cubeStartPos, cubeStartOrientation, 
                   # useMaximalCoordinates=1, ## New feature in Pybullet
                   useFixedBase=True,
                   flags=p.URDF_USE_INERTIA_FROM_FILE)
val = 0 

for i in range (10000):
    p.stepSimulation()
    time.sleep(1./240.)
    # for j in range(p.getNumJoints(robotId)):
    	# p.setJointMotorControl2(robotId,j,controlMode=p.POSITION_CONTROL,targetPosition=val)
    	# val = val +0.001
    p.setJointMotorControl2(robotId,2,controlMode=p.POSITION_CONTROL,targetPosition=val)
    val = val +0.001
    p.setJointMotorControl2(robotId,3,controlMode=p.POSITION_CONTROL,targetPosition=val)
    val = val +0.001

cubePos, cubeOrn = p.getBasePositionAndOrientation(robotId)
print(cubePos,cubeOrn)
p.disconnect()

Warm Regards,
Rohit Kumar J

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions