[APPROVED] HeadTracker Serial Driver for CADDX 3 axis gimbal

Description: Gimbal and Goggles for wireless headtracker. Goggles transmit headtracking over RF link to video air unit in vehicle muxed over telem link connected from autopilot for OSD info back down to goggle. Gimbal has serial input for info from autopilot as alternate to three PWM outputs. A driver is needed to connect serially, allowing either manual or headtrack info to drive the gimbal. This is for the hardware required to develop a driver. The possibility of using a single servo/motor outputs instead of an autopilot UART to drive the serial input of the gimbal will also be investigated.

Planned amount $$ (USD): $519 see attached

Estimated time for completion: 1 month starting Sept1

1 Like

Itā€™s not clear to me how this equipment enables development of the serial driver for the gimbal.

the gimbal uses a serial port to get its xyz position input commands from the autopilot
the autopilot gets the goggles headtracking position commands over the VTX OSD link
the headtracking position command are generated by the goggle and transmitted to the VTX

you need all three to develop and test the system

Yes. But letā€™s step back a little.
The walksnail head tracker system is currently designed to be self contained (doesnā€™t pass through the autopilot), with manual/autopilot control available via pwm if you want it. This is obviously intended to simplify integration across any flight stack/configuration, as itā€™s completely agnostic.
Iā€™m not against developing an alternative so that you can use the autopilot as a mitm, but the request, as per your heading, is to support implementation of the gimbal serial protocol, from the autopilot. This has nothing to do with head tracking or goggles or the walksnail vtx. Just the gimbal. But you havenā€™t asked for the gimbal.
It seems like youā€™re jumping to stage 2 without doing stage 1 first: the requested hardware doesnā€™t actually support the stated purpose of the request.
As an extra question: what protocol does it use?

the second item includes the 3 axis gimbalā€¦

the gimbal can be controlled several ways, it has PWM inputs and it has a serial input.
-In the simplest case it can connect its PWM inputs to an autopilot conventionally for manual control via RC inputs to servo outputs
-on output poor autopilots (many copter targets) it can connect to a UART on the autopilot (we would need a driverā€¦the point of this)
-it can connect to the VTX directly for this head tracker goggle (they will update all AVATAR google including the high end ones) but then the autopilot cant send OSD overlays, so we can develop code to take the Display Port back channel flow which has this data, and then send it out either PMW or Serail (with the new driver) to the gimbal

so we need a gimbal serial driver and then an extension to DisplayPort to get the headtracker data and route it to outputs or gimbal serial input
and once I get the protocol details from CADDX (or reverse them from iNAV) we may be able to also send the serial gimbal data over a servo output (like serial LED) and give people the option to use only one servo outputā€¦maybe

also I a waiting for response back from CADDX R&D on if they are willing to give AP some or all of the aboveā€¦but I have a friend that has worked with them and they are a bit fickle when you dont have a jillion Youtube subscribers

i have the gimbal i cloned you branch @hwurzburg i will try to build and test it soon

@hwurzburg Iā€™d like to continue the work you started a couple of months back. Did you use something specifically for inspiration on how it should function?
Edit: nvm, I just saw your comments.

Here is the PRā€¦ our Mount lead has a gimbal on the way and he is going to debug the driver I wrote soonā€¦the driver uses iNavs gimbal driverā€™s packet format and CRC so it should be working, but it has an unknown issue that I cant resolveā€¦but Randy will soonā€¦he done many gimbal drivers for AP

Whatā€™s the issue, if Iā€™m not overstepping? I can help debug it, as the quad with the gimbal connected is next to my desk.

doesnā€™t seem to be sending info to the gimbalā€¦

@blahlex, @hwurzburg,

Weā€™ve got some kind of issue with the either the gimbal itself or with the format of the packets weā€™re sending to it from ArduPilot. Iā€™ve received the packet format from Caddx and Iā€™m pretty confident that Iā€™m sending what the gimbal wants but it never responds.

I think the gimbal needs to be running version 3.4 (which can be downloaded from here) and the gimbal I have has an older firmware.

One reason to think this is true is the release notes which are with the firmware

My next steps are to get the USB->Serial converter and 3pin cable so that I can run the configuration software and check the gimbals version

@rmackay9 I have a USB TTL lying around (and a Windows VM apparently), Iā€™ll update it to 3.4 and try the code again. Did you make any changes to @hwurzburgā€™s branch?

thats strange since I have an older version than yours and it works fine with the CADDX moonlight VTX and goggles L doing headtracking and mode changes via the moonlightā€™s serial port from the goggleā€¦

@rmackay9 @hwurzburg we have liftoff (pun intended) with gimbal firmware V3.4! Please excuse the mess. I guess I need to setup the deltas in config, but otherwise it works. Iā€™ll check out whatā€™s marked as TODO in the code.

@hwurzburg mine also worked when sending the gimbal commands through the VTX (from the headtracking goggles), but sending them through your code, directly from the FC didnā€™t. It seems v3.4 was needed.

Now we only need to figure out how to read the headtracking info from the Goggles. Reading the iNav pull requests, the data is sent via the VTX messages somehow (Iā€™m a beginner, mind the misused terms). We can pick those up and setup an RC switch for headtracking / manual control.

1 Like

How does one configure the gimbal position in the neutral RC position? Currently, the gimbal points forward when the RC signal is at minimum value, when it should point forward when at mid position. Is this configurable in ArduPilot or do we need to change the formulas in the code?

Edit: nvm, thatā€™s what trim is for, itā€™s perfect now. Whatā€™s missing from the implementation in your opinion?

1 Like

Hi @blahlex, @hwurzburg,

Thanks very much for testing! This is fantastic news that itā€™s basically working.

Iā€™ve created a simplified version of Henryā€™s PR here. This is rebased on master to resolve the merge conflicts in Henryā€™s PR and it also:

  1. removes new aux switch feature to control the various new lock methods
  2. replaces the packet structure with a more manual method that will surely work on all platforms (I think the structure method may not work on Linux for example)
  3. simplified CRC calculation

There are some more things we need to do:

  1. angle reporting doesnā€™t work. I think the gimbal provides feedback but Iā€™m not sure yet
  2. add back in HenryWā€™s aux switch changes

Re the head tracker, I suspect this should be part of the CADDX driver. I would have thought that it was a new type of pilot input and should be fed into a separate autopilot serial port and would then work with all gimbals, not just the CADDX.

Anyway, the original work in HenryWā€™s though so he and I should decide how we want to proceed. I was primarily trying to get the sending of angles working. my programmer should arrive within the next few days so Iā€™m looking forward to that!

Hi @blahlex,

Iā€™ve created a PR now which builds upon HenryWā€™s PR and Iā€™ve tested and it seems to work.

No pressure of course but if you have a chance to give it a try thatā€™d be great. Confirmation from others that it works will help speed the changes into master (and then 4.6 hopefully)

@rmackay9 your PR works perfectly as well, I just built and tested it. I havenā€™t tried changing mount modes though.

1 Like