Skip to content

Commit

Permalink
set_target_location for loiter and guided modes
Browse files Browse the repository at this point in the history
  • Loading branch information
KosmX committed Aug 22, 2023
1 parent de57df3 commit 6c17248
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ArduCopter/mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,7 @@ class ModeGuided : public Mode {
// IF false: climb_rate_cms_or_thrust represents climb_rate (cm/s)
void set_angle(const Quaternion &attitude_quat, const Vector3f &ang_vel, float climb_rate_cms_or_thrust, bool use_thrust);

bool set_target_location(const Location& dest_loc) override { return set_destination(dest_loc); }
bool set_destination(const Vector3f& destination, bool use_yaw = false, float yaw_cd = 0.0, bool use_yaw_rate = false, float yaw_rate_cds = 0.0, bool yaw_relative = false, bool terrain_alt = false);
bool set_destination(const Location& dest_loc, bool use_yaw = false, float yaw_cd = 0.0, bool use_yaw_rate = false, float yaw_rate_cds = 0.0, bool yaw_relative = false);
bool get_wp(Location &loc) const override;
Expand Down Expand Up @@ -1191,6 +1192,7 @@ class ModeLoiter : public Mode {

#if AC_PRECLAND_ENABLED
void set_precision_loiter_enabled(bool value) { _precision_loiter_enabled = value; }
bool set_target_location(const Location& location) override;
#endif

protected:
Expand Down
9 changes: 9 additions & 0 deletions ArduCopter/mode_loiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,13 @@ int32_t ModeLoiter::wp_bearing() const
return loiter_nav->get_bearing_to_target();
}

#if AC_PRECLAND_ENABLED

bool ModeLoiter::set_target_location(const Location& location)
{
return copter.precland.set_target_location(location);
}

#endif

#endif

0 comments on commit 6c17248

Please sign in to comment.