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
Move disabling of rc overrides up to RC_Channel base class #9275
Changes from all commits
fad8604
834a23f
2a500ed
645de36
e32a330
fb72b15
9bd1cd9
2a0f7bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -600,6 +600,9 @@ def test_rc_overrides(self): | |
self.context_push(); | ||
ex = None | ||
try: | ||
self.set_parameter("RC12_OPTION", 46) | ||
self.reboot_sitl() | ||
|
||
self.mavproxy.send('switch 6\n') # Manual mode | ||
self.wait_mode('MANUAL') | ||
self.wait_ready_to_arm() | ||
|
@@ -609,8 +612,12 @@ def test_rc_overrides(self): | |
normal_rc_throttle = 1700 | ||
self.mavproxy.send('rc 3 %u\n' % normal_rc_throttle) | ||
self.wait_groundspeed(5, 100) | ||
# now override to go backwards: | ||
throttle_override = 1400 | ||
|
||
# allow overrides: | ||
self.set_rc(12, 2000) | ||
|
||
# now override to stop: | ||
throttle_override = 1500 | ||
while True: | ||
print("Sending throttle of %u" % (throttle_override,)) | ||
self.mav.mav.rc_channels_override_send( | ||
|
@@ -625,11 +632,42 @@ def test_rc_overrides(self): | |
65535, # chan7_raw | ||
65535) # chan8_raw | ||
|
||
m = self.mav.recv_match(type='VFR_HUD', blocking=True) | ||
want_speed = 2.0 | ||
print("Speed=%f want=<%f" % (m.groundspeed, want_speed)) | ||
if m.groundspeed < want_speed: | ||
break | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't it make more sense to compare the actual PWM value like was done before? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The subsequent test is checking the vehicle's speed, so this is consistent. |
||
|
||
m = self.mav.recv_match(type='RC_CHANNELS_RAW', blocking=True) | ||
print("%s" % m) | ||
if m.chan3_raw == throttle_override: | ||
# now override to stop - but set the switch on the RC | ||
# transmitter to deny overrides; this should send the | ||
# speed back up to 5 metres/second: | ||
self.set_rc(12, 1000) | ||
|
||
throttle_override = 1500 | ||
while True: | ||
print("Sending throttle of %u" % (throttle_override,)) | ||
self.mav.mav.rc_channels_override_send( | ||
1, # target system | ||
1, # targe component | ||
65535, # chan1_raw | ||
65535, # chan2_raw | ||
throttle_override, # chan3_raw | ||
65535, # chan4_raw | ||
65535, # chan5_raw | ||
65535, # chan6_raw | ||
65535, # chan7_raw | ||
65535) # chan8_raw | ||
|
||
m = self.mav.recv_match(type='VFR_HUD', blocking=True) | ||
want_speed = 5.0 | ||
print("Speed=%f want=>%f" % (m.groundspeed, want_speed)) | ||
|
||
if m.groundspeed > want_speed: | ||
break | ||
|
||
# re-enable RC overrides | ||
self.set_rc(12, 2000) | ||
|
||
# check we revert to normal RC inputs when gcs overrides cease: | ||
self.progress("Waiting for RC to revert to normal RC input") | ||
while True: | ||
|
@@ -643,6 +681,7 @@ def test_rc_overrides(self): | |
ex = e | ||
|
||
self.context_pop(); | ||
self.reboot_sitl() | ||
|
||
if ex is not None: | ||
raise ex | ||
|
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 want more of these comments in our code! 🤣