An error when using MAV_CMD_INJECT_FAILURE command

15 views
Skip to first unread message

kourosh marjoei

unread,
Jan 8, 2025, 8:20:32 AMJan 8
to MAVLink
Hello everone,

For a resarch purpose, I would like to use MAV_CMD_INJECT_FAILURE MAVLink command.

According to the description of this command in MAVLink site, it is important to change a specific param setting before using this command. I am wondering what this param setting is. 

Currently, I faced the following error when I run a Pymavlink script using this command. I am wondering if this is due to the above reason.

AttributeError: module 'pymavlink,dialects.v20.ardupilotmega' has no attribute 'MAV_CMD_INJECT_FAILURE'

I would be so grateful if you could help me solve this error.
Thanks in advance for your time , and I look forward to hearing from you soon.

Best regards,
Kourosh




Hamish Willee

unread,
Jan 22, 2025, 12:38:39 AMJan 22
to MAVLink
The error means what it says - this command is not available in the dialect. That's because Pymavlink takes its definitions from https://github.com/ArduPilot/mavlink/blob/master/message_definitions/v1.0/common.xml#L1597 and this has not been properly updated with the definitions in mavlink/mavlink.
If you want to use pymavlink you will have to build it yourself with the proper definitions.

If you're working with ArduPilot you probably shouldn't bother, as they have not implemented this message. 
If you're working with PX4 then this is implemented. Information on how it is used and the param is here https://docs.px4.io/main/en/debug/failure_injection.html#failure-system-command

Reply all
Reply to author
Forward
0 new messages