stephendade / Rpanion-server

Web-based configurator for companion computers of MAVLink vehicles
https://www.docs.rpanion.com/software/rpanion-server
GNU General Public License v3.0
146 stars 62 forks source link

Feature Request: pan-tilt gimbal controls #196

Closed lida2003 closed 10 months ago

lida2003 commented 10 months ago

I think a pan-tilt gimbal conrol is very thoughtful design.

This is my video about this 2D gimbal, https://www.youtube.com/watch?v=omBjam52Hq0

So what I'm proposed here: is it possible for Rpanion to intergrate this feature? And then it might be controlled by MP or QGC.

There is pan-tilt HAT board for RaspberryPi and jetson.


EDIT: related features:

It is something like "Standalone Integrated Camera/Gimbal"

图片

stephendade commented 10 months ago

For the pan/tilt, you connect the gimbal directly to the flight controller and control it from there. I'm not sure why you'd need to go via the RPi?

lida2003 commented 10 months ago

For the pan/tilt, you connect the gimbal directly to the flight controller and control it from there. I'm not sure why you'd need to go via the RPi?

Currently, camera and gimble are all connected to Rpi. So I think it's rather simple for the communication. And then Rpi knows what angle it's looking at.

GCS ==> Rpi ==> pan/tilt


EDIT:

If AP has kind of gimbal manager, which tries to manager gimbals. Then is it possible to add Rpi pan/tilt controlled by AP, then controls gimbal, like Standalone Integrated Camera/Gimbal.

stephendade commented 10 months ago

Using PWM servo pan/tilt with ArduPilot: https://ardupilot.org/copter/docs/common-camera-gimbal.html#common-camera-gimbal

I do plan to add in the VIDEO_STREAM_INFO MAVLink messages, as it should allow better GCS management of the camera video stream.

lida2003 commented 10 months ago

Using PWM servo pan/tilt with ArduPilot: https://ardupilot.org/copter/docs/common-camera-gimbal.html#common-camera-gimbal

Hmmmm... I see.

Here is a scenario I'm considering:

a. pan/tilt camera, looking for a specific vechicle b. now, the camera locks the vechicle at a pan/title angle c. companion computer need to tell ardupilot to follow and tracking the vechicle d. during the process of following and tracking, the camera should be always looking at vechicle

The quesiton is what kinds of MAVLink API or message should be used during the process? Any idea or tips?

stephendade commented 10 months ago

So the camera is running some sort of image detection to find the car?

So a typical workflow would be:

  1. Camera detects the vehicle
  2. Camera software calculates relative pitch and yaw angles from drone to vehicle
  3. Camera software sends these values to ArduPilot via MAVLink message (https://ardupilot.org/dev/docs/mavlink-gimbal-mount.html#mav-cmd-do-gimbal-manager-pitchyaw-to-move-to-a-desired-angle-or-at-a-desired-rate)
  4. Ardupilot moves the gimbal accordingly
  5. Repeat as needed
lida2003 commented 10 months ago

Ardupilot has kind of features, which has more info about FC(navigation). Stick to the following diagram might be a good choice.

图片