[英]Accelerometer and Magnetometer sensor fusion to get Gyroscopic Data
I am making a raspberry pi robot with an FVP (First Person View) camera mounted on a Pan/tilt Servo. 我正在用安装在云台伺服器上的FVP(第一人称视角)相机制作一个树莓派机器人。 I want to make it VR compatible by connecting it to my Phone.
我想通过将其连接到手机使其与VR兼容。 But my phone doesn't have Gyroscope sensor to detect horizontal movements, but it has magnetometer and accelerometer.
但是我的手机没有陀螺仪传感器来检测水平运动,但是有磁力计和加速度计。 How can I combine data from accelerometer and magnetometer to make a virtual gyroscope that can move with my camera.
我如何结合来自加速度计和磁力计的数据来制作可以随相机移动的虚拟陀螺仪。 I am noob in all of these.
我在所有这些方面都是菜鸟。
You should have an rotation vector sensor that is already fusing the two. 您应该有一个已经将两者融合在一起的旋转矢量传感器 。 You will not get better results than it.
您将不会获得比它更好的结果。
Note that this will not be as high quality as a proper gyroscope and will have artifacts if the robot moves. 请注意,这将不如适当的陀螺仪那样高品质,并且如果机器人移动,将会产生伪影。
If you're still interested in how to make this yourself, you can get roll and pitch information from the accelerometer, then get the yaw information from the magnetometer. 如果您仍然对如何自己制造感兴趣,则可以从加速度计获取横摇和俯仰信息,然后从磁力计获取横摆信息。 Best if you find a library for 3d maths and do this with quaternions or matrices.
最好是找到一个3D数学库,并使用四元数或矩阵进行此操作。 This seems like a use case where you will be affected by gimbal locks easily, so euler angles will be problematic.
这似乎是一个用例,您很容易受到万向节锁的影响,因此欧拉角会成问题。
I guess you want to use this for VR? 我想您想将此用于VR吗? Don't try to move the servos to compensate for head movement directly, you'll only make a motion sickness generator.
不要试图移动伺服器来直接补偿头部的运动,您只会制造一个晕车发生器。 Look at how timewarp works - you move the servos in the general direction a person is looking at and render the video reprojected on a sphere - this way you have almost zero lag.
看一下时间扭曲的工作原理-将伺服器沿人们正在观察的大致方向移动,并将视频重新投影到球体上-这样,您几乎可以将延迟保持为零。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.