commands_logic.cpp: In member function 'bool
Copter::verify_within_distance()':
commands_logic.cpp:770:21: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
if (wp_distance < MAX(condition_value,0)) {
^
The problem with using min() and max() is that they conflict with some
C++ headers. Name the macros in uppercase instead. We may go case by
case later converting them to be typesafe.
Changes generated with:
git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)max(/\1MAX(/g'
git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)min(/\1MIN(/g'
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.
This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.
AVR-specific places were not changed.
- abstracted verify_command so that command-wide actions can happen more cleanly, namely mission_item_reached
- This also brings the structure in line with plane and rover
Also add log_picture to separate logging and feedback from
the do_take_picture function so that it can be used when pictures
are triggered from a mission command
initialise mount on startup
use Mount::has_pan_control method
Remove calls to unimplemented mount.configure_cmd
Remove call to update_mount_type which will be handled from within mount
lib
Use default position when waypoint lat/lon are zero,
and default altitude when waypoint alt is zero, for
both spline and straight-line waypoints.
Fixes#1145.
Fix#1068. When receiving guided waypoints do not change to GUIDED mode. This serves as a safety precaution for GCS, since they must switch to guided mode before sending the waypoints.
waypoint command was setting auto_yaw_mode when it was run after the
do-cmd
yaw_look_at_heading was being set to current heading which was
overwriting the caller's desired heading