mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
Plane: link in AP_Follow
ready for ship landing
This commit is contained in:
parent
b0112ee804
commit
a8adf187ae
@ -642,6 +642,10 @@ void GCS_MAVLINK_Plane::packetReceived(const mavlink_status_t &status,
|
|||||||
{
|
{
|
||||||
#if HAL_ADSB_ENABLED
|
#if HAL_ADSB_ENABLED
|
||||||
plane.avoidance_adsb.handle_msg(msg);
|
plane.avoidance_adsb.handle_msg(msg);
|
||||||
|
#endif
|
||||||
|
#if SHIP_LANDING_ENABLED
|
||||||
|
// pass message to follow library
|
||||||
|
plane.g2.follow.handle_msg(msg);
|
||||||
#endif
|
#endif
|
||||||
GCS_MAVLINK::packetReceived(status, msg);
|
GCS_MAVLINK::packetReceived(status, msg);
|
||||||
}
|
}
|
||||||
@ -874,6 +878,16 @@ MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_packet(const mavlink_command_in
|
|||||||
case MAV_CMD_GUIDED_CHANGE_HEADING:
|
case MAV_CMD_GUIDED_CHANGE_HEADING:
|
||||||
return handle_command_int_guided_slew_commands(packet);
|
return handle_command_int_guided_slew_commands(packet);
|
||||||
|
|
||||||
|
case MAV_CMD_DO_FOLLOW:
|
||||||
|
#if SHIP_LANDING_ENABLED
|
||||||
|
// param1: sysid of target to follow
|
||||||
|
if ((packet.param1 > 0) && (packet.param1 <= 255)) {
|
||||||
|
plane.g2.follow.set_target_sysid((uint8_t)packet.param1);
|
||||||
|
return MAV_RESULT_ACCEPTED;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return MAV_RESULT_FAILED;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return GCS_MAVLINK::handle_command_int_packet(packet);
|
return GCS_MAVLINK::handle_command_int_packet(packet);
|
||||||
}
|
}
|
||||||
@ -1075,6 +1089,16 @@ MAV_RESULT GCS_MAVLINK_Plane::handle_command_long_packet(const mavlink_command_l
|
|||||||
}
|
}
|
||||||
return MAV_RESULT_ACCEPTED;
|
return MAV_RESULT_ACCEPTED;
|
||||||
|
|
||||||
|
#if SHIP_LANDING_ENABLED
|
||||||
|
case MAV_CMD_DO_FOLLOW:
|
||||||
|
// param1: sysid of target to follow
|
||||||
|
if ((packet.param1 > 0) && (packet.param1 <= 255)) {
|
||||||
|
plane.g2.follow.set_target_sysid((uint8_t)packet.param1);
|
||||||
|
return MAV_RESULT_ACCEPTED;
|
||||||
|
}
|
||||||
|
return MAV_RESULT_FAILED;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return GCS_MAVLINK::handle_command_long_packet(packet);
|
return GCS_MAVLINK::handle_command_long_packet(packet);
|
||||||
}
|
}
|
||||||
|
@ -1229,6 +1229,12 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
|
|||||||
// @User: Advanced
|
// @User: Advanced
|
||||||
// @Bitmask: 0: Servo 1, 1: Servo 2, 2: Servo 3, 3: Servo 4, 4: Servo 5, 5: Servo 6, 6: Servo 7, 7: Servo 8, 8: Servo 9, 9: Servo 10, 10: Servo 11, 11: Servo 12, 12: Servo 13, 13: Servo 14, 14: Servo 15
|
// @Bitmask: 0: Servo 1, 1: Servo 2, 2: Servo 3, 3: Servo 4, 4: Servo 5, 5: Servo 6, 6: Servo 7, 7: Servo 8, 8: Servo 9, 9: Servo 10, 10: Servo 11, 11: Servo 12, 12: Servo 13, 13: Servo 14, 14: Servo 15
|
||||||
AP_GROUPINFO("ONESHOT_MASK", 32, ParametersG2, oneshot_mask, 0),
|
AP_GROUPINFO("ONESHOT_MASK", 32, ParametersG2, oneshot_mask, 0),
|
||||||
|
|
||||||
|
#if SHIP_LANDING_ENABLED
|
||||||
|
// @Group: FOLL
|
||||||
|
// @Path: ../libraries/AP_Follow/AP_Follow.cpp
|
||||||
|
AP_SUBGROUPINFO(follow, "FOLL", 33, ParametersG2, AP_Follow),
|
||||||
|
#endif
|
||||||
|
|
||||||
AP_GROUPEND
|
AP_GROUPEND
|
||||||
};
|
};
|
||||||
|
@ -545,6 +545,9 @@ public:
|
|||||||
AC_PID guidedHeading{5000.0, 0.0, 0.0, 0 , 10.0, 5.0, 5.0 , 5.0 , 0.2};
|
AC_PID guidedHeading{5000.0, 0.0, 0.0, 0 , 10.0, 5.0, 5.0 , 5.0 , 0.2};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if SHIP_LANDING_ENABLED
|
||||||
|
AP_Follow follow;
|
||||||
|
#endif
|
||||||
|
|
||||||
AP_Float fs_ekf_thresh;
|
AP_Float fs_ekf_thresh;
|
||||||
|
|
||||||
|
@ -82,6 +82,7 @@
|
|||||||
#include <AP_Gripper/AP_Gripper.h>
|
#include <AP_Gripper/AP_Gripper.h>
|
||||||
#include <AP_Landing/AP_Landing.h>
|
#include <AP_Landing/AP_Landing.h>
|
||||||
#include <AP_LandingGear/AP_LandingGear.h> // Landing Gear library
|
#include <AP_LandingGear/AP_LandingGear.h> // Landing Gear library
|
||||||
|
#include <AP_Follow/AP_Follow.h>
|
||||||
|
|
||||||
#include "GCS_Mavlink.h"
|
#include "GCS_Mavlink.h"
|
||||||
#include "GCS_Plane.h"
|
#include "GCS_Plane.h"
|
||||||
|
@ -29,6 +29,7 @@ def build(bld):
|
|||||||
'AP_OSD',
|
'AP_OSD',
|
||||||
'AC_AutoTune',
|
'AC_AutoTune',
|
||||||
'AP_KDECAN',
|
'AP_KDECAN',
|
||||||
|
'AP_Follow',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user