Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M2R fails to receive some COMMAND_LONGS #98

Open
Williangalvani opened this issue Mar 14, 2024 · 0 comments
Open

M2R fails to receive some COMMAND_LONGS #98

Williangalvani opened this issue Mar 14, 2024 · 0 comments

Comments

@Williangalvani
Copy link
Contributor

sample script:

from pymavlink import mavutil
import time


# MAV_CMD_ACCELCAL_VEHICLE_POS command definition
MAV_CMD_ACCELCAL_VEHICLE_POS = 42424 #defined at https://mavlink.io/en/messages/common.html#MAV_CMD_SET_MESSAGE_INTERVAL
MAV_CMD_SET_MESSAGE_INTERVAL = 511 #defined at https://mavlink.io/en/messages/ardupilotmega.html#MAV_CMD_ACCELCAL_VEHICLE_POS

# needs a mavlink udp client pointing to your machines 
mavlink_connection = mavutil.mavlink_connection('udp:0.0.0.0:14550')

# Wait for the heartbeat msg to find the system ID
mavlink_connection.wait_heartbeat()
print("Heartbeat from system (system ID: %u component ID: %u)" % (mavlink_connection.target_system, mavlink_connection.target_component))


def send_cmd_long(msg):
  mavlink_connection.mav.command_long_send(
    0, # target_system (0 for broadcast)
    1, # target_component (1 as specified)
    msg, # command
    0, # confirmation
    123,
    0, # param2 (unused)
    0, # param3 (unused)
    0, # param4 (unused)
    0, # param5 (unused)
    0, # param6 (unused)
    0, # param7 (unused)
)


# this works
send_cmd_long(MAV_CMD_SET_MESSAGE_INTERVAL)
print("Good MAV_CMD_LONG message sent.")

time.sleep(3)

#this does not work
send_cmd_long(MAV_CMD_ACCELCAL_VEHICLE_POS)

print("Bad MAV_CMD_LONG message sent.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant