I am hoping someone can help me with this. I am running a python script to fly my plane. When the plane is in auto mode I want to momentarily do a do set servo command on the AL and have the plane roll left roll right.
The problem I have know is I am getting Chanel 1 is in use already. This make sense because the ailerons are being used steer the plane. I hope there is a simple way to momentarily override it.
I am hoping someone can help me with this. I am running a python script to
fly my plane. When the plane is in auto mode I want to momentarily do a do
set servo command on the AL and have the plane roll left roll right.
OK, yes, you’re crazy
The problem I have know is I am getting Chanel 1 is in use already. This
make sense because the ailerons are being used steer the plane. I hope there
is a simple way to momentarily override it.
You could use stick-mixing instead; provide RC input to move the servos
using the rc override messages.
What you should probably be doing, however, is putting the Plane into
guided mode and pushing it around in there.
The mavlink set_attitude_target message is what you’re probably after.
Here are the autotests for that feature:
Peter so I looked at the link you posted. I assume you are pointing me use mavproxy.send???
Mabey not but if so can I use it out of the sim??
Peter I get this part:
Without looking too closely, 1000pwm should be output when at or
below the RCn_MIN parameter and 2000pwm when at or above RCn_MAX. Linear
in-between. At a guess Tell me if I’m wrong and I’ll dig.
I don’t know what version of plane you are trying to use, but we reject attempts to DO_SET_SERVO to any servo channel that has a function assigned in master, and we are planning to maintain this behavior which means even if you get it to work now, it will be broken on you on the next stable release.
You may want to look into the MANUAL_CONTROL message instead. If you use channel override you are responsible for figuring out how to map that within each input channel’s calibrated min/max value. Manual control allows you to use a normalized control value and the autopilot will manage the mapping for you. (Just beware that the throttle mapping behavior is inconsistent between copter/rover/plane/sub)
Okay, thanks for the input
Do you all know were I can find an example of creating an attribute that is setable for this manual_ control mavlink?
I see there is one for reading the RawIMU but not to make setabule like airspeed and overided.
So by master you mean we cant DO_SET_SERVO to any AETR channel? Here I am trying to control the elevator in arduplane 3.10 in manual mode and the print screen below shows what I am getting.
Can you point me in the right direction as to what code is preventing me from writing to it.
Back to the Manual control stuff
I think what would work best for my situation is to have the plane in CRUISE mode and give it manual control inputs. All I need is for the plane to fly at a constant airspeed and altitude for about 10 seconds while a roll maneuver is performed.
If I did it like this would I still run into the channel already in use error?
It sounds like you might want to look into the SET_ATTITUDE_TARGET message. On Plane when in guided mode you can send this to selectively set the roll/pitch/yaw of the aircraft which is probably the best solution.
Otherwise you can explore the stick mixing option @peterbarker indicated, but I suspect you will always get slightly weird results from it, as it will trying to mix your stick inputs vs the autopilot outputs which can be a bit messy. (I’m personally a detractor to stick mixing so I’m probably not the one to sell you on it/know how well it will work for your use case).