Change transmission rate of MAVLink messages pymavlink

Hello,
I would like to change transmission rate of few messages.
I would like to turn off sending RAW_IMU

In ardupilotmega.py there is code

def request_data_stream_send(self, target_system, target_component, req_stream_id, req_message_rate, start_stop, force_mavlink1=False):
'''
THIS INTERFACE IS DEPRECATED. USE SET_MESSAGE_INTERVAL INSTEAD.

target_system             : The target requested to send the message stream. (uint8_t)
target_component          : The target requested to send the message stream. (uint8_t)
req_stream_id             : The ID of the requested data stream (uint8_t)
req_message_rate          : The requested message rate (uint16_t)
start_stop                : 1 to start sending, 0 to stop sending. (uint8_t)

based on the codehttps://github.com/ArduPilot/pymavlink/blob/master/examples/apmsetrate.py below, I wrote something like that

autopilot = mavutil.mavlink_connection('udp:127.0.0.1:14551')
.
.
.
autopilot.mav.request_data_stream_send(autopilot.target_system, autopilot.target_component, 27, 1, 0 )

Despite sending the following command, the frequency of receiving msg with id 27 does not change. I do not know if the target ID is valid or component ID. Has anyone made similar experiments? What should I change in the code. Thanks for any repply!:slight_smile:

No ardupilot does not support that mavlink message.

Please take a look at: https://github.com/ArduPilot/pymavlink/blob/master/tools/mavtelemetry_datarates.py

By running that you should be able to understand how it works :wink:

1 Like

Thank You for reply, I am a little bit disappointed with the lack of support:(

There is AFAIK a pull request by @peterbarker to add support for message rates using that particular mavlink message.
But it is just easier to add your own stream and use the tool I linked above to get the job done.
Even if you use the SET_MESSAGE_INTERVAL method you still need the tool above.