Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Walksnail Serial gimbal and headtracker support #10109

Merged
merged 72 commits into from
Jun 20, 2024
Merged

Conversation

mmosca
Copy link
Collaborator

@mmosca mmosca commented Jun 5, 2024

Support for Walksnail serial gimbal and headtracker.

Headtracker can be used with serial gimbal or in the mixer.

Saves a few pwm outputs in exchange for a UART.

Headtracker information can be read from VTX via UART and gimbal can be controlled via uart.

serial 5 67108864 115200 115200 0 115200

set gimbal_sensitivity = 0
set gimbal_pan_channel = 15
set gimbal_tilt_channel = 16
set gimbal_roll_channel = 0

set headtracker_type = SERIAL
set headtracker_pan_ratio =  1.000
set headtracker_tilt_ratio =  1.000
set headtracker_roll_ratio =  1.000

Configurator changes:
iNavFlight/inav-configurator#2106

Features for a follow up PR:

  • trims for at least the pitch axis to allow "X degree up angle on camera", like quad pilots are used to.
  • Implement headtracker_type = SERVO and refactor osd pan compensation to use headtracker common, instead of mixer channels.

Demo:
https://youtu.be/GDTD14OQr-c

mmosca added 8 commits June 2, 2024 21:19
Needs plumbing so we have a gimbal task running to send gumbal updates
Keep it out of F722 for testing builds, for now.
Start plumbing task. Still need initialization
Time to wire things up and test.
@mmosca mmosca removed the Don't merge label Jun 6, 2024
@mmosca mmosca added this to the 8.0 milestone Jun 6, 2024
@mmosca mmosca marked this pull request as ready for review June 6, 2024 21:29
@ltwin8
Copy link
Contributor

ltwin8 commented Jul 12, 2024

are you aware of some headtracker to use with ELRS? afaik the ELRS Backpack can support headtrack only missing part is a sensor for googles

for INAV, that shows up as data on a rc channel. No need to do anything special

I meant hardware to do headtracking? Like anything that communicates with the radio (wirelessly maybe) to mix it into the rc link

@elmerthecat
Copy link

Will this work on any gimbal with a UART? I would like to use this one.

@mmosca
Copy link
Collaborator Author

mmosca commented Jul 15, 2024

Will this work on any gimbal with a UART? I would like to use this one.

I have only tested the walksnail one. If it is is the same, it should work.

@elmerthecat
Copy link

Will this work on any gimbal with a UART? I would like to use this one.

I have only tested the walksnail one. If it is is the same, it should work.

Okay, thanks. Just out of curiosity and since I cant find this information elsewhere, how do the goggles transmit the head tracking data to the aircraft? I am assuming it is through the vtx? Can the vtx transmit the pwm signal to the FC so that you can just use pwm signal instead?

@Jonbuckles
Copy link

Jonbuckles commented Jul 22, 2024

Will this work on any gimbal with a UART? I would like to use this one.

I have only tested the walksnail one. If it is is the same, it should work.

Okay, thanks. Just out of curiosity and since I cant find this information elsewhere, how do the goggles transmit the head tracking data to the aircraft? I am assuming it is through the vtx? Can the vtx transmit the pwm signal to the FC so that you can just use pwm signal instead?

The built in head tracking is sent from the goggles to the VTX, VTX has a cable that goes to the gimbal and the commands are passed. The goggles also have head tracking out via 3.5mm jack, that can be used like normal head tracking sent to the FC via radio link, and in return can be sent to the gimbal if you directly connect the pwm cables, bypassing the VTX option.

Adding the option for UART control instead of pwm would simplify the wiring as well as allow you to set parameters via CLI and a host of other possibilities.

@Jonbuckles
Copy link

Are you on firmware 3.2 for the GM3 gimbal? I’m curious if this has been tested since they released the new firmware. I’ve have this working on the old firmware but don’t know if upgrading will still work. There is a parameter settings file on the gimbal that may need backed up and restored after upgrading.

@mmosca
Copy link
Collaborator Author

mmosca commented Aug 14, 2024

Upgrading to 3.2 will break it. We are working with walksnail for a solution.

@mmosca
Copy link
Collaborator Author

mmosca commented Aug 14, 2024

@Jonbuckles if anyone comes across this, you can track progress of the fix here #10302

We expect this to be fixed by caddx, but we may eventually need to do small changes on INAV's side before 8.0 release.

@kasatka60
Copy link

XF C-20T FPV GIMBAL supports "Carrier AHRS Fusion". Is it possible to implement this on inav?

@Doncuppjr
Copy link

This is some exciting work. I hope gimbal roll can be be captured, that's one thing really missing from the PWM modes.

@Doncuppjr
Copy link

Nice, I finally found where to set the channels for pitch/yaw/roll. I would be nice to have channels for sensitivity and mode vs static settings, but this is moving in the right direction.

@rickgode
Copy link

I just got my C-20T gimbal going as well and using a uart really simplifies the wiring. I too would like to see the ability to set the channels for mode and sensitivity. Or is the sensitivity in inav not a channel assignment but a percentage?

@rickgode
Copy link

This is some exciting work. I hope gimbal roll can be be captured, that's one thing really missing from the PWM modes.

My Goggles X doesn’t out the roll via ppm, so it might be a Walksnail hardware/firmware issue?

