ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Access position data at higher frequency

    Starling & Starling 2
    starling2 max mavlink offboard-mode
    1
    3
    126
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      griffin
      last edited by

      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

      G 1 Reply Last reply Reply Quote 0
      • G
        griffin @griffin
        last edited by

        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!

        G 1 Reply Last reply Reply Quote 0
        • G
          griffin @griffin
          last edited by

          edit: use mavutil.mavlink.MAVLINK_MSG_ID_LOCAL_POSITION_NED* instead of magic number 32 for message ID

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB | Contributors