MissionPlanner icon indicating copy to clipboard operation
MissionPlanner copied to clipboard

CameraGimbal: support JOY_DO_SET_SERVO

Open GrahamDyer opened this issue 12 years ago • 11 comments

We're trying to figure out how to cause the yaw axis of a gimbal to face forward or return to neutral at the push of a button.

There are options in the button assignment of the Joystick GUI that assigns a button to DO_SET_SERVO (JOY_DO_SET_SERVO) but none of these are functional and have no effect on any servo's or nor outputs.(see pic below)

JOY_DO_SET_SERVO parameter doesn't exist unless it's hidden in the MP somewhere.

As a side note, setting 'MNT_JSTICK_SPEED' to 0 (zero) causes both the tilt and pan axis' to center when the joystick sticks are released which is what we're after (but only on pan), however the movement of the servo's is then abrupt, jerky and at the full speed of the servo.

So getting the 'button > JOY_DO_SET_SERVO' to work seems the easiest solution, this way one can center the gimbal on any axis at any time negating the problem that the camera operator often has of not having a reference point of the airframe in the cameras view and thus is unable to know which way the camera is pointing.

joystick

GrahamDyer avatar Apr 03 '14 05:04 GrahamDyer

please post your param file

meee1 avatar Apr 03 '14 10:04 meee1

https://dl.dropboxusercontent.com/u/21460892/SuperSkySurfer_%231_v2.78_before_defaults.param

GrahamDyer avatar Apr 03 '14 10:04 GrahamDyer

do you have a tlog with your testing the function?

meee1 avatar Apr 07 '14 06:04 meee1

Well, the function framework is there as shown in the image above but it just does not work at all.

There is a really strong need to be able to reset the gimbal to it's neutral position, either with this function working or even to very temporarily set "mnt_jstick_speed" parameter to zero which would actually achieve the same thing.

When button 1 is activated servo no# 6 does not move to 900, there is in fact no response at all from any selected servo or output. Only the activation of the button is registered. There are certainly no parameters for any of those settings in the APM:Plane firmware.

A scenario while flying is as follows: if something is observed off to one side of a flight path and the gimbal rotated to observe that something, once past that something how does one get the gimbal to return to the center neutral point again with no part of the aircraft visible on the screen to resume searching. It's like a head tracker that you can never find the center position of.

Do you want a log of it not working? I'll do one tomorrow if it'll help?

GrahamDyer avatar Apr 08 '14 18:04 GrahamDyer

This will be a vital feature for those intending to use APM:Plane in the conservation challenge or anyone using the mission planner for camera control, they just don't know it yet.

I'll get a log and video as soon as I can.

GrahamDyer avatar Apr 27 '14 18:04 GrahamDyer

I think we should (and will) add support for MAV_CMD_DO_MOUNT_CONTROL and maybe MAV_CMD_DO_MOUNT_CONFIGURE. These are listed on the MAVLink page: https://pixhawk.ethz.ch/mavlink/

I think the do-mount-configure would allow changing the mode to neutral or retract. the do-mount-control allows setting the desired roll, pitch and yaw angles for the camera. I think using this for joystick control could lead to a very jumpy movement but maybe that would be the case no matter what message is used.

rmackay9 avatar Apr 28 '14 00:04 rmackay9

A further request for this to be fixed, pretty please :) No problem if the axis movement is jerky or fast, just that there is a way to center the gimbal with a button.

GrahamDyer avatar May 24 '14 18:05 GrahamDyer

Hi Michael, an update. I managed to get a few steps further with this but there a small but hopefully easily fixable hindrance to actually getting this working.

I've always been using A10 out (RC10_FUNCTION = 6) for pan, both on APM2.x and Pixhawk but this does not work as outlined above. (A10 actually equates to the Auxillary pin 3 on the Pixhawk).

If I however plug the pan servo from Aux 3 into CH7 on the Pixhawk and re-assign RC7_FUNCTION to 6 for pan then I have full control of pan from the joystick (set up previously).

I now set Button 1 on the joystick (in the image of the opening post above) to CH7 and it's PWM to 1500 but it appears that this output is being blocked by the output on RC7 from the joystick.

If I disable the RC7_FUNCTION and then press button 1 then the PWM is set to 1500 and the pan servo GOES to center which is exactly what we need! But it seems that the two aren't allowed simultaneously or CH7 has full priority?

So in my way of thinking what is needed to get this to work is to allow the PWM that is being sent from the DO_SET_SERVO command to set the PWM to it's listed value, in this case 1500 and then when the button is released to go back to getting the PWM values from the joystick starting at 1500.

Hopefully this would be an easy fix to finally get this working?

GrahamDyer avatar Jun 05 '14 15:06 GrahamDyer

Getting really desperate here!

Could a second button be set to change the Camera Gimbal setup's Pan RC7 to maybe RC6 temporarily so that the "set to 1500" command from the joystick button can be allowed to get through to the servo, not ideal but it's one way to get this to work?

  • Currently, the joystick stick outputs 1000us to 2000us for pan servo, works fine.
  • Assigning a joystick button to send 1500 to center the pan servo, works fine.

But the two just won't work AT THE SAME time!

Or the button JUST WON"T override the joy sticks output, here's hoping that this is a really simple fix?

GrahamDyer avatar Jun 18 '14 14:06 GrahamDyer

Graham, just trying to get my head around what you are trying to do. I have a few questions. Can I get a param file. so I can see how you have the tracking and stabalize setup on the gymbal. You are using a joystick, are you using a hud? or a analog axis?

meee1 avatar Sep 01 '14 13:09 meee1

Hi Michael, more on this here: https://groups.google.com/forum/#!msg/drones-discuss/KBFu8BnmNKw/QKVN62L8H54J James has the solution and I've tested it on the ground, now to just test it in the air. Further to your questions: we're using a joystick, pan axis is analog servo, tilt axis is via Alexmos brushless controller. There is a parameter file earlier in this issue thread.

GrahamDyer avatar Sep 01 '14 14:09 GrahamDyer