more GRPC work

This commit is contained in:
erwincoumans
2018-09-03 23:13:15 -07:00
parent 23e84ca9b6
commit 9e2f6c7935
21 changed files with 22906 additions and 780 deletions

View File

@@ -14,6 +14,9 @@
#include "../SharedMemory/mujoco/MuJoCoPhysicsC_API.h"
#endif
#ifdef BT_ENABLE_GRPC
#include "../SharedMemory/PhysicsClientGRPC_C_API.h"
#endif
#ifdef BT_ENABLE_CLSOCKET
#include "../SharedMemory/PhysicsClientTCP_C_API.h"
#endif //BT_ENABLE_CLSOCKET
@@ -431,7 +434,15 @@ static PyObject* pybullet_connectPhysicsServer(PyObject* self, PyObject* args, P
break;
}
#endif
case eCONNECT_GRPC:
{
#ifdef BT_ENABLE_GRPC
sm = b3ConnectPhysicsGRPC(hostName.c_str(), tcpPort);
#else
b3Warning("GRPC is not enabled in this pybullet build");
#endif
break;
}
case eCONNECT_SHARED_MEMORY:
{
sm = b3ConnectSharedMemory(key);
@@ -9625,6 +9636,9 @@ initpybullet(void)
#ifdef BT_ENABLE_MUJOCO
PyModule_AddIntConstant(m, "MuJoCo", eCONNECT_MUJOCO); // user read
#endif
#ifdef BT_ENABLE_GRPC
PyModule_AddIntConstant(m, "GRPC", eCONNECT_GRPC); // user read
#endif
PyModule_AddIntConstant(m, "SHARED_MEMORY_KEY", SHARED_MEMORY_KEY);