Use two SI solvers as blocks in block solver.
In the btBlockSolver we are experimenting with, we have SI for both multibody and rigid body. I'm currently replacing rigid body SI solver with two smaller SI solvers. The two examples provided by RigidBodyBoxes.h should have the same behavior.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
#include "FixJointBoxes.h"
|
||||
|
||||
#include "../CommonInterfaces/CommonGraphicsAppInterface.h"
|
||||
@@ -61,7 +60,11 @@ public:
|
||||
b3RobotSimulatorLoadUrdfFileArgs args;
|
||||
b3RobotSimulatorChangeDynamicsArgs dynamicsArgs;
|
||||
|
||||
b3RobotJointInfo jointInfo;
|
||||
for (int i = 0; i < numCubes; i++)
|
||||
{
|
||||
args.m_forceOverrideFixedBase = (i == 0);
|
||||
args.m_startPosition.setValue(0, i * 0.05, 1);
|
||||
cubeIds[i] = m_robotSim.loadURDF("cube_small.urdf", args);
|
||||
|
||||
b3RobotJointInfo jointInfo;
|
||||
|
||||
@@ -71,7 +74,7 @@ public:
|
||||
if (i > 0)
|
||||
{
|
||||
m_robotSim.createConstraint(cubeIds[i], -1, cubeIds[i - 1], -1, &jointInfo);
|
||||
m_robotSim.setCollisionFilterGroupMask(cubeIds[i], -1, 0, 0);
|
||||
m_robotSim.setCollisionFilterGroupMask(cubeIds[i], -1, 0, 0);
|
||||
}
|
||||
|
||||
m_robotSim.loadURDF("plane.urdf");
|
||||
@@ -107,8 +110,8 @@ public:
|
||||
{
|
||||
for (int i = 0; i < numCubes; i++)
|
||||
{
|
||||
btVector3 pos (0, i * (btScalar)0.05, 1);
|
||||
btQuaternion quar (0, 0, 0, 1);
|
||||
btVector3 pos(0, i * (btScalar)0.05, 1);
|
||||
btQuaternion quar(0, 0, 0, 1);
|
||||
m_robotSim.resetBasePositionAndOrientation(cubeIds[i], pos, quar);
|
||||
}
|
||||
}
|
||||
@@ -154,11 +157,11 @@ public:
|
||||
|
||||
virtual void resetCamera()
|
||||
{
|
||||
float dist = 1;
|
||||
float pitch = -20;
|
||||
float yaw = -30;
|
||||
float targetPos[3] = {0, 0.2, 0.5};
|
||||
m_guiHelper->resetCamera(dist, yaw, pitch, targetPos[0], targetPos[1], targetPos[2]);
|
||||
float dist = 1;
|
||||
float pitch = -20;
|
||||
float yaw = -30;
|
||||
float targetPos[3] = {0, 0.2, 0.5};
|
||||
m_guiHelper->resetCamera(dist, yaw, pitch, targetPos[0], targetPos[1], targetPos[2]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user