-
Notifications
You must be signed in to change notification settings - Fork 240
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
Inject IMU data into image data frame #371
Comments
yes, but you should do it on the camera (video encoder) side. CCTV cameras do this for metadata (for example to log motion detection) via adding NAL with invalid type which normal video decoder can skip. But for your case is more simple to mix it as prefix (or suffix) to RTP packets |
Currently, I'm using SSC338Q, which uses https://github.com/OpenIPC/majestic for encoding. And it's NOT opensource. Is there any alternative opensource code can be used (Or I can try to modify the code?), any performance impact? |
In case of openipc camera which is very restricted by disk size the more preferrable way is patch wfb_tx to mix IMU data to every incoming packet. See Line 944 in 1ba87b2
You need to add size of you IMU data struct to the buf size and set .iov_base = buf + sizeof(imu) ,
|
On the rx side just write a simple proxy that will split prefixes from UDP packets and produce normal RTP and imu data streams |
You're a genius! I'll test it later. Thanks a lot. If it works, I'll submit a PR. |
But as long-term solution I'll recommend to write simple proxy in C that will receive mavlink from uart, udp from majectic then mix latest IMU data from mavlink as prefix to incoming rtp udp packet and send resulting udp packet to wfb_tx. It will have much simplier logic than hacking wfb_tx. See https://github.com/OpenIPC/mavfwd for reference |
Yes, I did some test on VINS-Fusion. Actually it's really time sensitive. Now I'm thinking there are a few steps as follows: Image part:(no idea right now??? how to get timestamp on image frame level(no experience here))
IMU part:
|
I think you don't need separate timestamp from image. Just use timestamp from flight controller (bundle it with IMU data). Because frequency of IMU readings >> video framerate they always will be correct. So proposed algorithm is:
|
There are some troubles here:
Therefore, I would like to confirm the following questions:
Lines 932 to 935 in 7d9367a
Line 940 in 7d9367a
If the above undestading is OK, then
Please let me know what have got in your mind? Any advice? Thanks. |
If you bundle IMU data to the same UDP packet with video data on the TX side then on RX IMU and video will be always coherent. You don't need to add (or use) any timestamps to the video stream.
where mixer and splitter are simple udp proxies. If use separate streams or tunnels for video and mavlink then they will use different queues (in kernel, in card, etc) and always be out of sync. |
In approach above you don't need to modify to majestic and wfb-ng |
It's worth trying. And get back to you when I get result. |
@svpcom Does Majestic support to change RTP packet size. What would happen if I send UDP packet size beyond or large than MTU size(1500)? Any trouble with wfb-ng?Will the underlying layer perform fragmentation? |
If you will try to inject packet larger than wifi mtu then it will be truncated and you will unable to decrypt it on the RX side. |
OK, that's good news. I will switch to openipc camera(SSC338Q) and find out more. And I have found there are glitches on Rpi3B+, I'm NOT sure why? |
I have got an error(Error: Unable to inject packet: Message too long) on openipc-ssc30kq IMX335 8812EU. How to configure to use large MTU?
|
@lida2003 ifconfig wlan0 mtu 3000 |
OK, I'll try if needed. Right now I didn't see that much IMU packet needed for transfer.
But it seems still have sync issue: HKUST-Aerial-Robotics/VINS-Fusion#263 |
Hi
We are trying VINS-Fusion, which is for Non-GPS navigation.
Currently, it's quite good with Mono-Camera + IMU data. As most IPC camera is not that powerful, I want to move Fusion algorithm on the computer.
So I want to pack IMU data into image frame, which is about 60 or 120FPS.
Is it possible to add this into wfb-ng?
The text was updated successfully, but these errors were encountered: