fix mqtt
This commit is contained in:
@@ -77,8 +77,8 @@ if __name__ == '__main__':
|
||||
logger.setLevel(logging.INFO)
|
||||
logger.addHandler(file_handler)
|
||||
logger.addHandler(stream_handler)
|
||||
# logger.info(cfg)
|
||||
print(cfg.keepalive)
|
||||
logger.info(cfg)
|
||||
print(cfg.msg_format)
|
||||
|
||||
# Mqtt
|
||||
client.on_connect = on_connect
|
||||
|
||||
@@ -95,7 +95,7 @@ class Json_msg_from_ros:
|
||||
Formation_data = {"velocity": Formation.velocity, "type": Formation.type}
|
||||
flyFormationMsg = orjson.dumps(Formation_data)
|
||||
cls.mqtt_Pub(message=flyFormationMsg, topics=cls.Fly_Formation_topicToMqtt, qos=cls.Fly_Formation_topicToMqtt_QOS)
|
||||
|
||||
print(flyFormationMsg)
|
||||
@classmethod
|
||||
def mqtt_Pub(cls, message:str, topics:str, waitForAck:bool=False, qos:int=0):
|
||||
mid = cls.client.publish(topics, message, qos)[1]
|
||||
|
||||
@@ -62,7 +62,7 @@ class Read_PUB_Config(Config):
|
||||
self.sectionNames[2]:{
|
||||
"logFileName":(str,True)},
|
||||
self.sectionNames[3]:{
|
||||
"msg_format": (str,False),
|
||||
"uavlink_msg_format": (str,False),
|
||||
"uav_id": (str,False),
|
||||
"baudrate": (int,False),
|
||||
"ttyport": (str,False)}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
UAVLINK:
|
||||
msg_format: Proto
|
||||
uavlink_msg_format: Proto
|
||||
uav_id: \x01\x01
|
||||
baudrate: 250000
|
||||
ttyport: /dev/ttyUSB0
|
||||
|
||||
Reference in New Issue
Block a user