mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 22:00:05 +00:00
PyBullet: tweak in TCP server for VR - ROS bridge
This commit is contained in:
parent
c0183d4834
commit
2ce1e65b53
@ -177,22 +177,30 @@ int main(int argc, char *argv[])
|
||||
SharedMemoryCommand cmd;
|
||||
|
||||
SharedMemoryCommand* cmdPtr = 0;
|
||||
|
||||
|
||||
int type = *(int*)&bytesReceived[0];
|
||||
|
||||
//performance test
|
||||
if (numBytesRec == sizeof(int))
|
||||
{
|
||||
cmdPtr = &cmd;
|
||||
cmd.m_type = *(int*)&bytesReceived[0];
|
||||
}
|
||||
|
||||
|
||||
if (numBytesRec == sizeof(SharedMemoryCommand))
|
||||
{
|
||||
cmdPtr = (SharedMemoryCommand*)&bytesReceived[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
cmdPtr = (SharedMemoryCommand*)&bytesReceived[0];
|
||||
|
||||
if (numBytesRec == sizeof(SharedMemoryCommand))
|
||||
{
|
||||
cmdPtr = (SharedMemoryCommand*)&bytesReceived[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (numBytesRec==36)
|
||||
{
|
||||
cmdPtr = &cmd;
|
||||
memcpy(&cmd, &bytesReceived[0], numBytesRec);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cmdPtr)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user