Access position data at higher frequency
-
Hey all,
I'm trying to use offboard control mode to give velocity commands to a starling 2 max and need position information at higher than 10 Hz (the default rate at which mavlink position messages are published)
Is it possible to access this information at a higher rate either by increasing the mavlink publishing rate or using MPA?
Kind regards,
Griffin -
For anyone running into similar issues, here is the solution I found:
You can manually adjust the interval times of mavlink messages with the MAV_CMD_SET_MESSAGE_INTERVAL command, in this case for the LOCAL_POSITION_NED message.
Using
pymavlink
this can be accomplished with:# [...] self.client = mavutil.mavlink_connection( connection_string, ) # [...] self.client.mav.command_long_send( self.client.target_system, self.client.target_component, mavutil.mavlink.MAV_CMD_SET_MESSAGE_INTERVAL, 0, # confirmation 32, # LOCAL_POSITION_NED 10000, # Wait time in us 0, 0, 0, 0, 0 # param3-7: unused )
Hope this helps anyone else who wants higher rate data!
-
edit: use
mavutil.mavlink.MAVLINK_MSG_ID_LOCAL_POSITION_NED*
instead of magic number32
for message ID