mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Mission: add winch support
This commit is contained in:
parent
07e2853b8e
commit
8b4345f29d
@ -806,6 +806,13 @@ MAV_MISSION_RESULT AP_Mission::mavlink_int_to_mission_cmd(const mavlink_mission_
|
|||||||
cmd.content.set_yaw_speed.relative_angle = packet.param3; // 0 = absolute angle, 1 = relative angle
|
cmd.content.set_yaw_speed.relative_angle = packet.param3; // 0 = absolute angle, 1 = relative angle
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MAV_CMD_DO_WINCH: // MAV ID: 42600
|
||||||
|
cmd.content.winch.num = packet.param1; // winch number
|
||||||
|
cmd.content.winch.action = packet.param2; // action (0 = relax, 1 = length control, 2 = rate control). See WINCH_ACTION enum
|
||||||
|
cmd.content.winch.release_length = packet.param3; // cable distance to unwind in meters, negative numbers to wind in cable
|
||||||
|
cmd.content.winch.release_rate = packet.param4; // release rate in meters/second
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// unrecognised command
|
// unrecognised command
|
||||||
return MAV_MISSION_UNSUPPORTED;
|
return MAV_MISSION_UNSUPPORTED;
|
||||||
@ -1255,6 +1262,13 @@ bool AP_Mission::mission_cmd_to_mavlink_int(const AP_Mission::Mission_Command& c
|
|||||||
packet.param3 = cmd.content.set_yaw_speed.relative_angle; // 0 = absolute angle, 1 = relative angle
|
packet.param3 = cmd.content.set_yaw_speed.relative_angle; // 0 = absolute angle, 1 = relative angle
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MAV_CMD_DO_WINCH:
|
||||||
|
packet.param1 = cmd.content.winch.num; // winch number
|
||||||
|
packet.param2 = cmd.content.winch.action; // action (0 = relax, 1 = length control, 2 = rate control). See WINCH_ACTION enum
|
||||||
|
packet.param3 = cmd.content.winch.release_length; // cable distance to unwind in meters, negative numbers to wind in cable
|
||||||
|
packet.param4 = cmd.content.winch.release_rate; // release rate in meters/second
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// unrecognised command
|
// unrecognised command
|
||||||
return false;
|
return false;
|
||||||
|
@ -184,6 +184,14 @@ public:
|
|||||||
uint8_t relative_angle; // 0 = absolute angle, 1 = relative angle
|
uint8_t relative_angle; // 0 = absolute angle, 1 = relative angle
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// winch command structure
|
||||||
|
struct PACKED Winch_Command {
|
||||||
|
uint8_t num; // winch number
|
||||||
|
uint8_t action; // action (0 = relax, 1 = length control, 2 = rate control)
|
||||||
|
float release_length; // cable distance to unwind in meters, negative numbers to wind in cable
|
||||||
|
float release_rate; // release rate in meters/second
|
||||||
|
};
|
||||||
|
|
||||||
union PACKED Content {
|
union PACKED Content {
|
||||||
// jump structure
|
// jump structure
|
||||||
Jump_Command jump;
|
Jump_Command jump;
|
||||||
@ -245,6 +253,9 @@ public:
|
|||||||
// navigation delay
|
// navigation delay
|
||||||
Set_Yaw_Speed set_yaw_speed;
|
Set_Yaw_Speed set_yaw_speed;
|
||||||
|
|
||||||
|
// do-winch
|
||||||
|
Winch_Command winch;
|
||||||
|
|
||||||
// location
|
// location
|
||||||
Location location; // Waypoint location
|
Location location; // Waypoint location
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user