Skip to content

Commit

Permalink
ExtLibs: setMountConfigure uses mav-cmd-do-mount-configure
Browse files Browse the repository at this point in the history
  • Loading branch information
rmackay9 committed Aug 11, 2023
1 parent 142a91a commit dfa3f23
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4469,18 +4469,15 @@ public void setDigicamControl(bool shot)
[Obsolete]
public void setMountConfigure(MAV_MOUNT_MODE mountmode, bool stabroll, bool stabpitch, bool stabyaw)
{
mavlink_mount_configure_t req = new mavlink_mount_configure_t();

req.target_system = MAV.sysid;
req.target_component = MAV.compid;
req.mount_mode = (byte) mountmode;
req.stab_pitch = (stabpitch == true) ? (byte) 1 : (byte) 0;
req.stab_roll = (stabroll == true) ? (byte) 1 : (byte) 0;
req.stab_yaw = (stabyaw == true) ? (byte) 1 : (byte) 0;

generatePacket((byte) MAVLINK_MSG_ID.MOUNT_CONFIGURE, req);
Thread.Sleep(20);
generatePacket((byte) MAVLINK_MSG_ID.MOUNT_CONFIGURE, req);
byte stab_roll = (stabroll == true) ? (byte) 1 : (byte) 0;
byte stab_pitch = (stabpitch == true) ? (byte) 1 : (byte) 0;
byte stab_yaw = (stabyaw == true) ? (byte) 1 : (byte) 0;

// p1 : mount mode
// p2, p3, p4 : stabilize roll, pitch, yaw
// p5, p6, p7 : empty
// no ack required
doCommand(MAV.sysid, MAV.compid, MAV_CMD.DO_MOUNT_CONFIGURE, (byte)mountmode, stab_roll, stab_pitch, stab_yaw, 0, 0, 0, false);
}

[Obsolete]
Expand Down

0 comments on commit dfa3f23

Please sign in to comment.