Best way to control jaw using MavLink?

What is the best way to manipulate jaw of a quad using GCS via keyboard key presses? I do this currently via PID algorithm on GCS and rcoverrides. Is there a way to control jaw programmatically so that the result is relatively fixed and stable?

I was thinking something akin to on key down event to go to circle mode and on key release drop back to previous mode. Single press to change jaw by some given angle. Relevant modes are loiter and auto probably. I currently fly manually via keyboard in loiter so that arraws control movement forward/backward/side to side and wasd to control jaw and gimbal pitch. This is in loiter. Can this be done better in some other mode? IE guided?

Turn here with guided is quite nice and could possibly be used for turning the angle.

Hi Karl,

Do you mean yaw? You can use RC overrides as you have been doing. Guided is a mode to allow automatic control from a GCS so yes, you can control yaw in Guided mode. Now it all depends in what is available in the GCS you use - the behaviors you talk about (pressing keys to do specific things) probably aren’t available in any GCS but MAVLink certainly allows it.

Sorry, yes yaw. My GCS can fly like i mentioned but there is a problem that turning using PID in GCS results in overshooting and in badly tuned cases ocsillation. Furthermore it works for one quad frame and requires calibration if something changes. Problem if i want to swap payloads. Furthermore if i want to zoom in with my camera and then turn using the same keys it is somewhat difficult to scale the PID (minimum PWM is to big).

Current goal is code that is independent of quad frame (have all the PID handling on outopilot side) and can handle movement commands and be able to scale the movement based on zoom level. Me the pilot gets the same consistent control when looking at the video.

Problems with rcoverrides is that i run in to limit on how much the PWM can be changed. Can i perhaps get more accurate control of yaw using guided?

The problem with PWM is that changing PWM by 1 alters movement too much with high zoom levels. Could i acheve more in Guided? This might not be possible and seem bit backwards as i also have a gimbal for the camera. I use BaseCam`s controller for my gimbal. Does anyone happen to know if i could instead control Gimbals yaw and have the quad correct itself looking at the angles of both? Can i set the quad to automatically adjust its yaw if the relative angle between the gimbal and quad frame gets to big?

Hi Karl,

I missed the part where you said you were changing PID values to control the vehicle. That certainly isn’t the way to go. For RC overrides you might want to the check the new ACRO_Y_EXPO (despite the name, in 3.4.2 it applies to all modes), it might suit your needs.
Guided allows you to control the vehicle in a consistent way and you can set the exact yaw value you want. The issue with Guided is that it is intended for external control at all times. That means that you aren’t able to move the vehicle with your transmitter (or the RC overrides), only with MAVLink commands.

Hello, I’m pretty new to the Ardupilot but I’m also trying to control the drone using the keyboard,

AS I said I don’t understand much yet and right now I’m playing with a parrot bebop 2, at the moment I have managed to fly the bp2 using a keyboard but using JavaScript however the parrot’s firmware is very restrictive so I’m going to ditch it for the Ardupilot, Right now I don’t have a Joystick so I was wondering where are the overrides or if its possible to send commands to the drone using only the computer.

Oh i only just noticed that there is some confusion. I dont change any PID values to control the vehicle but rather on the GCS i have a PID loop that controls the RC overrides to control the yaw. Still not a great solution and will be changed to using guided mode somehow. I think you can have something like circle mode for for yaw changing through keyboard.

What im having trouble is with figuring out how to accomplish things like move forward and then turn yaw while flying forward resulting in an arc. Then releasing the turning still flying forward and applying other way turning resulting an S shap flying. Basically being able to use keyboard control to properly control the quad not just single commands.

Would be something like this:
A/D press down > start turning yaw at fixed speed
A/D release > stop turning yaw
Alternative would be to turn gimbal instead for finer control but then flying forward doesnt make sense.
W/S press and release work gimbal pitch as they do already for me.
Arrow key press and release > move quad in desired direction, release stops movement. Up and left arrow together need to move quad diagonally with same length vector.
Im pretty sure you can do the individual commands but combinations of keys being pressed together is bit iffy.

Another worry is RTL and land modes. Can i send guided commans while landing? As in do some manual corrections to the land location while landing?

@Mastuerso I currently have the GCS send RCoverride commands over mavlink to control the quad from keyboard. Essentially im simulating having a RC controller from software. It is not the smartest of things to do when there could be guided mode commands to cover my needs. I do this in loiter mode and also works on Land/RTL.

1 Like