Add preliminary GRPC server for PyBullet and BulletRobotics.
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
This commit is contained in:
46
examples/SharedMemory/grpc/pybullet_pb2_grpc.py
Normal file
46
examples/SharedMemory/grpc/pybullet_pb2_grpc.py
Normal file
@@ -0,0 +1,46 @@
|
||||
# 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,))
|
||||
Reference in New Issue
Block a user