failsafe requires RC connection loss AND computer connection loss #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@robpneu , please take a look at this and give me a call sometime so we can talk about it.
ROSflight goes into failsafe mode if there is no ppm signal for 40 milliseconds OR there is a ppm value below 900 or above 2100. I suggest we also setup our R9 module to output a pwm on all channels less than 900 in the event of an RC connection loss.
That can be found in rc.cpp, in check_rc_lost(). It can be adjusted there too.
The failsafe means that the Status message indicates if this failsafe is set.
It also means that the x, y, z, and F (servo and motor commands) will follow a different procedure.
That procedure is determined in command_manager.cpp in run(). Currently if the failsafe is tripped it defaults to a specific failsafe command. For Fixedwing vehicles it is just trim, ailerons = 0, elevator = 0, throttle = 0, etc.
The command_manager knows if there is a computer talking to it and also if there is an RC talking to it.
I propose that if the computer doesn't respond for 100 milliseconds AND RC connection is lost or out of the 900 - 2100 range, then the trim failsafe kicks in. Otherwise it listens to the RC and computer like normal. This should work because ROSplane is always outputing what it should if ROS were in control, but ROSflight decides whether to listen to the RC or ROS for the right command to send to the servos and motors.