# Access position data at higher frequency

Source: https://forum.modalai.com/topic/4002/access-position-data-at-higher-frequency
Category: Development Drones (https://forum.modalai.com/category/44/development-drones)
Tags: starling2 max, mavlink, offboard-mode, starling
Posted: 2024-12-06 00:54:26 UTC by griffin
Replies: 2 · Views: 1515

## griffin · 2024-12-06 00:54:26 UTC

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

## Reply by griffin · 2024-12-10 00:03:28 UTC

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](https://mavlink.io/en/messages/common.html#MAV_CMD_SET_MESSAGE_INTERVAL) command, in this case for the [LOCAL_POSITION_NED](https://mavlink.io/en/messages/common.html#LOCAL_POSITION_NED) message. 

Using `pymavlink` this can be accomplished with:
```python
        # [...]
        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!

## Reply by griffin · 2024-12-10 01:18:40 UTC (in reply to griffin)

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