How to get Gimbal angle and Camera target coordinates

Hi,

How to get the coordinates of the area at which the camera is looking since the mission planner only shows the coordinates of the drone.

Basically how to reverse engineer the ROI? In ROI, we set an area and based on the current altitude, heading, and GPS coordinates, the gimbal’s angles are automatically calculated and adjusted.

I know that it is possible to manually calculate the camera’s target location using the drone’s parameters like altitude, heading, Lat Lon, and gimbal pitch angle values. But is possible to get it automatically?

If yes then how?
If no, then is it possible to only read the gimbal pitch angle in the mission planner, so I can use it for my own algorithm?

Currently, I am using an 8 bit 2 axes Alexmos gimbal.

Any help would be highly appreciated.

@Michael_Oborne @philip @Alvin

Thanks,
Divyanshu

1 Like

Mission Planner provide option to set Point Camera Here and Point Camera Coords
https://ardupilot.org/planner/docs/mission-planner-flight-data.html#map-area
so it may be possible to get what you want

I found that you can get camera gimbal angle from the mavlink message MAV_CMD_DO_MOUNT_CONTROL
https://ardupilot.org/planner/docs/common-mavlink-mission-command-messages-mav_cmd.html#mav-cmd-do-mount-control

But I don’t see any mavlink message about exact coordination camera pointed to. Maybe you still need some calculation.

Hi @Alvin,

Thank you soo much for replying.

  1. I think that “Point Camera Here” and “Point Camera Coords” are used to point the camera to a specific location. But I want the opposite of it. I want to know that at which coordinate my camera is currently looking. This is used in law enforcement missions to know the coordinates of an object.
    For eg, let’s assume that the drone operator spots a person from the camera’s image and the drone is flying 500m away. Then how can the operator know the coordinates of the spotted person?

  2. The command “MAV_CMD_DO_MOUNT_CONTROL” is used to set yaw, pitch, and roll angles of the gimbal. How can it be used to read these angles?

  3. Since my gimbal is controlled via PWM signals, how can the autopilot set its exact angle using the above command? By calculating a required PWM value based on the angle? or how?

  4. How can the autopilot read the exact angle of the gimbal since there isn’t any kind of read mechanism when the gimbal is controlled by PWM?

P.S. I am using AlexMOS gimbal which supports PWM controls. Can I read the gimbal angles from it if I control it via Serial (MNT_TYPE=4)? Or If I use storm32 gimbal which supports MAVLINK, then is it possible to do what I want to?

Please help me with this since I am really stuck in this.

@Alvin @philip @Michael_Oborne

Thanks,
Divyanshu

My thought is that if you had previously commanded the gimbal to a specific location, you should have known where it is pointing at. That’s why I said it is possible to get position from MAV_CMD_DO_MOUNT_CONTROL. But this method require saving previously sent commend to somewhere.

For the PWM part, you are correct. There are no feedback from PWM signal system. You can only record previously send commend to estimate its current position.
If you select mavlink gimbals, you could get a lot of information from it.
For example, Messages (common) · MAVLink Developer Guide

let’s assume that the drone operator spots a person from the camera’s image and the drone is flying 500m away. Then how can the operator know the coordinates of the spotted person

In this case, how did the camera spot the person in the first place? The gimbal must be pointing at its initial position or some angle from last command. Combining the GPS from copter and gimbal angle, you should be able to get the ROI location. But mavlink don’t provide anything like get_ROI command. Therefore you will need to do the calculate by yourself.

Hi @Alvin,
Firstly, thank you soo much for taking your time to reply. Really appreciate it.

The drone operator moves the camera using the wheel on the herelink or a knob on a transmitter until he spots someone.

Yes, I understand this solution, but there’s a problem with this:

It is not confirmed that the gimbal has attained that angle accurately or not right? It could be easily off by some degrees or so since the angle can get affected by the wind, drone speed, etc. Without the feedback system, it’s like just assuming that the gimbal reached that angle, right?

Due to this error in angle, the ROI coordinates can never be accurate. :frowning:

I am now convinced that using PWM would never let me accurately achieve what I want to, because of the lack of feedback.

So this is what I am thinking now:

I have an AlexMos gimbal which could also be controlled in a better way via “AlexMos Serial” instead of PWM. (like shown here: SimpleBGC Gimbal (aka AlexMos gimbal) — Copter documentation)
My Gimbal is an old version one, so can’t use MAVLINK, but can use AlexMos-Serial technique.

The gimbal’s GUI can read and display the gimbal angle using this serial only, which means that the gimbal has the ability for sending angles.

Can the Arducopter just simply read this angle, and send it over to the ground station just like it sends other parameters?

Eagerly waiting for your reply.

Thanks,
Divyanshu

I think this answers your question. I am guessing you need Mavlink to talk to Mavlink. “AlexMos Serial” is not Mavlink. See page 94 of the SimpleBGC 32bit 3 axis software user manual for more information. Easiest way might be to upgrade your gimbal controller board.

I’m not very familiar with gimbal control. But as AlexMos Gimbal Serial is compatible with Ardupilot, there are some chances that Ardupilot integrates and publishes the gimbal information into mavlink.
You may go to Mission Planner > Ctrl + F > Mavlink inspector and check whether there is any.
The best solution would be buying a mavlink gimbal.

Hi @Alvin @Paradise33,

Thank you for replying. Yes, I agree that there’s nothing better than a MAVLINK controlled Gimbal.

But my main doubt is “will the gimbal’s angle be transmitted to GCS along with other parameters automatically, Or do I have to request it again and again?”

Thanks,
Divyanshu

All that is covered on page 94 of the manual. Its free to download from https://www.basecamelectronics.com