@@ -2467,41 +2467,80 @@ int b3SetVRCameraTrackingObject(b3SharedMemoryCommandHandle commandHandle, int o
2467
2467
return 0 ;
2468
2468
}
2469
2469
2470
- b3SharedMemoryCommandHandle b3RobotLoggingCommandInit (b3PhysicsClientHandle physClient)
2470
+ b3SharedMemoryCommandHandle b3StateLoggingCommandInit (b3PhysicsClientHandle physClient)
2471
2471
{
2472
2472
PhysicsClient* cl = (PhysicsClient*)physClient;
2473
2473
b3Assert (cl);
2474
2474
b3Assert (cl->canSubmitCommand ());
2475
2475
struct SharedMemoryCommand * command = cl->getAvailableSharedMemoryCommand ();
2476
2476
b3Assert (command);
2477
2477
2478
- command->m_type = CMD_ROBOT_LOGGING ;
2478
+ command->m_type = CMD_STATE_LOGGING ;
2479
2479
command->m_updateFlags = 0 ;
2480
+ command->m_stateLoggingArguments .m_numBodyUniqueIds = 0 ;
2480
2481
2481
2482
return (b3SharedMemoryCommandHandle)command;
2482
2483
2483
2484
}
2484
2485
2485
- int b3RobotLoggingStartMinitaurLog (b3SharedMemoryCommandHandle commandHandle, const char * fileName, int objectUniqueId )
2486
+ int b3StateLoggingStart (b3SharedMemoryCommandHandle commandHandle, int loggingType, const char * fileName)
2486
2487
{
2487
2488
struct SharedMemoryCommand * command = (struct SharedMemoryCommand *) commandHandle;
2488
2489
b3Assert (command);
2489
- b3Assert (command->m_type == CMD_ROBOT_LOGGING );
2490
- if (command->m_type == CMD_ROBOT_LOGGING )
2490
+ b3Assert (command->m_type == CMD_STATE_LOGGING );
2491
+ if (command->m_type == CMD_STATE_LOGGING )
2491
2492
{
2492
- command->m_updateFlags |= ROBOT_LOGGING_START_MINITAUR_LOG;
2493
+ command->m_updateFlags |= STATE_LOGGING_START_LOG;
2494
+ int len = strlen (fileName);
2495
+ if (len < MAX_FILENAME_LENGTH)
2496
+ {
2497
+ strcpy (command->m_stateLoggingArguments .m_fileName , fileName);
2498
+ }
2499
+ else
2500
+ {
2501
+ command->m_stateLoggingArguments .m_fileName [0 ] = 0 ;
2502
+ }
2503
+ command->m_stateLoggingArguments .m_logType = loggingType;
2493
2504
}
2494
2505
return 0 ;
2495
2506
}
2496
2507
2497
- int b3RobotLoggingStopMinitaurLog (b3SharedMemoryCommandHandle commandHandle)
2508
+ int b3GetStatusLoggingUniqueId (b3SharedMemoryStatusHandle statusHandle)
2509
+ {
2510
+ const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle;
2511
+ b3Assert (status);
2512
+ b3Assert (status->m_type == CMD_STATE_LOGGING_START_COMPLETED);
2513
+ if (status && status->m_type == CMD_STATE_LOGGING_START_COMPLETED)
2514
+ {
2515
+ return status->m_stateLoggingResultArgs .m_loggingUniqueId ;
2516
+ }
2517
+ return -1 ;
2518
+ }
2519
+
2520
+ int b3StateLoggingAddLoggingObjectUniqueId (b3SharedMemoryCommandHandle commandHandle, int objectUniqueId)
2521
+ {
2522
+ struct SharedMemoryCommand * command = (struct SharedMemoryCommand *) commandHandle;
2523
+ b3Assert (command);
2524
+ b3Assert (command->m_type == CMD_STATE_LOGGING);
2525
+ if (command->m_type == CMD_STATE_LOGGING)
2526
+ {
2527
+ command->m_updateFlags |= STATE_LOGGING_FILTER_OBJECT_UNIQUE_ID;
2528
+ if (command->m_stateLoggingArguments .m_numBodyUniqueIds < MAX_SDF_BODIES)
2529
+ {
2530
+ command->m_stateLoggingArguments .m_bodyUniqueIds [command->m_stateLoggingArguments .m_numBodyUniqueIds ++] = objectUniqueId;
2531
+ }
2532
+ }
2533
+ return 0 ;
2534
+ }
2535
+ int b3StateLoggingStop (b3SharedMemoryCommandHandle commandHandle, int loggingUid)
2498
2536
{
2499
2537
struct SharedMemoryCommand * command = (struct SharedMemoryCommand *) commandHandle;
2500
2538
b3Assert (command);
2501
- b3Assert (command->m_type == CMD_ROBOT_LOGGING );
2502
- if (command->m_type == CMD_ROBOT_LOGGING )
2539
+ b3Assert (command->m_type == CMD_STATE_LOGGING );
2540
+ if (command->m_type == CMD_STATE_LOGGING )
2503
2541
{
2504
- command->m_updateFlags |= ROBOT_LOGGING_STOP_MINITAUR_LOG;
2542
+ command->m_updateFlags |= STATE_LOGGING_STOP_LOG;
2543
+ command->m_stateLoggingArguments .m_loggingUniqueId = loggingUid;
2505
2544
}
2506
2545
return 0 ;
2507
2546
}
0 commit comments