-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
Plane: allow for different orientations for landing rangefinder #28014
Conversation
I do have a PR for this #20074 (it does need a rebase). That automatically selects the rangefinder closest to down for the current attitude. The potential problem there is that it will switch in flight. Would the new set HAGL command work here too? It just seems a bit mad that we need a parameter to tell us which way down is. In the longer term I would like to use all rangefinders all the time using a average with weighting bases on how close to down they are. |
646dcce
to
fd8df27
Compare
it also doesn't support custom orientations which I think will be useful on some vehicles. The switching in flight issue I think is a real problem, especially with the code we have for starting the use of a rangefinder. |
ArduPlane/Parameters.cpp
Outdated
// @Param: RNGFND_LND_ORNT | ||
// @DisplayName: rangefinder landing orientation | ||
// @Description: The orientation of rangefinder to use for landing detection. Should be set to Down for normal downward facing rangefinder and Back for rearward facing rangefinder for quadplane tailsitters. Custom orientation can be used with Custom1 or Custom2. The orientation must match at least one of the available rangefinders. | ||
// @Values: 12:Back, 25:Down, 101:Custom1, 102:Custom2 |
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.
Note that the rangefinder orient param does not list custom 1 and custom 2 as valid values.
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.
In fact it also gives 4: Back
. Here you have 12: Back
. One is ROTATION_YAW_180
and the other ROTATION_PITCH_180
. For a rangefinder it amounts to the same, but this should match the rangefinder params so selecting "Back" for both works as expected.
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.
the problem with using YAW_180 is the special handling of the yaw values in Aircraft::perpendicular_distance_to_rangefinder_surface() in SITL - YAW_180 is assumed to be a proximity sensor, so if you use YAW_180 you can't test in SITL
Using YAW_180 will work on a real aircraft, just not SITL
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.
@peterbarker looks like you added the special handling for the YAW values in SIM_Aircraft::perpendicular_distance_to_rangefinder_surface() ? does it really need to be that way or can we have some other way to hack in the proximity sensors?
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.
The problem is that the GCS may just give a drop down not the value, so if the user selects "Back" both this and the rangefinder orient it won't work. Maybe you could add "SITL back", or just don't have that case in the values, its not in the values for rangefinder either.
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.
unless we change that hack in SITL then we can't use YAW180 and make it testable in SITL
we could make the AP_RangeFinder library use pitch180 instead?
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.
I'm only talking about the @values
, the two "Backs" must be the same (4). You can still use a value that is not listed for in SITL and it should work fine. You were already having to set a value not in the @Values
for the rangefinder, you will just have to do that too for the new param.
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.
we can change the meaning of "Back" in the rangefinder library to be 12, but I'd like to discuss that on the call
or we could rename "4: Back" to "4: Back(Yaw180)" in the rangefinder library and add "12: Back" there
6885df6
to
025ee96
Compare
025ee96
to
24f9d10
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.
LGTM
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.
Just need to change the default, looks good apart from that.
24f9d10
to
b804991
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.
Looks good.
Whoops. Killed the Rover RangeFinder test - we also use those posts in Europe to test Rover's horizontalk rangefinder, and that seems to be busted. |
b804991
to
324caf6
Compare
I've fixed it up |
allows for quadplane tailsitter rangefinders
this is principally for tailsitters where rangefinders would be orientation with RNGFND1_ORIENT=12 (PITCH_180), but also allows for custom orientations which will be useful if the rangefinder is tilted forward
test rearward rangefinder
324caf6
to
8a67cba
Compare
this is principally for tailsitters where rangefinders would be orientation with RNGFND1_ORIENT=12 (PITCH_180), but also allows for custom orientations which will be useful if the rangefinder is tilted forward
Tested in SITL using the quadplane-copter_tailsitter frame