mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 05:40:05 +00:00
4f7dfc2069
Will add GRPC client and PyBullet GRPC server plugin. Will cover most/all SharedMemoryCommand/SharedMemoryStatus messages. Run the server, then test using the pybullet_client.py
47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
import grpc
|
|
|
|
import pybullet_pb2 as pybullet__pb2
|
|
|
|
|
|
class PyBulletAPIStub(object):
|
|
# missing associated documentation comment in .proto file
|
|
pass
|
|
|
|
def __init__(self, channel):
|
|
"""Constructor.
|
|
|
|
Args:
|
|
channel: A grpc.Channel.
|
|
"""
|
|
self.SubmitCommand = channel.unary_unary(
|
|
'/pybullet_grpc.PyBulletAPI/SubmitCommand',
|
|
request_serializer=pybullet__pb2.PyBulletCommand.SerializeToString,
|
|
response_deserializer=pybullet__pb2.PyBulletStatus.FromString,
|
|
)
|
|
|
|
|
|
class PyBulletAPIServicer(object):
|
|
# missing associated documentation comment in .proto file
|
|
pass
|
|
|
|
def SubmitCommand(self, request, context):
|
|
"""Sends a greeting
|
|
"""
|
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
context.set_details('Method not implemented!')
|
|
raise NotImplementedError('Method not implemented!')
|
|
|
|
|
|
def add_PyBulletAPIServicer_to_server(servicer, server):
|
|
rpc_method_handlers = {
|
|
'SubmitCommand': grpc.unary_unary_rpc_method_handler(
|
|
servicer.SubmitCommand,
|
|
request_deserializer=pybullet__pb2.PyBulletCommand.FromString,
|
|
response_serializer=pybullet__pb2.PyBulletStatus.SerializeToString,
|
|
),
|
|
}
|
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
'pybullet_grpc.PyBulletAPI', rpc_method_handlers)
|
|
server.add_generic_rpc_handlers((generic_handler,))
|