Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files. make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type. This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
@@ -7,45 +7,41 @@ int main(int argc, char* argv[])
|
||||
|
||||
bool isConnected = sim->connect(eCONNECT_SHARED_MEMORY);
|
||||
|
||||
|
||||
if (!isConnected)
|
||||
{
|
||||
printf("Using Direct mode\n");
|
||||
isConnected = sim->connect(eCONNECT_DIRECT);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Using shared memory\n");
|
||||
}
|
||||
|
||||
|
||||
//remove all existing objects (if any)
|
||||
sim->resetSimulation();
|
||||
sim->setGravity(btVector3(0,0,-9.8));
|
||||
sim->setGravity(btVector3(0, 0, -9.8));
|
||||
sim->setNumSolverIterations(100);
|
||||
b3RobotSimulatorSetPhysicsEngineParameters args;
|
||||
sim->getPhysicsEngineParameters(args);
|
||||
|
||||
|
||||
int planeUid = sim->loadURDF("plane.urdf");
|
||||
printf("planeUid = %d\n", planeUid);
|
||||
|
||||
|
||||
int r2d2Uid = sim->loadURDF("r2d2.urdf");
|
||||
printf("r2d2 #joints = %d\n", sim->getNumJoints(r2d2Uid));
|
||||
|
||||
|
||||
btVector3 basePosition = btVector3(0,0,0.5);
|
||||
btQuaternion baseOrientation = btQuaternion(0,0,0,1);
|
||||
|
||||
btVector3 basePosition = btVector3(0, 0, 0.5);
|
||||
btQuaternion baseOrientation = btQuaternion(0, 0, 0, 1);
|
||||
|
||||
sim->resetBasePositionAndOrientation(r2d2Uid, basePosition, baseOrientation);
|
||||
|
||||
|
||||
|
||||
while (sim->isConnected())
|
||||
{
|
||||
btVector3 basePos;
|
||||
btQuaternion baseOrn;
|
||||
sim->getBasePositionAndOrientation(r2d2Uid,basePos,baseOrn);
|
||||
printf("r2d2 basePosition = [%f,%f,%f]\n", basePos[0],basePos[1],basePos[2]);
|
||||
|
||||
sim->getBasePositionAndOrientation(r2d2Uid, basePos, baseOrn);
|
||||
printf("r2d2 basePosition = [%f,%f,%f]\n", basePos[0], basePos[1], basePos[2]);
|
||||
|
||||
sim->stepSimulation();
|
||||
}
|
||||
delete sim;
|
||||
|
||||
Reference in New Issue
Block a user