Hi @xianglic, welcome to the forum
This is the key question here - the recv_match
function is what handles processing all the received messages, so the latest messages don’t get updated if you don’t do the receiving part.
Some previous comments/threads that may help with understanding:
- some discussion of
recv_match
, and pymavlink more generally - some (synchronous) approaches for receiving data
- some more discussion of pymavlink, including an asyncio example
- discussion of using MAVLink2REST instead of pymavlink
- if you use MAVLink2REST, or a compatible router like MAVLink Server, you can hand off the initial receiving and filtering to a more performant application/service, and then your Python code can just fetch only the messages you actually want (at the cost of not having the Pymavlink niceties provided for you) - this is likely a good approach if performance/efficiency are important, and you don’t have lots of different message types you need to handle