prepare state logging system (log state of robot, vr controllers after each stepSimulation)

This commit is contained in:
Erwin Coumans
2017-02-17 10:47:55 -08:00
parent 6db217b36a
commit 34c3fca8d5
18 changed files with 330 additions and 8 deletions

View File

@@ -2457,3 +2457,42 @@ int b3SetVRCameraTrackingObject(b3SharedMemoryCommandHandle commandHandle, int o
return 0;
}
b3SharedMemoryCommandHandle b3RobotLoggingCommandInit(b3PhysicsClientHandle physClient)
{
PhysicsClient* cl = (PhysicsClient*)physClient;
b3Assert(cl);
b3Assert(cl->canSubmitCommand());
struct SharedMemoryCommand* command = cl->getAvailableSharedMemoryCommand();
b3Assert(command);
command->m_type = CMD_ROBOT_LOGGING;
command->m_updateFlags = 0;
return (b3SharedMemoryCommandHandle)command;
}
int b3RobotLoggingStartMinitaurLog(b3SharedMemoryCommandHandle commandHandle, const char* fileName, int objectUniqueId)
{
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle;
b3Assert(command);
b3Assert(command->m_type == CMD_ROBOT_LOGGING);
if (command->m_type == CMD_ROBOT_LOGGING)
{
command->m_updateFlags |= ROBOT_LOGGING_START_MINITAUR_LOG;
}
return 0;
}
int b3RobotLoggingStopMinitaurLog(b3SharedMemoryCommandHandle commandHandle)
{
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle;
b3Assert(command);
b3Assert(command->m_type == CMD_ROBOT_LOGGING);
if (command->m_type == CMD_ROBOT_LOGGING)
{
command->m_updateFlags |= ROBOT_LOGGING_STOP_MINITAUR_LOG;
}
return 0;
}