Skip to content
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

Rover: add reverse rc option #27427

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Rover/RC_Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void RC_Channel_Rover::init_aux_function(const AUX_FUNC ch_option, const AuxSwit
case AUX_FUNC::SMART_RTL:
case AUX_FUNC::STEERING:
case AUX_FUNC::WIND_VANE_DIR_OFSSET:
case AUX_FUNC::REVERSE:
break;
case AUX_FUNC::SAILBOAT_MOTOR_3POS:
do_aux_function_sailboat_motor_3pos(ch_flag);
Expand Down Expand Up @@ -251,6 +252,21 @@ bool RC_Channel_Rover::do_aux_function(const AUX_FUNC ch_option, const AuxSwitch
gcs().send_text(MAV_SEVERITY_CRITICAL, "Steering trim saved!");
}
break;

// rover reverse switching
case AUX_FUNC::REVERSE:
switch (ch_flag) {
case AuxSwitchPos::HIGH:
rover.g2.wp_nav.set_reversed(true);
break;
case AuxSwitchPos::MIDDLE:
// do nothing
break;
case AuxSwitchPos::LOW:
rover.g2.wp_nav.set_reversed(false);
break;
}
break;

// manual input, nothing to do
case AUX_FUNC::MAINSAIL:
Expand Down
1 change: 1 addition & 0 deletions libraries/RC_Channel/RC_Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ const AP_Param::GroupInfo RC_Channel::var_info[] = {
// @Values{Plane}: 176:Quadplane Fwd Throttle Override enable
// @Values{Copter, Rover, Plane, Blimp}: 177:Mount LRF enable
// @Values{Copter}: 178:FlightMode Pause/Resume
// @Values{Rover}: 179: Reverse
// @Values{Rover}: 201:Roll
// @Values{Rover}: 202:Pitch
// @Values{Rover}: 207:MainSail
Expand Down
6 changes: 3 additions & 3 deletions libraries/RC_Channel/RC_Channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ class RC_Channel {
CAMERA_IMAGE_TRACKING = 174, // camera image tracking
CAMERA_LENS = 175, // camera lens selection
VFWD_THR_OVERRIDE = 176, // force enabled VTOL forward throttle method
MOUNT_LRF_ENABLE = 177, // mount LRF enable/disable
FLIGHTMODE_PAUSE = 178, // e.g. pause movement towards waypoint

MOUNT_LRF_ENABLE = 177, // mount LRF enable/disable
FLIGHTMODE_PAUSE = 178, // e.g. pause movement towards waypoint
REVERSE = 179, // rover reverse

// inputs from 200 will eventually used to replace RCMAP
ROLL = 201, // roll input
Expand Down
Loading