Merge branch 'master' of https://github.com/erwincoumans/bullet3
This commit is contained in:
@@ -1020,7 +1020,7 @@ int BulletURDFImporter::convertLinkVisualShapes(int linkIndex, const char* pathP
|
|||||||
//delete textures
|
//delete textures
|
||||||
for (int i=0;i<textures.size();i++)
|
for (int i=0;i<textures.size();i++)
|
||||||
{
|
{
|
||||||
delete textures[i].textureData;
|
free( textures[i].textureData);
|
||||||
}
|
}
|
||||||
return graphicsIndex;
|
return graphicsIndex;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -286,6 +286,7 @@ void ConvertURDF2BulletInternal(
|
|||||||
btTransform offsetInA,offsetInB;
|
btTransform offsetInA,offsetInB;
|
||||||
offsetInA = parentLocalInertialFrame.inverse()*parent2joint;
|
offsetInA = parentLocalInertialFrame.inverse()*parent2joint;
|
||||||
offsetInB = localInertialFrame.inverse();
|
offsetInB = localInertialFrame.inverse();
|
||||||
|
btQuaternion parentRotToThis = offsetInB.getRotation() * offsetInA.inverse().getRotation();
|
||||||
|
|
||||||
bool disableParentCollision = true;
|
bool disableParentCollision = true;
|
||||||
switch (jointType)
|
switch (jointType)
|
||||||
@@ -295,14 +296,9 @@ void ConvertURDF2BulletInternal(
|
|||||||
if (createMultiBody)
|
if (createMultiBody)
|
||||||
{
|
{
|
||||||
//todo: adjust the center of mass transform and pivot axis properly
|
//todo: adjust the center of mass transform and pivot axis properly
|
||||||
|
|
||||||
//b3Printf("Fixed joint (btMultiBody)\n");
|
|
||||||
btQuaternion rot = offsetInA.inverse().getRotation();//parent2joint.inverse().getRotation();
|
|
||||||
cache.m_bulletMultiBody->setupFixed(mbLinkIndex, mass, localInertiaDiagonal, mbParentIndex,
|
cache.m_bulletMultiBody->setupFixed(mbLinkIndex, mass, localInertiaDiagonal, mbParentIndex,
|
||||||
rot*offsetInB.getRotation(), offsetInA.getOrigin(),-offsetInB.getOrigin());
|
parentRotToThis, offsetInA.getOrigin(),-offsetInB.getOrigin());
|
||||||
creation.addLinkMapping(urdfLinkIndex,mbLinkIndex);
|
creation.addLinkMapping(urdfLinkIndex,mbLinkIndex);
|
||||||
|
|
||||||
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
//b3Printf("Fixed joint\n");
|
//b3Printf("Fixed joint\n");
|
||||||
@@ -319,14 +315,12 @@ void ConvertURDF2BulletInternal(
|
|||||||
{
|
{
|
||||||
if (createMultiBody)
|
if (createMultiBody)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
cache.m_bulletMultiBody->setupRevolute(mbLinkIndex, mass, localInertiaDiagonal, mbParentIndex,
|
cache.m_bulletMultiBody->setupRevolute(mbLinkIndex, mass, localInertiaDiagonal, mbParentIndex,
|
||||||
offsetInA.inverse().getRotation()*offsetInB.getRotation(), quatRotate(offsetInB.inverse().getRotation(),jointAxisInJointSpace), offsetInA.getOrigin(),//parent2joint.getOrigin(),
|
parentRotToThis, quatRotate(offsetInB.getRotation(),jointAxisInJointSpace), offsetInA.getOrigin(),//parent2joint.getOrigin(),
|
||||||
-offsetInB.getOrigin(),
|
-offsetInB.getOrigin(),
|
||||||
disableParentCollision);
|
disableParentCollision);
|
||||||
cache.m_bulletMultiBody->getLink(mbLinkIndex).m_jointDamping = jointDamping;
|
cache.m_bulletMultiBody->getLink(mbLinkIndex).m_jointDamping = jointDamping;
|
||||||
cache.m_bulletMultiBody->getLink(mbLinkIndex).m_jointFriction= jointFriction;
|
cache.m_bulletMultiBody->getLink(mbLinkIndex).m_jointFriction= jointFriction;
|
||||||
creation.addLinkMapping(urdfLinkIndex,mbLinkIndex);
|
creation.addLinkMapping(urdfLinkIndex,mbLinkIndex);
|
||||||
|
|
||||||
} else
|
} else
|
||||||
@@ -344,12 +338,10 @@ void ConvertURDF2BulletInternal(
|
|||||||
{
|
{
|
||||||
if (createMultiBody)
|
if (createMultiBody)
|
||||||
{
|
{
|
||||||
|
|
||||||
cache.m_bulletMultiBody->setupPrismatic(mbLinkIndex, mass, localInertiaDiagonal, mbParentIndex,
|
cache.m_bulletMultiBody->setupPrismatic(mbLinkIndex, mass, localInertiaDiagonal, mbParentIndex,
|
||||||
offsetInA.inverse().getRotation()*offsetInB.getRotation(), quatRotate(offsetInB.inverse().getRotation(),jointAxisInJointSpace), offsetInA.getOrigin(),//parent2joint.getOrigin(),
|
parentRotToThis, quatRotate(offsetInB.getRotation(),jointAxisInJointSpace), offsetInA.getOrigin(),//parent2joint.getOrigin(),
|
||||||
-offsetInB.getOrigin(),
|
-offsetInB.getOrigin(),
|
||||||
disableParentCollision);
|
disableParentCollision);
|
||||||
|
|
||||||
creation.addLinkMapping(urdfLinkIndex,mbLinkIndex);
|
creation.addLinkMapping(urdfLinkIndex,mbLinkIndex);
|
||||||
btMultiBodyConstraint* con = new btMultiBodyJointLimitConstraint(cache.m_bulletMultiBody,mbLinkIndex,jointLowerLimit, jointUpperLimit);
|
btMultiBodyConstraint* con = new btMultiBodyJointLimitConstraint(cache.m_bulletMultiBody,mbLinkIndex,jointLowerLimit, jointUpperLimit);
|
||||||
world1->addMultiBodyConstraint(con);
|
world1->addMultiBodyConstraint(con);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ Vec3f barycentric(Vec2f A, Vec2f B, Vec2f C, Vec2f P) {
|
|||||||
return Vec3f(-1,1,1); // in this case generate negative coordinates, it will be thrown away by the rasterizator
|
return Vec3f(-1,1,1); // in this case generate negative coordinates, it will be thrown away by the rasterizator
|
||||||
}
|
}
|
||||||
|
|
||||||
void triangle(mat<4,3,float> &clipc, IShader &shader, TGAImage &image, float *zbuffer, const Matrix& viewPortMatrix, int objectIndex)
|
void triangle(mat<4,3,float> &clipc, IShader &shader, TGAImage &image, float *zbuffer, const Matrix& viewPortMatrix)
|
||||||
{
|
{
|
||||||
triangle(clipc,shader,image,zbuffer,0,viewPortMatrix,0);
|
triangle(clipc,shader,image,zbuffer,0,viewPortMatrix,0);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -31,6 +31,10 @@
|
|||||||
#include "IDErrorMessages.hpp"
|
#include "IDErrorMessages.hpp"
|
||||||
|
|
||||||
#ifdef BT_CUSTOM_INVERSE_DYNAMICS_CONFIG_H
|
#ifdef BT_CUSTOM_INVERSE_DYNAMICS_CONFIG_H
|
||||||
|
/*
|
||||||
|
#include "IDConfigEigen.hpp"
|
||||||
|
#include "IDConfigBuiltin.hpp"
|
||||||
|
*/
|
||||||
#define INVDYN_INCLUDE_HELPER_2(x) #x
|
#define INVDYN_INCLUDE_HELPER_2(x) #x
|
||||||
#define INVDYN_INCLUDE_HELPER(x) INVDYN_INCLUDE_HELPER_2(x)
|
#define INVDYN_INCLUDE_HELPER(x) INVDYN_INCLUDE_HELPER_2(x)
|
||||||
#include INVDYN_INCLUDE_HELPER(BT_CUSTOM_INVERSE_DYNAMICS_CONFIG_H)
|
#include INVDYN_INCLUDE_HELPER(BT_CUSTOM_INVERSE_DYNAMICS_CONFIG_H)
|
||||||
|
|||||||
Reference in New Issue
Block a user