@Doncuppjr
Copy link

T

This is some exciting work. I hope gimbal roll can be be captured, that's one thing really missing from the PWM modes.

My Goggles X doesn’t out the roll via ppm, so it might be a Walksnail hardware/firmware issue?

It looks like when using uart, you can map a channel to roll, but not when using PWM.

@Doncuppjr
Copy link

This is some exciting work. I hope gimbal roll can be be captured, that's one thing really missing from the PWM modes.

My Goggles X doesn’t out the roll via ppm, so it might be a Walksnail hardware/firmware issue?

Near as I can tell, you can set a static value for sensitivity, not sure what the range is, but it defaults to 0. When using PWM it's between 1000 and 2000 us. I don't see anything for mode, but maybe it's picking FPV.

@rickgode
Copy link

I'm an idiot... The modes are right there in the modes tab in inav in the gimbal section! They are gimbal level tilt, gimbal level roll, gimbal headtracker and gimbal center.

Like the flight modes in inav, when nothing is selected it's the default mode (the FPV follow mode) when the Gimbal Level Tilt is selected, it locks the Pitch. When the Gimbal Level Roll is selected it locks the Roll. I used Gimbal Center as my "Gimbal Lock" mode.

@str8man
Copy link

str8man commented Dec 21, 2024

GM3 serial gimbal work fine, but headtracker is totaly not. While without FC headtracking are okay.
I tried with 2 different FCs, in normal UART and single UART mode.
Gimbal FW is latest, headtracker FW v1.9 and v2.0 are similar results.

FCs: Matek F722SE, KakuteF7 V1.5
INAV 8.0.0-RC3

What i make wrong?

@Drasnore
Copy link

GM3 serial gimbal work fine, but headtracker is totaly not. While without FC headtracking are okay. I tried with 2 different FCs, in normal UART and single UART mode. Gimbal FW is latest, headtracker FW v1.9 and v2.0 are similar results.

FCs: Matek F722SE, KakuteF7 V1.5 INAV 8.0.0-RC3

What i make wrong?

Hey, I finally managed to fix it I don't know how, but after double checking everything and especially wiring (on my avatar v2 vtx, the tx wire is the one on the outer side of the USB connector, the Rx one being next to it on the inside, and I even wired the ground wire on the port), it works with a diy gimbal. The headtracker debug output doesn't show "usable" values in the Sensor Tab on the configurator, but after correctly configuring the mixer with the 2 servos of my gimbal, it's working in PTZ mode. If you need any details hit me up.

@kasatka60
Copy link

How to invert a channel for pitch in inav?

@Doncuppjr
Copy link

Maybe just do it on your radio?

@kasatka60
Copy link

As a solution, I made it on the RC. But I would like to invert it in the inav itself.

@925333261
Copy link

我没看懂这个翻译的“万向节”是什么。。。
我想知道这个能通过goggles X无线发射陀螺仪信号,然后通过MSP控制舵机吗,我需用的是舵机的,低成本的舵机云台。

@mmosca
Copy link
Collaborator Author

mmosca commented Feb 8, 2025

我没看懂这个翻译的“万向节”是什么。。。 我想知道这个能通过goggles X无线发射陀螺仪信号,然后通过MSP控制舵机吗,我需用的是舵机的,低成本的舵机云台。

If you configure a headtracker in INAV, you can use the headtracker as input in the mixer tab, to control a servo.

@925333261
Copy link

1
2
3
先看我的设备,两个舵机,用来当舵机云台,一个caddxfpv的图传,一个goggles x。目的:通过goggles x无线将陀螺仪信号发出PPM信号(而不是传统的方式,通过教练接口遥控器发射出去),来控制舵机云台。

混控界面我的舵机是S10和S11,所以我不知道舵机输入那里该选啥。。所以选了一堆。。
配置界面已经选择了MSP
端口界面我的图传接在了UART5,且选择了MSP

目前问题是,这样goggles x还是无法控制舵机

@mmosca
Copy link
Collaborator Author

mmosca commented Feb 8, 2025

M

1 2 3 先看我的设备,两个舵机,用来当舵机云台,一个caddxfpv的图传,一个goggles x。目的:通过goggles x无线将陀螺仪信号发出PPM信号(而不是传统的方式,通过教练接口遥控器发射出去),来控制舵机云台。

混控界面我的舵机是S10和S11,所以我不知道舵机输入那里该选啥。。所以选了一堆。。 配置界面已经选择了MSP 端口界面我的图传接在了UART5,且选择了MSP

目前问题是,这样goggles x还是无法控制舵机

Make sure you have the latest firmware in the vtx and goggles and that headtracking is enabled in the goggles. Setup looks correct.

@925333261
Copy link

555
是的兄弟,是的,是最新的固件,goggles x头部追踪里我还选择了ppm、ch7-ch8,也选了"云台"模式

@mmosca
Copy link
Collaborator Author

mmosca commented Feb 8, 2025

Don't use PPM. PPM will output PPM on the 3.5 plug. Use one of the other headtracking modes.

If you want to pass it through INAV, you need to set it up like you do for goggles headtracking.

@925333261
Copy link

66
77
那我改为"云台"模式
真的可以控制舵机吗。还是只能控制caddfpv这样的云台呢

@mmosca
Copy link
Collaborator Author

mmosca commented Feb 8, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants