无人驾驶学习(二):定位与导航

一、gps

1.SBAS(Satellite-Based Augmentation System)

        即星基增强系统,通过地球静止轨道(GEO)卫星搭载卫星导航增强信号转发器,可以向用户播发星历误差、卫星钟差、电离层延迟等多种修正信息,实现对原有卫星导航系统定位精度的改进。

SBAShttps://baike.baidu.com/item/SBAS/712771?fr=aladdin

2.RTK(Real - time kinetic )

       实时动态载波相位差分技术,是实时处理两个测量站载波相位观测量的差分方法,将基准站采集的载波相位发给用户接收机,进行求差解算坐标

RTKhttps://baike.baidu.com/item/%E5%AE%9E%E6%97%B6%E5%8A%A8%E6%80%81%E8%BD%BD%E6%B3%A2%E7%9B%B8%E4%BD%8D%E5%B7%AE%E5%88%86%E6%8A%80%E6%9C%AF/57206910?fr=aladdin&fromtitle=RTK&fromid=397408

3.差分GPS(differential GPS-DGPS,DGPS)

        首先利用已知精确的三维坐标的差分GPS基准台,求得伪距修正量或位置修正量,再讲这个修正量实时或时候发送给用户(GPS导航仪),对用户的测量数据进行修正,以提高GPS定位精度

差分GPShttps://baike.baidu.com/item/%E5%B7%AE%E5%88%86GPS/10862498?fr=aladdin

二、四元数与欧拉角转换

超好的一个链接:https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles#Euler_angles_to_quaternion_conversionhttps://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles#Euler_angles_to_quaternion_conversion

1、四元数到欧拉角的转换

        转换关系

        Note, however, that the arctan and arcsin functions implemented in computer languages only produce results between −π/2 and π/2, and for three rotations between −π/2 and π/2 one does not obtain all possible orientations. To generate all the orientations one needs to replace the arctan functions in computer code by atan2: (考虑到分母不为0)

         c++代码:

#define _USE_MATH_DEFINES
#include <cmath>

struct Quaternion {
    double w, x, y, z;
};

struct EulerAngles {
    double roll, pitch, yaw;
};

EulerAngles ToEulerAngles(Quaternion q) {
    EulerAngles angles;

    // roll (x-axis rotation)
    double sinr_cosp = 2 * (q.w * q.x + q.y * q.z);
    double cosr_cosp = 1 - 2 * (q.x * q.x + q.y * q.y);
    angles.roll = std::atan2(sinr_cosp, cosr_cosp);

    // pitch (y-axis rotation)
    double sinp = 2 * (q.w * q.y - q.z * q.x);
    if (std::abs(sinp) >= 1)
        angles.pitch = std::copysign(M_PI / 2, sinp); // use 90 degrees if out of range
    else
        angles.pitch = std::asin(sinp);

    // yaw (z-axis rotation)
    double siny_cosp = 2 * (q.w * q.z + q.x * q.y);
    double cosy_cosp = 1 - 2 * (q.y * q.y + q.z * q.z);
    angles.yaw = std::atan2(siny_cosp, cosy_cosp);

    return angles;
}

2、欧拉角到四元数的转换

struct Quaternion
{
    double w, x, y, z;
};

Quaternion ToQuaternion(double yaw, double pitch, double roll) // yaw (Z), pitch (Y), roll (X)
//pitch是围绕y轴旋转
//yaw是围绕z轴旋转
//roll是围绕x轴旋转
{
    // Abbreviations for the various angular functions
    double cy = cos(yaw * 0.5);
    double sy = sin(yaw * 0.5);
    double cp = cos(pitch * 0.5);
    double sp = sin(pitch * 0.5);
    double cr = cos(roll * 0.5);
    double sr = sin(roll * 0.5);

    Quaternion q;
    q.w = cr * cp * cy + sr * sp * sy;
    q.x = sr * cp * cy - cr * sp * sy;
    q.y = cr * sp * cy + sr * cp * sy;
    q.z = cr * cp * sy - sr * sp * cy;

    return q;
}

3、四元数到欧拉角在线转换工具

https://quaternions.online/https://quaternions.online/

@meng

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值