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

dhruvak001/issue26892 #27417

Closed
wants to merge 5 commits into from
Closed
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
14 changes: 13 additions & 1 deletion libraries/AP_Mount/AP_Mount_Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,22 @@ bool AP_Mount_Backend::valid_mode(MAV_MOUNT_MODE mode) const

bool AP_Mount_Backend::set_mode(MAV_MOUNT_MODE mode)
{
if (!valid_mode(mode)) {
// Add a check for the new mode
if (!valid_mode(mode) && mode != MAV_MOUNT_MODE_TOGGLE_RC) {
return false;
}

_mode = mode;

// handle the toggle mode
if (_mode == MAV_MOUNT_MODE_TOGGLE_RC) {
if (_mode == MAV_MOUNT_MODE_RC_TARGETING) {
_mode = MAV_MOUNT_MODE_NEUTRAL;
} else {
_mode = MAV_MOUNT_MODE_RC_TARGETING;
}
}

return true;
}

Expand Down
12 changes: 10 additions & 2 deletions libraries/AP_Mount/AP_Mount_Servo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ void AP_Mount_Servo::update()
break;
}

case MAV_MOUNT_MODE_TOGGLE_RC: {
if (_mode == MAV_MOUNT_MODE_RC_TARGETING) {
set_mode(MAV_MOUNT_MODE_NEUTRAL);
} else {
set_mode(MAV_MOUNT_MODE_RC_TARGETING);
}
break;
}

// move mount to a neutral position, typically pointing forward
case MAV_MOUNT_MODE_NEUTRAL: {
_angle_bf_output_rad = _params.neutral_angles.get() * DEG_TO_RAD;
Expand Down Expand Up @@ -102,8 +111,7 @@ void AP_Mount_Servo::update()
update_angle_target_from_rate(mnt_target.rate_rads, mnt_target.angle_rad);
FALLTHROUGH;
case MountTargetType::ANGLE:
// update _angle_bf_output_rad based on angle target
if ((mount_mode != MAV_MOUNT_MODE_RETRACT) & (mount_mode != MAV_MOUNT_MODE_NEUTRAL)) {
if ((mount_mode != MAV_MOUNT_MODE_RETRACT) && (mount_mode != MAV_MOUNT_MODE_NEUTRAL)) {
update_angle_outputs(mnt_target.angle_rad);
}
break;
Expand Down
2 changes: 1 addition & 1 deletion modules/ChibiOS
Submodule ChibiOS updated 0 files
2 changes: 1 addition & 1 deletion modules/CrashDebug
2 changes: 1 addition & 1 deletion modules/DroneCAN/pydronecan
2 changes: 1 addition & 1 deletion modules/gbenchmark
Submodule gbenchmark updated 139 files
2 changes: 1 addition & 1 deletion modules/gtest
Submodule gtest updated 372 files
2 changes: 1 addition & 1 deletion modules/lwip
Submodule lwip updated 82 files
+1 −1 .github/workflows/ci-linux.yml
+7 −0 .gitignore
+5 −0 CHANGELOG
+3 −1 codespell_check.sh
+36 −4 contrib/apps/ping/ping.c
+1 −0 contrib/apps/ping/ping.h
+2 −2 contrib/examples/example_app/lwipopts.h
+1 −0 contrib/examples/mqtt/mqtt_example.c
+1 −0 contrib/examples/tftp/tftp_example.c
+5 −6 contrib/ports/unix/lib/lwipopts.h
+1 −1 contrib/ports/unix/posixlib/CMakeLists.txt
+1 −1 contrib/ports/unix/posixlib/include/posix/sockets.h
+4 −0 contrib/ports/win32/include/arch/cc.h
+57 −0 contrib/ports/win32/msvc/libcheck.vcxproj
+447 −0 contrib/ports/win32/msvc/lwIP.vcxproj
+22 −2 contrib/ports/win32/msvc/lwIP_Test.sln
+114 −2 contrib/ports/win32/msvc/lwIP_Test.vcxproj
+78 −0 contrib/ports/win32/msvc/lwIP_fuzz.sln
+79 −2 contrib/ports/win32/msvc/lwIP_pcapif.vcxproj
+21 −2 contrib/ports/win32/msvc/lwIP_unittests.sln
+476 −0 contrib/ports/win32/msvc/lwip_fuzz.vcxproj
+72 −0 contrib/ports/win32/msvc/lwip_unittests.vcxproj
+74 −2 contrib/ports/win32/msvc/makefsdata.vcxproj
+7 −2 contrib/ports/win32/pcapif.c
+1 −1 contrib/ports/win32/pcapif_helper.c
+1 −1 doc/doxygen/lwip.Doxyfile
+2 −2 src/Filelists.cmake
+1 −1 src/api/netdb.c
+86 −47 src/api/sockets.c
+1 −1 src/api/tcpip.c
+13 −4 src/apps/altcp_tls/altcp_tls_mbedtls.c
+34 −22 src/apps/http/http_client.c
+32 −18 src/apps/http/httpd.c
+4 −0 src/apps/http/makefsdata/makefsdata.c
+11 −4 src/apps/http/makefsdata/tinydir.h
+1 −1 src/apps/lwiperf/lwiperf.c
+1 −1 src/apps/mdns/mdns.c
+11 −4 src/apps/mqtt/mqtt.c
+1 −1 src/apps/netbiosns/netbiosns.c
+1 −1 src/apps/smtp/smtp.c
+1 −1 src/apps/snmp/snmp_core.c
+1 −1 src/apps/snmp/snmp_msg.c
+2 −1 src/apps/sntp/sntp.c
+1 −1 src/apps/tftp/tftp.c
+23 −0 src/core/def.c
+5 −2 src/core/init.c
+1 −1 src/core/ipv4/acd.c
+1 −1 src/core/ipv4/dhcp.c
+1 −0 src/core/ipv4/icmp.c
+2 −1 src/core/ipv6/ip6.c
+15 −1 src/core/ipv6/ip6_frag.c
+3 −3 src/core/ipv6/nd6.c
+11 −24 src/core/mem.c
+1 −1 src/core/netif.c
+16 −7 src/core/pbuf.c
+12 −2 src/core/tcp_in.c
+4 −1 src/core/tcp_out.c
+1 −1 src/core/udp.c
+2 −2 src/include/lwip/apps/http_client.h
+2 −0 src/include/lwip/apps/mqtt.h
+2 −2 src/include/lwip/apps/sntp_opts.h
+1 −1 src/include/lwip/arch.h
+10 −0 src/include/lwip/def.h
+2 −2 src/include/lwip/init.h
+1 −1 src/include/lwip/mem.h
+35 −5 src/include/lwip/opt.h
+1 −0 src/include/lwip/prot/nd6.h
+1 −1 src/include/lwip/snmp.h
+4 −1 src/include/lwip/stats.h
+1 −1 src/include/netif/ppp/pppoe.h
+1 −1 src/include/netif/ppp/vj.h
+2 −2 src/netif/ppp/auth.c
+3 −2 src/netif/ppp/fsm.c
+1 −1 src/netif/ppp/lcp.c
+6 −4 test/fuzz/fuzz_common.c
+1 −1 test/unit/api/test_sockets.c
+90 −1 test/unit/ip6/test_ip6.c
+6 −0 test/unit/lwip_unittests.c
+24 −1 test/unit/lwipopts.h
+1 −1 test/unit/mqtt/test_mqtt.c
+1 −1 test/unit/tcp/test_tcp.c
+2 −2 test/unit/tcp/test_tcp_oos.c
2 changes: 1 addition & 1 deletion modules/mavlink
Loading