expose timeout in pybullet/shared memory API

add RobotSimulator, a C++ API similar to pybullet. (work-in-progress, only part of API implemeted)
This commit is contained in:
Erwin Coumans
2017-02-24 15:34:11 -08:00
parent bb11884f89
commit a4f1e34899
34 changed files with 1654 additions and 62 deletions

View File

@@ -47,11 +47,13 @@ struct TcpNetworkedInternalData
int m_port;
b3AlignedObjectArray<unsigned char> m_tempBuffer;
double m_timeOutInSeconds;
TcpNetworkedInternalData()
:
m_isConnected(false),
m_hasCommand(false)
m_hasCommand(false),
m_timeOutInSeconds(60)
{
}
@@ -66,8 +68,8 @@ struct TcpNetworkedInternalData
m_isConnected = m_tcpSocket.Open(m_hostName.c_str(),m_port);
if (m_isConnected)
{
m_tcpSocket.SetSendTimeout(5,0);
m_tcpSocket.SetReceiveTimeout(5,0);
m_tcpSocket.SetSendTimeout(m_timeOutInSeconds,0);
m_tcpSocket.SetReceiveTimeout(m_timeOutInSeconds,0);
}
int key = SHARED_MEMORY_MAGIC_NUMBER;
m_tcpSocket.Send((uint8*)&key,4);
@@ -257,7 +259,10 @@ void TcpNetworkedPhysicsProcessor::disconnect()
}
void TcpNetworkedPhysicsProcessor::setTimeOut(double timeOutInSeconds)
{
m_data->m_timeOutInSeconds = timeOutInSeconds;
}