Hello, I’m trying to read a few specific MAVLINK messages from my Pixhawk 4 and for some reason am unable to do it. The messages I need are: GLOBAL_POSITION_INT_COV, LOCAL_POSITION_NED, ODOMETRY and ATTITUDE_QUATERNION.
This is a sample from code I’m using:
from dronekit import connect
pixhawk = connect('/dev/ttyACM0', wait_ready=True, baud=57600)
@pixhawk.on_message('LOCAL_POSITION_NED') #Tried the same for the other three
def listener(self, name, message):
print(message)
I made sure they are in the common.xml file, and also checked in Mission Planner that SERIAL0_PROTOCOL is set to 2 for Mavlink 2. I also tried setting their rate with this:
msg = pixhawk.message_factory.command_long_encode(
0, # target_system
0, # target_component
511, # command MAV_CMD_SET_MESSAGE_INTERVAL
32, # Also tried31, 63 and 331
100000, # time interval between messages in microseconds
0,0,0,0,0) # param 3-7 not used
pixhawk.send_mavlink(msg)
And it did help for ATTITUDE_QUATERNION but not for the others. Can anyone help me solve this please?
Thank you for the help.