diff --git a/data/differential/diff_arm.stl b/data/differential/diff_arm.stl new file mode 100644 index 000000000..8d33d772f Binary files /dev/null and b/data/differential/diff_arm.stl differ diff --git a/data/differential/diff_carrier.stl b/data/differential/diff_carrier.stl new file mode 100644 index 000000000..2b9cd9cf6 Binary files /dev/null and b/data/differential/diff_carrier.stl differ diff --git a/data/differential/diff_carrier_cover.stl b/data/differential/diff_carrier_cover.stl new file mode 100644 index 000000000..8afd68086 Binary files /dev/null and b/data/differential/diff_carrier_cover.stl differ diff --git a/data/differential/diff_leftshaft.stl b/data/differential/diff_leftshaft.stl new file mode 100644 index 000000000..f44b120ef Binary files /dev/null and b/data/differential/diff_leftshaft.stl differ diff --git a/data/differential/diff_motor_cover.stl b/data/differential/diff_motor_cover.stl new file mode 100644 index 000000000..a664860b3 Binary files /dev/null and b/data/differential/diff_motor_cover.stl differ diff --git a/data/differential/diff_pinion.stl b/data/differential/diff_pinion.stl new file mode 100644 index 000000000..7e9638779 Binary files /dev/null and b/data/differential/diff_pinion.stl differ diff --git a/data/differential/diff_rightshaft.stl b/data/differential/diff_rightshaft.stl new file mode 100644 index 000000000..db4024912 Binary files /dev/null and b/data/differential/diff_rightshaft.stl differ diff --git a/data/differential/diff_ring.stl b/data/differential/diff_ring.stl new file mode 100644 index 000000000..7ca2a6c62 Binary files /dev/null and b/data/differential/diff_ring.stl differ diff --git a/data/differential/diff_ring.urdf b/data/differential/diff_ring.urdf new file mode 100644 index 000000000..3e20aebd7 --- /dev/null +++ b/data/differential/diff_ring.urdf @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data/differential/diff_side.stl b/data/differential/diff_side.stl new file mode 100644 index 000000000..f8ed10e8a Binary files /dev/null and b/data/differential/diff_side.stl differ diff --git a/data/differential/diff_spider.stl b/data/differential/diff_spider.stl new file mode 100644 index 000000000..1c152401f Binary files /dev/null and b/data/differential/diff_spider.stl differ diff --git a/data/differential/diff_spider_shaft.stl b/data/differential/diff_spider_shaft.stl new file mode 100644 index 000000000..12b2213f1 Binary files /dev/null and b/data/differential/diff_spider_shaft.stl differ diff --git a/data/differential/diff_stand.stl b/data/differential/diff_stand.stl new file mode 100644 index 000000000..168bdb1dc Binary files /dev/null and b/data/differential/diff_stand.stl differ diff --git a/data/differential/modelorigin.txt b/data/differential/modelorigin.txt new file mode 100644 index 000000000..af250e7d6 --- /dev/null +++ b/data/differential/modelorigin.txt @@ -0,0 +1,2 @@ +stl files were copied from http://www.otvinta.com/download09.html +URDF file was manually created, along with mimicJointConstraint.py \ No newline at end of file diff --git a/examples/Importers/ImportURDFDemo/UrdfParser.cpp b/examples/Importers/ImportURDFDemo/UrdfParser.cpp index de8a578fe..9e9594e81 100644 --- a/examples/Importers/ImportURDFDemo/UrdfParser.cpp +++ b/examples/Importers/ImportURDFDemo/UrdfParser.cpp @@ -323,8 +323,10 @@ bool UrdfParser::parseInertia(UrdfInertia& inertia, TiXmlElement* config, ErrorL bool UrdfParser::parseGeometry(UrdfGeometry& geom, TiXmlElement* g, ErrorLogger* logger) { - btAssert(g); - +// btAssert(g); + if (g==0) + return false; + TiXmlElement *shape = g->FirstChildElement(); if (!shape) { diff --git a/examples/pybullet/examples/mimicJointConstraint.py b/examples/pybullet/examples/mimicJointConstraint.py index af615e02f..60a0625d9 100644 --- a/examples/pybullet/examples/mimicJointConstraint.py +++ b/examples/pybullet/examples/mimicJointConstraint.py @@ -4,13 +4,22 @@ import pybullet as p import time p.connect(p.GUI) -wheelA = p.loadURDF("wheel.urdf",[0,0,0]) -wheelB = p.loadURDF("wheel.urdf",[0,0,1]) -p.setJointMotorControl2(wheelA,0,p.VELOCITY_CONTROL,targetVelocity=0,force=0) -p.setJointMotorControl2(wheelB,0,p.VELOCITY_CONTROL,targetVelocity=1,force=1) +p.loadURDF("plane.urdf",0,0,-2) +wheelA = p.loadURDF("differential/diff_ring.urdf",[0,0,0]) +for i in range(p.getNumJoints(wheelA)): + print(p.getJointInfo(wheelA,i)) + p.setJointMotorControl2(wheelA,i,p.VELOCITY_CONTROL,targetVelocity=0,force=0) + + +c = p.createConstraint(wheelA,1,wheelA,3,jointType=p.JOINT_GEAR,jointAxis =[0,1,0],parentFramePosition=[0,0,0],childFramePosition=[0,0,0]) +p.changeConstraint(c,gearRatio=1, maxForce=10000) + +c = p.createConstraint(wheelA,2,wheelA,4,jointType=p.JOINT_GEAR,jointAxis =[0,1,0],parentFramePosition=[0,0,0],childFramePosition=[0,0,0]) +p.changeConstraint(c,gearRatio=-1, maxForce=10000) + +c = p.createConstraint(wheelA,1,wheelA,4,jointType=p.JOINT_GEAR,jointAxis =[0,1,0],parentFramePosition=[0,0,0],childFramePosition=[0,0,0]) +p.changeConstraint(c,gearRatio=-1, maxForce=10000) -c = p.createConstraint(wheelA,0,wheelB,0,jointType=p.JOINT_GEAR,jointAxis =[0,1,0],parentFramePosition=[0,0,0],childFramePosition=[0,0,0]) -p.changeConstraint(c,gearRatio=-0.1, maxForce=10000) p.setRealTimeSimulation(1) while(1):