temporary disable experimental BulletRobotics examples
This commit is contained in:
@@ -3,11 +3,6 @@
|
||||
#include "../BlockSolver/BlockSolverExample.h"
|
||||
#include "LinearMath/btAlignedObjectArray.h"
|
||||
#include "EmptyExample.h"
|
||||
#include "../BulletRobotics/BoxStack.h"
|
||||
#include "../BulletRobotics/FixJointBoxes.h"
|
||||
#include "../BulletRobotics/JointLimit.h"
|
||||
// #include "../BulletRobotics/GraspBox.h"
|
||||
#include "../BulletRobotics/FixJointBoxes.h"
|
||||
#include "../RenderingExamples/RenderInstancingDemo.h"
|
||||
#include "../RenderingExamples/CoordinateSystemDemo.h"
|
||||
#include "../RenderingExamples/RaytracerSetup.h"
|
||||
@@ -135,11 +130,6 @@ static ExampleEntry gDefaultExamples[] =
|
||||
ExampleEntry(1, "Soft Contact", "Using the error correction parameter (ERP) and constraint force mixing (CFM) values for contacts to simulate compliant contact.", RigidBodySoftContactCreateFunc),
|
||||
|
||||
|
||||
ExampleEntry(0, "Bullet Robotics"),
|
||||
ExampleEntry(1, "Box Stack", "Create a stack of boxes of large mass ratio.", BoxStackExampleCreateFunc),
|
||||
ExampleEntry(1, "Joint Limit", "Create three objects joint together", JointLimitCreateFunc),
|
||||
// ExampleEntry(1, "Grasp Box", "A robot arm of large mass tries to grasp a box of small mass", GraspBoxCreateFunc),
|
||||
ExampleEntry(1, "FixJoint Boxes", "FixJoint Boxes", FixJointBoxesCreateFunc),
|
||||
|
||||
ExampleEntry(0, "MultiBody"),
|
||||
ExampleEntry(1, "MultiDof", "Create a basic btMultiBody with 3-DOF spherical joints (mobilizers). The demo uses a fixed base or a floating base at restart.", MultiDofCreateFunc),
|
||||
|
||||
@@ -21,6 +21,12 @@ inline char* strDup(const char* const str)
|
||||
template <typename T, typename U>
|
||||
void addJointInfoFromMultiBodyData(const T* mb, U* bodyJoints, bool verboseOutput)
|
||||
{
|
||||
int numDofs = 0;
|
||||
if (mb->m_baseMass>0)
|
||||
{
|
||||
numDofs = 6;
|
||||
}
|
||||
|
||||
if (mb->m_baseName)
|
||||
{
|
||||
if (verboseOutput)
|
||||
@@ -107,7 +113,9 @@ void addJointInfoFromMultiBodyData(const T* mb, U* bodyJoints, bool verboseOutpu
|
||||
}
|
||||
qOffset += mb->m_links[link].m_posVarCount;
|
||||
uOffset += mb->m_links[link].m_dofCount;
|
||||
numDofs += mb->m_links[link].m_dofCount;
|
||||
}
|
||||
bodyJoints->m_numDofs = numDofs;
|
||||
}
|
||||
|
||||
#endif //BODY_JOINT_INFO_UTILITY_H
|
||||
|
||||
@@ -33,6 +33,8 @@ public:
|
||||
|
||||
virtual int getNumJoints(int bodyUniqueId) const = 0;
|
||||
|
||||
virtual int getNumDofs(int bodyUniqueId) const = 0;
|
||||
|
||||
virtual bool getJointInfo(int bodyUniqueId, int jointIndex, struct b3JointInfo& info) const = 0;
|
||||
|
||||
virtual int getNumUserConstraints() const = 0;
|
||||
|
||||
@@ -2526,6 +2526,12 @@ B3_SHARED_API int b3GetNumJoints(b3PhysicsClientHandle physClient, int bodyUniqu
|
||||
return cl->getNumJoints(bodyUniqueId);
|
||||
}
|
||||
|
||||
B3_SHARED_API int b3GetNumDofs(b3PhysicsClientHandle physClient, int bodyUniqueId)
|
||||
{
|
||||
PhysicsClient* cl = (PhysicsClient*)physClient;
|
||||
return cl->getNumDofs(bodyUniqueId);
|
||||
}
|
||||
|
||||
B3_SHARED_API int b3ComputeDofCount(b3PhysicsClientHandle physClient, int bodyUniqueId)
|
||||
{
|
||||
int nj = b3GetNumJoints(physClient, bodyUniqueId);
|
||||
@@ -4642,8 +4648,9 @@ B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateJacobianCommandInit(b3Physi
|
||||
command->m_calculateJacobianArguments.m_localPosition[0] = localPosition[0];
|
||||
command->m_calculateJacobianArguments.m_localPosition[1] = localPosition[1];
|
||||
command->m_calculateJacobianArguments.m_localPosition[2] = localPosition[2];
|
||||
int numJoints = cl->getNumJoints(bodyUniqueId);
|
||||
for (int i = 0; i < numJoints; i++)
|
||||
|
||||
int numDofs = cl->getNumDofs(bodyUniqueId);
|
||||
for (int i = 0; i < numDofs; i++)
|
||||
{
|
||||
command->m_calculateJacobianArguments.m_jointPositionsQ[i] = jointPositionsQ[i];
|
||||
command->m_calculateJacobianArguments.m_jointVelocitiesQdot[i] = jointVelocitiesQdot[i];
|
||||
|
||||
@@ -118,7 +118,9 @@ extern "C"
|
||||
|
||||
///give a unique body index (after loading the body) return the number of joints.
|
||||
B3_SHARED_API int b3GetNumJoints(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
|
||||
///give a unique body index (after loading the body) return the number of degrees of freedom (DoF).
|
||||
B3_SHARED_API int b3GetNumDofs(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
|
||||
///compute the number of degrees of freedom for this body.
|
||||
///Return -1 for unsupported spherical joint, -2 for unsupported planar joint.
|
||||
B3_SHARED_API int b3ComputeDofCount(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
|
||||
@@ -144,6 +144,17 @@ int PhysicsClientSharedMemory::getNumJoints(int bodyUniqueId) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
int PhysicsClientSharedMemory::getNumDofs(int bodyUniqueId) const
|
||||
{
|
||||
BodyJointInfoCache** bodyJointsPtr = m_data->m_bodyJointMap[bodyUniqueId];
|
||||
if (bodyJointsPtr && *bodyJointsPtr)
|
||||
{
|
||||
BodyJointInfoCache* bodyJoints = *bodyJointsPtr;
|
||||
return bodyJoints->m_numDofs;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool PhysicsClientSharedMemory::getJointInfo(int bodyUniqueId, int jointIndex, b3JointInfo& info) const
|
||||
{
|
||||
BodyJointInfoCache** bodyJointsPtr = m_data->m_bodyJointMap[bodyUniqueId];
|
||||
|
||||
@@ -45,6 +45,8 @@ public:
|
||||
|
||||
virtual int getNumJoints(int bodyUniqueId) const;
|
||||
|
||||
virtual int getNumDofs(int bodyUniqueId) const;
|
||||
|
||||
virtual bool getJointInfo(int bodyUniqueId, int jointIndex, struct b3JointInfo& info) const;
|
||||
|
||||
virtual int getNumUserConstraints() const;
|
||||
|
||||
@@ -1275,9 +1275,9 @@ bool PhysicsDirect::getBodyInfo(int bodyUniqueId, struct b3BodyInfo& info) const
|
||||
return false;
|
||||
}
|
||||
|
||||
int PhysicsDirect::getNumJoints(int bodyIndex) const
|
||||
int PhysicsDirect::getNumJoints(int bodyUniqueId) const
|
||||
{
|
||||
BodyJointInfoCache2** bodyJointsPtr = m_data->m_bodyJointMap[bodyIndex];
|
||||
BodyJointInfoCache2** bodyJointsPtr = m_data->m_bodyJointMap[bodyUniqueId];
|
||||
if (bodyJointsPtr && *bodyJointsPtr)
|
||||
{
|
||||
BodyJointInfoCache2* bodyJoints = *bodyJointsPtr;
|
||||
@@ -1287,6 +1287,18 @@ int PhysicsDirect::getNumJoints(int bodyIndex) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
int PhysicsDirect::getNumDofs(int bodyUniqueId) const
|
||||
{
|
||||
BodyJointInfoCache2** bodyJointsPtr = m_data->m_bodyJointMap[bodyUniqueId];
|
||||
if (bodyJointsPtr && *bodyJointsPtr)
|
||||
{
|
||||
BodyJointInfoCache2* bodyJoints = *bodyJointsPtr;
|
||||
return bodyJoints->m_numDofs;
|
||||
}
|
||||
btAssert(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool PhysicsDirect::getJointInfo(int bodyIndex, int jointIndex, struct b3JointInfo& info) const
|
||||
{
|
||||
BodyJointInfoCache2** bodyJointsPtr = m_data->m_bodyJointMap[bodyIndex];
|
||||
|
||||
@@ -61,7 +61,9 @@ public:
|
||||
|
||||
virtual bool getBodyInfo(int bodyUniqueId, struct b3BodyInfo& info) const;
|
||||
|
||||
virtual int getNumJoints(int bodyIndex) const;
|
||||
virtual int getNumJoints(int bodyUniqueId) const;
|
||||
|
||||
virtual int getNumDofs(int bodyUniqueId) const;
|
||||
|
||||
virtual bool getJointInfo(int bodyIndex, int jointIndex, struct b3JointInfo& info) const;
|
||||
|
||||
|
||||
@@ -107,9 +107,14 @@ bool PhysicsLoopBack::getBodyInfo(int bodyUniqueId, struct b3BodyInfo& info) con
|
||||
return m_data->m_physicsClient->getBodyInfo(bodyUniqueId, info);
|
||||
}
|
||||
|
||||
int PhysicsLoopBack::getNumJoints(int bodyIndex) const
|
||||
int PhysicsLoopBack::getNumJoints(int bodyUniqueId) const
|
||||
{
|
||||
return m_data->m_physicsClient->getNumJoints(bodyIndex);
|
||||
return m_data->m_physicsClient->getNumJoints(bodyUniqueId);
|
||||
}
|
||||
|
||||
int PhysicsLoopBack::getNumDofs(int bodyUniqueId) const
|
||||
{
|
||||
return m_data->m_physicsClient->getNumDofs(bodyUniqueId);
|
||||
}
|
||||
|
||||
bool PhysicsLoopBack::getJointInfo(int bodyIndex, int jointIndex, struct b3JointInfo& info) const
|
||||
|
||||
@@ -42,7 +42,9 @@ public:
|
||||
|
||||
virtual bool getBodyInfo(int bodyUniqueId, struct b3BodyInfo& info) const;
|
||||
|
||||
virtual int getNumJoints(int bodyIndex) const;
|
||||
virtual int getNumJoints(int bodyUniqueId) const;
|
||||
|
||||
virtual int getNumDofs(int bodyUniqueId) const;
|
||||
|
||||
virtual bool getJointInfo(int bodyIndex, int jointIndex, struct b3JointInfo& info) const;
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ def save_config(config, logdir=None):
|
||||
tf.logging.info(message.format(config.logdir))
|
||||
tf.gfile.MakeDirs(config.logdir)
|
||||
config_path = os.path.join(config.logdir, 'config.yaml')
|
||||
with tf.gfile.FastGFile(config_path, 'w') as file_:
|
||||
with tf.gfile.GFile(config_path, 'w') as file_:
|
||||
yaml.dump(config, file_, default_flow_style=False)
|
||||
else:
|
||||
message = (
|
||||
|
||||
@@ -172,7 +172,7 @@ def save_config(config, logdir=None):
|
||||
tf.logging.info(message.format(config.logdir))
|
||||
tf.gfile.MakeDirs(config.logdir)
|
||||
config_path = os.path.join(config.logdir, 'config.yaml')
|
||||
with tf.gfile.FastGFile(config_path, 'w') as file_:
|
||||
with tf.gfile.GFile(config_path, 'w') as file_:
|
||||
yaml.dump(config, file_, default_flow_style=False)
|
||||
else:
|
||||
message = (
|
||||
|
||||
Reference in New Issue
Block a user