-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
Add support for docking clamps, including automated Copter release #27343
base: master
Are you sure you want to change the base?
Conversation
b03b09e
to
b1d20bf
Compare
Is the option bit really needed? |
@@ -142,6 +143,9 @@ void SRV_Channel::aux_servo_function_setup(void) | |||
case k_egg_drop: | |||
set_range(100); | |||
break; | |||
#if AP_TIE_DOWN_CLAMPS_ENABLED | |||
case k_tie_down_release: |
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.
my preference for new options would be to set the range to 1.0, its a float now so the value doesn't matter. Eventually I would like to move everything to 0 -> 1 or -1 -> 1
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.
you could also call set_range
from landing gear of course, that would remove the need this change.
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 and done
This does feel like it might be more of a scripting feature. We do have |
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.
needs to update Parameters.cpp also
I agree with @IamPete1, it's so simple that it seems like it could be handled in scripting. I suspect the reason that scripting isn't being used because scripts are a bit more difficult to deploy. If that's the reason then perhaps we should investigate how we could make deploying scripts easier. |
was grabbing vehicle out of mid-air, which is interestin
b1d20bf
to
0bd4d55
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.
still needs FLIGHT_OPTIONS metadata addition
0bd4d55
to
2d93ee4
Compare
Added metadata. |
@@ -1000,7 +1000,7 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { | |||
// @Param: FLIGHT_OPTIONS | |||
// @DisplayName: Flight mode options | |||
// @Description: Flight mode specific options | |||
// @Bitmask: 0:Disable thrust loss check, 1:Disable yaw imbalance warning, 2:Release gripper on thrust loss, 3:Require position for arming | |||
// @Bitmask: 0:Disable thrust loss check, 1:Disable yaw imbalance warning, 2:Release gripper on thrust loss, 3:Require position for arming, 4:Enable automated docking clamp release |
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 think we could simplify this by removing the FLIGHT_OPTIONS bit and just enable the feature if the user defines the SERVOx_FUNCTION.
@@ -54,6 +54,11 @@ void Mode::_TakeOff::start(float alt_cm) | |||
_running = true; | |||
take_off_start_alt = copter.pos_control->get_pos_target_z_cm(); | |||
take_off_complete_alt = take_off_start_alt + alt_cm; | |||
#if AP_TIE_DOWN_CLAMPS_ENABLED | |||
if (copter.option_is_enabled(Copter::FlightOption::TAKEOFF_TIEDOWN_RELEASE)) { | |||
copter.landinggear.tie_down_release(); |
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.
How about moving this outside of landing gear. While the tie-down is perhaps physically on the landing gear I'm not sure it's too related is it?
@@ -1283,6 +1289,26 @@ bool RC_Channel::run_aux_function(AUX_FUNC ch_option, AuxSwitchPos pos, AuxFuncT | |||
return ret; | |||
} | |||
|
|||
#if AP_TIE_DOWN_CLAMPS_ENABLED | |||
void RC_Channel::do_aux_function_TIE_DOWN_RELEASE(const AuxSwitchPos ch_flag) |
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.
How do you feel about putting "TIE_DOWN_RELEASE" in lower case? It's a little shouty :-)
Re lua vs C++, I apparently said C++ was fine at some point (I have no memory) and so if it's OK with @IamPete1 and others, I think it's only fair that we allow it to be added to the c++. I suspect that the flash cost is low and if we did it as a script, I can imagine that adding access to the state takeoff state machine could require as much flash as the C++ equivalent. |
This work sponsored by FreeSpace.