New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AC_Avoid: add and use AC_AVOID_ENABLED #24624
base: master
Are you sure you want to change the base?
Conversation
8fecb51
to
730fc33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, but the size-checks highlight the fact we've lost the pathplanning on Rover 1MB boards, and there's actually not much that can be done to fix that problem. Let's see what people say about that problem before trying to do anything about it.
.
Rover/GCS_Mavlink.cpp
Outdated
@@ -378,6 +378,7 @@ bool GCS_MAVLINK_Rover::try_send_message(enum ap_message id) | |||
rover.g2.windvane.send_wind(chan); | |||
break; | |||
|
|||
#if AC_OAPATHPLANNER_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#if AC_OAPATHPLANNER_ENABLED | |
#if AP_OAPATHPLANNER_ENABLED |
... and elswhere likewise. The fact we're using this in Rover means a new define should work like this.
AC_AVOID
is more complicated given we also have AP_Avoidance
which is a different sort of avoidance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
@@ -88,7 +88,7 @@ bool AP_Proximity_Backend::ignore_reading(float pitch, float yaw, float distance | |||
// returns true if database is ready to be pushed to and all cached data is ready | |||
bool AP_Proximity_Backend::database_prepare_for_push(Vector3f ¤t_pos, Matrix3f &body_to_ned) | |||
{ | |||
#if !APM_BUILD_TYPE(APM_BUILD_AP_Periph) | |||
#if AC_OAPATHPLANNER_ENABLED && !APM_BUILD_TYPE(APM_BUILD_AP_Periph) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#if AC_OAPATHPLANNER_ENABLED && !APM_BUILD_TYPE(APM_BUILD_AP_Periph) | |
#if AC_OAPATHPLANNER_ENABLED |
set AC_OAPATHPLANNER_ENABLED
to zero in defaults_periph.h
Similarly elsewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
730fc33
to
fa625f1
Compare
fa625f1
to
f471d5d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit list needs fixing
3188a37
to
a92b389
Compare
ArduCopter/APM_Config.h
Outdated
//#define AC_OAPATHPLANNER_ENABLED DISABLED // disable path planning around obstacles | ||
//#define AP_OAPATHPLANNER_ENABLED DISABLED // disable path planning around obstacles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should just remove it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks.
ArduCopter/AP_Arming.cpp
Outdated
@@ -305,7 +305,7 @@ bool AP_Arming_Copter::parameter_checks(bool display_failure) | |||
|
|||
bool AP_Arming_Copter::oa_checks(bool display_failure) | |||
{ | |||
#if AC_OAPATHPLANNER_ENABLED == ENABLED | |||
#if AP_OAPATHPLANNER_ENABLED == ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#if AP_OAPATHPLANNER_ENABLED == ENABLED | |
#if AP_OAPATHPLANNER_ENABLED |
similarly elsewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
#ifndef AC_OAPATHPLANNER_ENABLED | ||
#define AC_OAPATHPLANNER_ENABLED ENABLED | ||
#endif | ||
|
||
#if MODE_FOLLOW_ENABLED && !AC_AVOID_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer true, is it?
Have you tested mode-follow with AC_AVOID disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was pre-existing and I have no idea if it is needed (haven't looked into follow mode code). Hence, I decided not to touch it at least in this PR.
@@ -58,8 +59,9 @@ void AP_OADijkstra::Write_Visgraph_point(const uint8_t version, const uint8_t po | |||
}; | |||
AP::logger().WriteBlock(&pkt, sizeof(pkt)); | |||
} | |||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#endif | |
#endif // AP_OAPATHPLANNER_ENABLED |
similarly anywhere else the excluded code is more than a few lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -13,6 +13,10 @@ | |||
along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
*/ | |||
|
|||
#include "AC_Avoid_config.h" | |||
|
|||
#if AP_OAPATHPLANNER_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#if AP_OAPATHPLANNER_ENABLED | |
#if AP_OAPATHPLANNER_BENDYRULER_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -13,6 +13,10 @@ | |||
along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
*/ | |||
|
|||
#include "AC_Avoid_config.h" | |||
|
|||
#if AP_OAPATHPLANNER_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#if AP_OAPATHPLANNER_ENABLED | |
#if AP_OAPATHPLANNER_DIJKSTRA_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
#ifndef AP_OAPATHPLANNER_ENABLED | ||
#define AP_OAPATHPLANNER_ENABLED AC_AVOID_ENABLED | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#endif | |
#endif | |
#ifndef AP_OAPATHPLANNER_BACKEND_DEFAULT_ENABLED | |
#define AP_OAPATHPLANNER_BACKEND_DEFAULT_ENABLED AP_OAPATHPLANNER_ENABLED | |
#endif | |
#ifndef AP_OAPATHPLANNER_BENDYRULER_ENABLED | |
#define AP_OATHPATHPLANNER_BENDYRULER_ENABLED AP_OAPATHPLANNER_BACKEND_DEFAULT_ENABLED | |
#endif | |
... and dijkstra too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks.
@@ -3,6 +3,7 @@ | |||
#include "AP_OABendyRuler.h" | |||
#include <AP_Logger/AP_Logger.h> | |||
|
|||
#if AP_OAPATHPLANNER_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#if AP_OAPATHPLANNER_ENABLED | |
#if AP_OAPATHPLANNER_ENABLED && HAL_LOGGING_ENABLED |
... elsewhere too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ummm... Can we do it in another PR? If we do this here, then we need to compile out the declarations of these methods from .h
files and the places we are calling these methods based on #if HAL_LOGGING_ENABLED
. Shouldn't all that go into a separate PR?
libraries/AC_WPNav/AC_WPNav_OA.cpp
Outdated
#include <AC_Avoidance/AC_Avoid_config.h> | ||
|
||
#if AP_OAPATHPLANNER_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include <AC_Avoidance/AC_Avoid_config.h> | |
#if AP_OAPATHPLANNER_ENABLED | |
#include "AC_WPNav_config.h" | |
#if AC_WPNAV_OBJECTAVOIDANCE_ENABLED |
... and define it based on AC_OAPATHPLANNER_ENABLED by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks.
a92b389
to
adafe98
Compare
adafe98
to
b4f90e9
Compare
b4f90e9
to
0177c05
Compare
This creates AC_Avoid_config.h and moves AC_AVOID_ENABLED from copter's config.h to that file. Also uses AC_AVOID_ENABLED around the code related to AC_Avoid.