reset simulation in test/SharedMemory/test for proper cleanup,
and it can restart without shutting down/restarting physics server w
This commit is contained in:
@@ -80,6 +80,16 @@ int b3InitStepSimulationCommand(struct SharedMemoryCommand* command)
|
||||
|
||||
}
|
||||
|
||||
int b3InitResetSimulationCommand(struct SharedMemoryCommand* command)
|
||||
{
|
||||
b3Assert(command);
|
||||
command->m_type = CMD_RESET_SIMULATION;
|
||||
command->m_updateFlags = 0;
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int b3JointControlCommandInit(struct SharedMemoryCommand* command, int controlMode)
|
||||
{
|
||||
|
||||
@@ -33,6 +33,8 @@ int b3PhysicsParamSetTimeStep(struct SharedMemoryCommand* command, double timeSt
|
||||
|
||||
int b3InitStepSimulationCommand(struct SharedMemoryCommand* command);
|
||||
|
||||
int b3InitResetSimulationCommand(struct SharedMemoryCommand* command);
|
||||
|
||||
int b3LoadUrdfCommandInit(struct SharedMemoryCommand* command, const char* urdfFileName);
|
||||
///all those commands are optional, except for the *Init
|
||||
int b3LoadUrdfCommandSetStartPosition(struct SharedMemoryCommand* command, double startPosX,double startPosY,double startPosZ);
|
||||
|
||||
@@ -148,8 +148,15 @@ int main(int argc, char* argv[])
|
||||
status.m_sendActualStateArgs.m_jointReactionForces[6*sensorJointIndexRight+1],
|
||||
status.m_sendActualStateArgs.m_jointReactionForces[6*sensorJointIndexRight+2]);
|
||||
}
|
||||
|
||||
ret = b3InitResetSimulationCommand(&command);
|
||||
ret = b3SubmitClientCommand(sm, &command);
|
||||
timeout = MAX_TIMEOUT;
|
||||
while ((timeout-- > 0) && b3ProcessServerStatus(sm, &status)==0) {}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
b3DisconnectSharedMemory(sm);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user