mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 08:38:36 -04:00
Copter: follow return wp_distance and wp_bearing
This commit is contained in:
parent
528ed38ecf
commit
c8cbbb9246
@ -1235,6 +1235,8 @@ protected:
|
||||
|
||||
const char *name() const override { return "FOLLOW"; }
|
||||
const char *name4() const override { return "FOLL"; }
|
||||
uint32_t wp_distance() const override;
|
||||
int32_t wp_bearing() const override;
|
||||
|
||||
uint32_t last_log_ms; // system time of last time desired velocity was logging
|
||||
};
|
||||
|
@ -150,4 +150,14 @@ void Copter::ModeFollow::run()
|
||||
Copter::ModeGuided::run();
|
||||
}
|
||||
|
||||
uint32_t Copter::ModeFollow::wp_distance() const
|
||||
{
|
||||
return g2.follow.get_distance_to_target() * 100;
|
||||
}
|
||||
|
||||
int32_t Copter::ModeFollow::wp_bearing() const
|
||||
{
|
||||
return g2.follow.get_bearing_to_target() * 100;
|
||||
}
|
||||
|
||||
#endif // MODE_FOLLOW_ENABLED == ENABLED
|
||||
|
Loading…
Reference in New Issue
Block a user