Remove getBodyName API.

This commit is contained in:
yunfeibai
2017-03-29 15:03:29 -07:00
parent de3f91b64e
commit 64573c38e4
7 changed files with 1 additions and 142 deletions

View File

@@ -539,18 +539,6 @@ int b3JointControlSetDesiredForceTorque(b3SharedMemoryCommandHandle commandHandl
return 0;
}
b3SharedMemoryCommandHandle b3RequestBodyNameCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId)
{
PhysicsClient* cl = (PhysicsClient* ) physClient;
b3Assert(cl);
b3Assert(cl->canSubmitCommand());
struct SharedMemoryCommand* command = cl->getAvailableSharedMemoryCommand();
b3Assert(command);
command->m_type = CMD_REQUEST_BODY_NAME;
command->m_requestBodyNameArguments.m_bodyUniqueId = bodyUniqueId;
return (b3SharedMemoryCommandHandle) command;
}
b3SharedMemoryCommandHandle b3RequestActualStateCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId)
{
PhysicsClient* cl = (PhysicsClient* ) physClient;
@@ -1068,20 +1056,6 @@ int b3GetStatusActualState(b3SharedMemoryStatusHandle statusHandle,
return true;
}
int b3GetBodyName(b3SharedMemoryStatusHandle statusHandle,
struct b3BodyInfo* info)
{
const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle;
const SendBodyNameArgs &args = status->m_sendBodyNameArgs;
btAssert(status->m_type == CMD_REQUEST_BODY_NAME_COMPLETED);
if (status->m_type != CMD_REQUEST_BODY_NAME_COMPLETED)
return false;
info->m_bodyName = args.m_bodyName;
return true;
}
int b3CanSubmitCommand(b3PhysicsClientHandle physClient)
{
PhysicsClient* cl = (PhysicsClient* ) physClient;

View File

@@ -57,9 +57,6 @@ int b3GetStatusActualState(b3SharedMemoryStatusHandle statusHandle,
const double* actualStateQdot[],
const double* jointReactionForces[]);
int b3GetBodyName(b3SharedMemoryStatusHandle statusHandle,
struct b3BodyInfo* info);
///If you re-connected to an existing server, or server changed otherwise, sync the body info and user constraints etc.
b3SharedMemoryCommandHandle b3InitSyncBodyInfoCommand(b3PhysicsClientHandle physClient);
@@ -314,8 +311,6 @@ int b3CreateSensorEnable6DofJointForceTorqueSensor(b3SharedMemoryCommandHandle c
///b3CreateSensorEnableIMUForLink is not implemented yet.
///For now, if the IMU is located in the root link, use the root world transform to mimic an IMU.
int b3CreateSensorEnableIMUForLink(b3SharedMemoryCommandHandle commandHandle, int linkIndex, int enable);
b3SharedMemoryCommandHandle b3RequestBodyNameCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId);
b3SharedMemoryCommandHandle b3RequestActualStateCommandInit(b3PhysicsClientHandle physClient,int bodyUniqueId);
int b3GetJointState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int jointIndex, struct b3JointSensorState *state);

View File

@@ -943,15 +943,6 @@ const SharedMemoryStatus* PhysicsClientSharedMemory::processServerStatus() {
b3Warning("State Logging failed");
break;
}
case CMD_REQUEST_BODY_NAME_COMPLETED:
{
break;
}
case CMD_REQUEST_BODY_NAME_FAILED:
{
b3Warning("Request body name failed");
break;
}
default: {
b3Error("Unknown server status %d\n", serverCmd.m_type);
btAssert(0);

View File

@@ -4917,26 +4917,6 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm
break;
}
case CMD_REQUEST_BODY_NAME:
{
int bodyUniqueId = clientCmd.m_requestBodyNameArguments.m_bodyUniqueId;
InteralBodyData* body = m_data->getHandle(bodyUniqueId);
if (body)
{
SharedMemoryStatus& serverCmd = serverStatusOut;
serverCmd.m_type = CMD_REQUEST_BODY_NAME_COMPLETED;
strcpy(serverCmd.m_sendBodyNameArgs.m_bodyName, body->m_bodyName.c_str());
hasStatus = true;
}
else
{
b3Warning("The body name requested is not available");
SharedMemoryStatus& serverCmd = serverStatusOut;
serverCmd.m_type = CMD_REQUEST_BODY_NAME_FAILED;
hasStatus = true;
}
break;
}
default:
{
b3Error("Unknown command encountered");

View File

@@ -358,16 +358,6 @@ struct LoadBunnyArgs
double m_collisionMargin;
};
struct RequestBodyNameArgs
{
int m_bodyUniqueId;
};
struct SendBodyNameArgs
{
char m_bodyName[MAX_FILENAME_LENGTH];
};
struct RequestActualStateArgs
{
int m_bodyUniqueId;
@@ -722,7 +712,6 @@ struct SharedMemoryCommand
struct VRCameraState m_vrCameraStateArguments;
struct StateLoggingRequest m_stateLoggingArguments;
struct ConfigureOpenGLVisualizerRequest m_configureOpenGLVisualizerArguments;
struct RequestBodyNameArgs m_requestBodyNameArguments;
};
};
@@ -785,7 +774,6 @@ struct SharedMemoryStatus
struct SendKeyboardEvents m_sendKeyboardEvents;
struct SendRaycastHits m_raycastHits;
struct StateLoggingResultArgs m_stateLoggingResultArgs;
struct SendBodyNameArgs m_sendBodyNameArgs;
};
};

View File

@@ -54,7 +54,6 @@ enum EnumSharedMemoryClientCommand
CMD_STATE_LOGGING,
CMD_CONFIGURE_OPENGL_VISUALIZER,
CMD_REQUEST_KEYBOARD_EVENTS_DATA,
CMD_REQUEST_BODY_NAME,
//don't go beyond this command!
CMD_MAX_CLIENT_COMMANDS,
@@ -134,8 +133,6 @@ enum EnumSharedMemoryServerStatus
CMD_STATE_LOGGING_FAILED,
CMD_REQUEST_KEYBOARD_EVENTS_DATA_COMPLETED,
CMD_REQUEST_KEYBOARD_EVENTS_DATA_FAILED,
CMD_REQUEST_BODY_NAME_COMPLETED,
CMD_REQUEST_BODY_NAME_FAILED,
//don't go beyond 'CMD_MAX_SERVER_COMMANDS!
CMD_MAX_SERVER_COMMANDS
};