Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def translate_to_rpc(self, rpcResult):
return {
0: offboard_pb2.OffboardResult.UNKNOWN,
1: offboard_pb2.OffboardResult.SUCCESS,
2: offboard_pb2.OffboardResult.NO_SYSTEM,
3: offboard_pb2.OffboardResult.CONNECTION_ERROR,
4: offboard_pb2.OffboardResult.BUSY,
5: offboard_pb2.OffboardResult.COMMAND_DENIED,
6: offboard_pb2.OffboardResult.TIMEOUT,
7: offboard_pb2.OffboardResult.NO_SETPOINT_SET
}.get(self.value, None)
def translate_to_rpc(self, rpcResult):
return {
0: offboard_pb2.OffboardResult.UNKNOWN,
1: offboard_pb2.OffboardResult.SUCCESS,
2: offboard_pb2.OffboardResult.NO_SYSTEM,
3: offboard_pb2.OffboardResult.CONNECTION_ERROR,
4: offboard_pb2.OffboardResult.BUSY,
5: offboard_pb2.OffboardResult.COMMAND_DENIED,
6: offboard_pb2.OffboardResult.TIMEOUT,
7: offboard_pb2.OffboardResult.NO_SETPOINT_SET
}.get(self.value, None)
def translate_to_rpc(self, rpcResult):
return {
0: offboard_pb2.OffboardResult.UNKNOWN,
1: offboard_pb2.OffboardResult.SUCCESS,
2: offboard_pb2.OffboardResult.NO_SYSTEM,
3: offboard_pb2.OffboardResult.CONNECTION_ERROR,
4: offboard_pb2.OffboardResult.BUSY,
5: offboard_pb2.OffboardResult.COMMAND_DENIED,
6: offboard_pb2.OffboardResult.TIMEOUT,
7: offboard_pb2.OffboardResult.NO_SETPOINT_SET
}.get(self.value, None)
def translate_to_rpc(self, rpcResult):
return {
0: offboard_pb2.OffboardResult.UNKNOWN,
1: offboard_pb2.OffboardResult.SUCCESS,
2: offboard_pb2.OffboardResult.NO_SYSTEM,
3: offboard_pb2.OffboardResult.CONNECTION_ERROR,
4: offboard_pb2.OffboardResult.BUSY,
5: offboard_pb2.OffboardResult.COMMAND_DENIED,
6: offboard_pb2.OffboardResult.TIMEOUT,
7: offboard_pb2.OffboardResult.NO_SETPOINT_SET
}.get(self.value, None)
def translate_to_rpc(self, rpcResult):
return {
0: offboard_pb2.OffboardResult.UNKNOWN,
1: offboard_pb2.OffboardResult.SUCCESS,
2: offboard_pb2.OffboardResult.NO_SYSTEM,
3: offboard_pb2.OffboardResult.CONNECTION_ERROR,
4: offboard_pb2.OffboardResult.BUSY,
5: offboard_pb2.OffboardResult.COMMAND_DENIED,
6: offboard_pb2.OffboardResult.TIMEOUT,
7: offboard_pb2.OffboardResult.NO_SETPOINT_SET
}.get(self.value, None)
def translate_to_rpc(self, rpcResult):
return {
0: offboard_pb2.OffboardResult.UNKNOWN,
1: offboard_pb2.OffboardResult.SUCCESS,
2: offboard_pb2.OffboardResult.NO_SYSTEM,
3: offboard_pb2.OffboardResult.CONNECTION_ERROR,
4: offboard_pb2.OffboardResult.BUSY,
5: offboard_pb2.OffboardResult.COMMAND_DENIED,
6: offboard_pb2.OffboardResult.TIMEOUT,
7: offboard_pb2.OffboardResult.NO_SETPOINT_SET
}.get(self.value, None)
def translate_to_rpc(self, rpcResult):
return {
0: offboard_pb2.OffboardResult.UNKNOWN,
1: offboard_pb2.OffboardResult.SUCCESS,
2: offboard_pb2.OffboardResult.NO_SYSTEM,
3: offboard_pb2.OffboardResult.CONNECTION_ERROR,
4: offboard_pb2.OffboardResult.BUSY,
5: offboard_pb2.OffboardResult.COMMAND_DENIED,
6: offboard_pb2.OffboardResult.TIMEOUT,
7: offboard_pb2.OffboardResult.NO_SETPOINT_SET
}.get(self.value, None)
def translate_to_rpc(self, rpcResult):
return {
0: offboard_pb2.OffboardResult.UNKNOWN,
1: offboard_pb2.OffboardResult.SUCCESS,
2: offboard_pb2.OffboardResult.NO_SYSTEM,
3: offboard_pb2.OffboardResult.CONNECTION_ERROR,
4: offboard_pb2.OffboardResult.BUSY,
5: offboard_pb2.OffboardResult.COMMAND_DENIED,
6: offboard_pb2.OffboardResult.TIMEOUT,
7: offboard_pb2.OffboardResult.NO_SETPOINT_SET
}.get(self.value, None)