ArduPilot / ArduPilot/MAVProxy

Error in Modules/mavproxy_arm.py handling ICE_START_CHAN=0 on arm and disarm

Open
#878 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
595
Forks
773
Avg merge
2d 6h
Merged PRs (30d)
18

Description

The documentation within AP_ICEngine.cpp states that a value of 0 corresponds to "None" for the ICE_START_CHAN, and thus should be valid but effectively treat the "start" channel as always being the middle value.
mavproxy_arm.py throws the following error when you arm or disarm with ICE_START_CHAN set to 0:
`Got MAVLink msg: COMMAND_ACK {command : 400, result : 0}
DISARMED
Traceback (most recent call last):
File "MAVProxy\modules\mavproxy_link.py", line 625, in master_callback
File "MAVProxy\modules\mavproxy_arm.py", line 168, in mavlink_packet
AttributeError: 'MAVLink_rc_channels_message' object has no attribute 'chan0_raw'`

The code in questions is from line 208 onwards:
```
if ice_enable == 1:
rc = self.master.messages["RC_CHANNELS"]
v = self.mav_param.get('ICE_START_CHAN', None)
if v is None:
return
v = getattr(rc, 'chan%u_raw' % v)
if v <= 1300:
self.say("ICE Disabled")
```

I think in addition to the check for "None", it should also check for v=0 and return, rather than trying to read "chan0u_raw".

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in Modules/mavproxy_arm.py around line 208, where mavlink_packet reads ICE_START_CHAN and accesses the RC_CHANNELS message. Reproduce arming or disarming with ICE_START_CHAN set to 0, then verify the handling no longer attempts to access chan0_raw and completes without the reported AttributeError while retaining the existing None behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.