The main goal is to create a class within the vehicle-side library that can be used to listen for RabbitMQ command messages from a publisher called from GCS.
How It Should Work
On vehicle-side, the code for listening for commands would probably look something like this:
# `integration` is the supposed name of the library
from integration.Commands import CommandsRabbitMQ
from integration.Types import CommandsEnum
def callback(channel, method, properties, body):
# Insert callback code here
pass
# Initializing a telemetry object should initiate a connection towards the RabbitMQ broker server
# We use ERU as an example here, but this should work with any vehicle.
commands = CommandsRabbitMQ(vehicleName="ERU")
# A method that allow for the vehicle to subscribe to one queue that deals with all commands
commands.subscribe_all(callback_function=callback)
# A method that can be used to subscribe to specific functions only
# In this example I have manual mode toggle but there should be one for each command.
commands.subscribe(topic=CommandsEnum.MANUAL_MODE, callback_function=callback)
Also a quick reminder of how the Vehicle-to-GCS integration model looks like.
Issue Goal
The main goal is to create a class within the vehicle-side library that can be used to listen for RabbitMQ command messages from a publisher called from GCS.
How It Should Work
On vehicle-side, the code for listening for commands would probably look something like this:
Also a quick reminder of how the Vehicle-to-GCS integration model looks like.