激光SLAM理论与实践 - 第六期 第1章 激光SLAM简介 作业与心得

2024-02-24 11:50

本文主要是介绍激光SLAM理论与实践 - 第六期 第1章 激光SLAM简介 作业与心得,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

  1. 了解 Linux 系统:阅读《鸟哥的 Linux 私房菜》自学前三部分内容,或利用互联网进行学习,简答以下问题;(3 分)

    1. 列举三个你常用的 Linux 命令,并说明他们的功能。

      1. man 指令,是manual(操作说明)的缩写,该指令用于查看其他指令的详细说明;比如 $ man date ,就会出现有关 date 的详细说明。
      2. cd 指令,是change directory(改变目录)的缩写,该指令用于改变工作目录;比如 $ cd /home/tx-ubuntu64 ,就会将当前目录变为 /home/tx-ubuntu64
      3. mkdir 指令,是make directory(创建目录)的缩写,该指令用于创建新目录;比如 $ mkdir abc ,就会创建文件夹abc。
    2. 一句话简要介绍 Vim 的功能,如何在 Vim 中进行插入和删除,如何保存并退出 Vim?

      1. Vim 是 vi 进阶版本的文本编辑器,Vim 可以用颜色或底线等方式来显示一些特殊的信息。
      2. 在一般模式中,按下 i (i, I, o, O, a, A, r, R)进入编辑模式,开始编辑(包括插入和删除)文字,按下 Esc 即可退出编辑模式。
      3. 在一般模式中,按下 :wq 保存并退出Vim。
    3. 列举两种常用的 Linux 压缩和解压缩命令。

      1. tar 指令,解压 tar zxvf FileName.tar.gz ,压缩 tar zcvf FileName.tar.gz DirName
      2. unzip 指令与 zip 指令,解压 unzip FileName.zip ,压缩 zip -q -r FileName.zip FileName
  2. 了解 ROS:观看 ROS 免费公开课或前往 ROS 官网学习官方教程,安装好 ROS,提供运行小海龟跑的截图;(3 分)

在这里插入图片描述
这里需要注意ROS更新过key,最好使用英文版安装教程。

  1. 学习机器人姿态描述入门材料,完成坐标转换推导;(3 分)
    设机器人的世界坐标为 xa, ya,其相对于世界坐标系的方向为 θa(右手坐标系)。假设机器人旁边有一物体在世界坐标系下的位姿为(xb, yb, θb),请问:

    1. 该物体相对于机器人的位置和朝向是什么,即该物体在当前机器人坐标系下的位姿是多少?

      解:设世界坐标系为 { W } \{W\} {W} ,机器人坐标系为 { A } \{A\} {A} ,物体坐标系为 { B } \{B\} {B} ,则
      在这里插入图片描述

      B A T = W A T ⋅ B W T = A W T − 1 ⋅ B W T = [ A W R T − A W R T ⋅ A W P 0 1 ] ⋅ [ B W R B W P 0 1 ] = [ A W R T ⋅ B W R A W R T ⋅ B W P − A W R T ⋅ A W P 0 1 ] = [ A W R T ⋅ B W R A W R T ⋅ ( B W P − A W P ) 0 1 ] \begin{aligned} ^A_BT&=^A_WT\cdot^W_BT \\ &=^W_AT^{-1}\cdot^W_BT \\ &=\begin{bmatrix} ^W_AR^T & -^W_AR^T\cdot^W_AP \\ 0 & 1 \\ \end{bmatrix}\cdot\begin{bmatrix} ^W_BR & ^W_BP \\ 0 & 1 \\ \end{bmatrix} \\ &=\begin{bmatrix} ^W_AR^T\cdot^W_BR & ^W_AR^T\cdot^W_BP-^W_AR^T\cdot^W_AP \\ 0 & 1 \\ \end{bmatrix} \\ &=\begin{bmatrix} ^W_AR^T\cdot^W_BR & ^W_AR^T\cdot(^W_BP-^W_AP) \\ 0 & 1 \\ \end{bmatrix} \end{aligned} BAT=WATBWT=AWT1BWT=[AWRT0AWRTAWP1][BWR0BWP1]=[AWRTBWR0AWRTBWPAWRTAWP1]=[AWRTBWR0AWRT(BWPAWP)1]
      式中:
      A W R T ⋅ B W R = [ c o s θ a − s i n θ a s i n θ a c o s θ a ] T ⋅ [ c o s θ b − s i n θ b s i n θ b c o s θ b ] = [ c o s θ a s i n θ a − s i n θ a c o s θ a ] ⋅ [ c o s θ b − s i n θ b s i n θ b c o s θ b ] = [ c o s θ a c o s θ b + s i n θ a s i n θ b − c o s θ a s i n θ b + s i n θ a c o s θ b − s i n θ a c o s θ b + c o s θ a s i n θ b s i n θ a s i n θ b + c o s θ a c o s θ b ] = [ c o s ( θ b − θ a ) − s i n ( θ b − θ a ) s i n ( θ b − θ a ) c o s ( θ b − θ a ) ] \begin{aligned} ^W_AR^T\cdot^W_BR&=\begin{bmatrix} cos\theta_a & -sin\theta_a \\ sin\theta_a & cos\theta_a \\ \end{bmatrix}^T\cdot\begin{bmatrix} cos\theta_b & -sin\theta_b \\ sin\theta_b & cos\theta_b \\ \end{bmatrix} \\ &=\begin{bmatrix} cos\theta_a & sin\theta_a \\ -sin\theta_a & cos\theta_a \\ \end{bmatrix}\cdot\begin{bmatrix} cos\theta_b & -sin\theta_b \\ sin\theta_b & cos\theta_b \\ \end{bmatrix} \\ &=\begin{bmatrix} cos\theta_acos\theta_b+sin\theta_asin\theta_b & -cos\theta_asin\theta_b+sin\theta_acos\theta_b \\ -sin\theta_acos\theta_b+cos\theta_asin\theta_b & sin\theta_asin\theta_b+cos\theta_acos\theta_b \\ \end{bmatrix} \\ &=\begin{bmatrix} cos(\theta_b-\theta_a) & -sin(\theta_b-\theta_a) \\ sin(\theta_b-\theta_a) & cos(\theta_b-\theta_a) \\ \end{bmatrix} \end{aligned} AWRTBWR=[cosθasinθasinθacosθa]T[cosθbsinθbsinθbcosθb]=[cosθasinθasinθacosθa][cosθbsinθbsinθbcosθb]=[cosθacosθb+sinθasinθbsinθacosθb+cosθasinθbcosθasinθb+sinθacosθbsinθasinθb+cosθacosθb]=[cos(θbθa)sin(θbθa)sin(θbθa)cos(θbθa)]
      A W R T ⋅ ( B W P − A W P ) = [ c o s θ a − s i n θ a s i n θ a c o s θ a ] T ⋅ ( [ x b y b ] − [ x a y a ] ) = [ c o s θ a s i n θ a − s i n θ a c o s θ a ] ⋅ [ x b − x a y b − y a ] = [ ( x b − x a ) c o s θ a + ( y b − y a ) s i n θ a − ( x b − x a ) s i n θ a + ( y b − y a ) c o s θ a ] \begin{aligned} ^W_AR^T\cdot(^W_BP-^W_AP)&=\begin{bmatrix} cos\theta_a & -sin\theta_a \\ sin\theta_a & cos\theta_a \\ \end{bmatrix}^T\cdot(\begin{bmatrix} x_b \\ y_b \\ \end{bmatrix}-\begin{bmatrix} x_a \\ y_a \\ \end{bmatrix}) \\ &=\begin{bmatrix} cos\theta_a & sin\theta_a \\ -sin\theta_a & cos\theta_a \\ \end{bmatrix}\cdot\begin{bmatrix} x_b-x_a \\ y_b-y_a \\ \end{bmatrix} \\ &=\begin{bmatrix} (x_b-x_a)cos\theta_a+(y_b-y_a)sin\theta_a \\ -(x_b-x_a)sin\theta_a+(y_b-y_a)cos\theta_a \\ \end{bmatrix} \end{aligned} AWRT(BWPAWP)=[cosθasinθasinθacosθa]T([xbyb][xaya])=[cosθasinθasinθacosθa][xbxaybya]=[(xbxa)cosθa+(ybya)sinθa(xbxa)sinθa+(ybya)cosθa]
      代入:
      B A T = [ c o s ( θ b − θ a ) − s i n ( θ b − θ a ) ( x b − x a ) c o s θ a + ( y b − y a ) s i n θ a s i n ( θ b − θ a ) c o s ( θ b − θ a ) − ( x b − x a ) s i n θ a + ( y b − y a ) c o s θ a 0 0 1 ] \begin{aligned} ^A_BT&=\begin{bmatrix} cos(\theta_b-\theta_a) & -sin(\theta_b-\theta_a) & (x_b-x_a)cos\theta_a+(y_b-y_a)sin\theta_a\\ sin(\theta_b-\theta_a) & cos(\theta_b-\theta_a) & -(x_b-x_a)sin\theta_a+(y_b-y_a)cos\theta_a\\ 0 & 0 & 1\\ \end{bmatrix} \end{aligned} BAT=cos(θbθa)sin(θbθa)0sin(θbθa)cos(θbθa)0(xbxa)cosθa+(ybya)sinθa(xbxa)sinθa+(ybya)cosθa1
      位姿为: ( ( x b − x a ) c o s θ a + ( y b − y a ) s i n θ a , − ( x b − x a ) s i n θ a + ( y b − y a ) c o s θ a , θ b − θ a ) ((x_b-x_a)cos\theta_a+(y_b-y_a)sin\theta_a,-(x_b-x_a)sin\theta_a+(y_b-y_a)cos\theta_a,\theta_b-\theta_a) ((xbxa)cosθa+(ybya)sinθa,(xbxa)sinθa+(ybya)cosθa,θbθa)

    2. 机器人此时朝它的正前方(机器人坐标系 X 轴)行进了 d 距离,然后又转了 θd角,请问物体此时在这一时刻机器人坐标系下的位姿是多少?

      解:移动后的机器人坐标系为 { A ′ } \{A'\} {A} ,则
      在这里插入图片描述

      B A ′ T = A A ′ T ⋅ B A T = A ′ A T − 1 ⋅ B A T = [ A ′ A R T − A ′ A R T ⋅ A ′ A P 0 1 ] ⋅ [ B A R B A P 0 1 ] = [ A ′ A R T ⋅ B A R A ′ A R T ⋅ B A P − A ′ A R T ⋅ A ′ A P 0 1 ] = [ A ′ A R T ⋅ B A R A ′ A R T ⋅ ( B A P − A ′ A P ) 0 1 ] \begin{aligned} ^{A'}_BT&=^{A'}_AT\cdot^A_BT \\ &=^A_{A'}T^{-1}\cdot^A_BT \\ &=\begin{bmatrix} ^A_{A'}R^T & -^A_{A'}R^T\cdot^A_{A'}P \\ 0 & 1 \\ \end{bmatrix}\cdot\begin{bmatrix} ^A_BR & ^A_BP \\ 0 & 1 \\ \end{bmatrix} \\ &=\begin{bmatrix} ^A_{A'}R^T\cdot^A_BR & ^A_{A'}R^T\cdot^A_BP-^A_{A'}R^T\cdot^A_{A'}P \\ 0 & 1 \\ \end{bmatrix} \\ &=\begin{bmatrix} ^A_{A'}R^T\cdot^A_BR & ^A_{A'}R^T\cdot(^A_BP-^A_{A'}P) \\ 0 & 1 \\ \end{bmatrix} \end{aligned} BAT=AATBAT=AAT1BAT=[AART0AARTAAP1][BAR0BAP1]=[AARTBAR0AARTBAPAARTAAP1]=[AARTBAR0AART(BAPAAP)1]
      式中:
      A ′ A R T ⋅ B A R = [ c o s θ d − s i n θ d s i n θ d c o s θ d ] T ⋅ [ c o s ( θ b − θ a ) − s i n ( θ b − θ a ) s i n ( θ b − θ a ) c o s ( θ b − θ a ) ] = [ c o s θ d s i n θ d − s i n θ d c o s θ d ] ⋅ [ c o s ( θ b − θ a ) − s i n ( θ b − θ a ) s i n ( θ b − θ a ) c o s ( θ b − θ a ) ] = [ c o s θ d c o s ( θ b − θ a ) + s i n θ d s i n ( θ b − θ a ) − c o s θ d s i n ( θ b − θ a ) + s i n θ d c o s ( θ b − θ a ) − s i n θ d c o s ( θ b − θ a ) + c o s θ d s i n ( θ b − θ a ) s i n θ d s i n ( θ b − θ a ) + c o s θ d c o s ( θ b − θ a ) ] = [ c o s ( ( θ b − θ a ) − θ d ) − s i n ( ( θ b − θ a ) − θ d ) s i n ( ( θ b − θ a ) − θ d ) c o s ( ( θ b − θ a ) − θ d ) ] = [ c o s ( θ b − θ a − θ d ) − s i n ( θ b − θ a − θ d ) s i n ( θ b − θ a − θ d ) c o s ( θ b − θ a − θ d ) ] \begin{aligned} ^A_{A'}R^T\cdot^A_BR&=\begin{bmatrix} cos\theta_d & -sin\theta_d \\ sin\theta_d & cos\theta_d \\ \end{bmatrix}^T\cdot\begin{bmatrix} cos(\theta_b-\theta_a) & -sin(\theta_b-\theta_a) \\ sin(\theta_b-\theta_a) & cos(\theta_b-\theta_a) \\ \end{bmatrix} \\ &=\begin{bmatrix} cos\theta_d & sin\theta_d \\ -sin\theta_d & cos\theta_d \\ \end{bmatrix}\cdot\begin{bmatrix} cos(\theta_b-\theta_a) & -sin(\theta_b-\theta_a) \\ sin(\theta_b-\theta_a) & cos(\theta_b-\theta_a) \\ \end{bmatrix} \\ &=\begin{bmatrix} cos\theta_dcos(\theta_b-\theta_a)+sin\theta_dsin(\theta_b-\theta_a) & -cos\theta_dsin(\theta_b-\theta_a)+sin\theta_dcos(\theta_b-\theta_a) \\ -sin\theta_dcos(\theta_b-\theta_a)+cos\theta_dsin(\theta_b-\theta_a) & sin\theta_dsin(\theta_b-\theta_a)+cos\theta_dcos(\theta_b-\theta_a) \\ \end{bmatrix} \\ &=\begin{bmatrix} cos((\theta_b-\theta_a)-\theta_d) & -sin((\theta_b-\theta_a)-\theta_d) \\ sin((\theta_b-\theta_a)-\theta_d) & cos((\theta_b-\theta_a)-\theta_d) \\ \end{bmatrix} \\ &=\begin{bmatrix} cos(\theta_b-\theta_a-\theta_d) & -sin(\theta_b-\theta_a-\theta_d) \\ sin(\theta_b-\theta_a-\theta_d) & cos(\theta_b-\theta_a-\theta_d) \\ \end{bmatrix} \\ \end{aligned} AARTBAR=[cosθdsinθdsinθdcosθd]T[cos(θbθa)sin(θbθa)sin(θbθa)cos(θbθa)]=[cosθdsinθdsinθdcosθd][cos(θbθa)sin(θbθa)sin(θbθa)cos(θbθa)]=[cosθdcos(θbθa)+sinθdsin(θbθa)sinθdcos(θbθa)+cosθdsin(θbθa)cosθdsin(θbθa)+sinθdcos(θbθa)sinθdsin(θbθa)+cosθdcos(θbθa)]=[cos((θbθa)θd)sin((θbθa)θd)sin((θbθa)θd)cos((θbθa)θd)]=[cos(θbθaθd)sin(θbθaθd)sin(θbθaθd)cos(θbθaθd)]
      A ′ A R T ⋅ ( B A P − A ′ A P ) = [ c o s θ d − s i n θ d s i n θ d c o s θ d ] T ⋅ ( [ ( x b − x a ) c o s θ a + ( y b − y a ) s i n θ a − ( x b − x a ) s i n θ a + ( y b − y a ) c o s θ a ] − [ d 0 ] ) = [ c o s θ d s i n θ d − s i n θ d c o s θ d ] ⋅ [ ( x b − x a ) c o s θ a + ( y b − y a ) s i n θ a − d − ( x b − x a ) s i n θ a + ( y b − y a ) c o s θ a ] = [ [ ( x b − x a ) c o s θ a + ( y b − y a ) s i n θ a − d ] c o s θ d + [ − ( x b − x a ) s i n θ a + ( y b − y a ) c o s θ a ] s i n θ d − [ ( x b − x a ) c o s θ a + ( y b − y a ) s i n θ a − d ] s i n θ d + [ − ( x b − x a ) s i n θ a + ( y b − y a ) c o s θ a ] c o s θ d ] \begin{aligned} ^A_{A'}R^T\cdot(^A_BP-^A_{A'}P)&=\begin{bmatrix} cos\theta_d & -sin\theta_d \\ sin\theta_d & cos\theta_d \\ \end{bmatrix}^T\cdot(\begin{bmatrix} (x_b-x_a)cos\theta_a+(y_b-y_a)sin\theta_a \\ -(x_b-x_a)sin\theta_a+(y_b-y_a)cos\theta_a \\ \end{bmatrix}-\begin{bmatrix} d \\ 0 \\ \end{bmatrix}) \\ &=\begin{bmatrix} cos\theta_d & sin\theta_d \\ -sin\theta_d & cos\theta_d \\ \end{bmatrix}\cdot\begin{bmatrix} (x_b-x_a)cos\theta_a+(y_b-y_a)sin\theta_a-d \\ -(x_b-x_a)sin\theta_a+(y_b-y_a)cos\theta_a \\ \end{bmatrix} \\ &=\begin{bmatrix} [(x_b-x_a)cos\theta_a+(y_b-y_a)sin\theta_a-d]cos\theta_d+[-(x_b-x_a)sin\theta_a+(y_b-y_a)cos\theta_a]sin\theta_d \\ -[(x_b-x_a)cos\theta_a+(y_b-y_a)sin\theta_a-d]sin\theta_d+[-(x_b-x_a)sin\theta_a+(y_b-y_a)cos\theta_a]cos\theta_d \\ \end{bmatrix} \end{aligned} AART(BAPAAP)=[cosθdsinθdsinθdcosθd]T([(xbxa)cosθa+(ybya)sinθa(xbxa)sinθa+(ybya)cosθa][d0])=[cosθdsinθdsinθdcosθd][(xbxa)cosθa+(ybya)sinθad(xbxa)sinθa+(ybya)cosθa]=[[(xbxa)cosθa+(ybya)sinθad]cosθd+[(xbxa)sinθa+(ybya)cosθa]sinθd[(xbxa)cosθa+(ybya)sinθad]sinθd+[(xbxa)sinθa+(ybya)cosθa]cosθd]
      代入:
      B A ′ T = [ c o s ( θ b − θ a − θ d ) − s i n ( θ b − θ a − θ d ) [ ( x b − x a ) c o s θ a + ( y b − y a ) s i n θ a − d ] c o s θ d + [ − ( x b − x a ) s i n θ a + ( y b − y a ) c o s θ a ] s i n θ d s i n ( θ b − θ a − θ d ) c o s ( θ b − θ a − θ d ) − [ ( x b − x a ) c o s θ a + ( y b − y a ) s i n θ a − d ] s i n θ d + [ − ( x b − x a ) s i n θ a + ( y b − y a ) c o s θ a ] c o s θ d 0 0 1 ] \begin{aligned} ^{A'}_BT&=\begin{bmatrix} cos(\theta_b-\theta_a-\theta_d) & -sin(\theta_b-\theta_a-\theta_d) & [(x_b-x_a)cos\theta_a+(y_b-y_a)sin\theta_a-d]cos\theta_d+[-(x_b-x_a)sin\theta_a+(y_b-y_a)cos\theta_a]sin\theta_d\\ sin(\theta_b-\theta_a-\theta_d) & cos(\theta_b-\theta_a-\theta_d) & -[(x_b-x_a)cos\theta_a+(y_b-y_a)sin\theta_a-d]sin\theta_d+[-(x_b-x_a)sin\theta_a+(y_b-y_a)cos\theta_a]cos\theta_d\\ 0 & 0 & 1\\ \end{bmatrix} \end{aligned} BAT=cos(θbθaθd)sin(θbθaθd)0sin(θbθaθd)cos(θbθaθd)0[(xbxa)cosθa+(ybya)sinθad]cosθd+[(xbxa)sinθa+(ybya)cosθa]sinθd[(xbxa)cosθa+(ybya)sinθad]sinθd+[(xbxa)sinθa+(ybya)cosθa]cosθd1
      位姿为: ( [ ( x b − x a ) c o s θ a + ( y b − y a ) s i n θ a − d ] c o s θ d + [ − ( x b − x a ) s i n θ a + ( y b − y a ) c o s θ a ] s i n θ d , − [ ( x b − x a ) c o s θ a + ( y b − y a ) s i n θ a − d ] s i n θ d + [ − ( x b − x a ) s i n θ a + ( y b − y a ) c o s θ a ] c o s θ d , θ b − θ a − θ d ) ([(x_b-x_a)cos\theta_a+(y_b-y_a)sin\theta_a-d]cos\theta_d+[-(x_b-x_a)sin\theta_a+(y_b-y_a)cos\theta_a]sin\theta_d,-[(x_b-x_a)cos\theta_a+(y_b-y_a)sin\theta_a-d]sin\theta_d+[-(x_b-x_a)sin\theta_a+(y_b-y_a)cos\theta_a]cos\theta_d,\theta_b-\theta_a-\theta_d) ([(xbxa)cosθa+(ybya)sinθad]cosθd+[(xbxa)sinθa+(ybya)cosθa]sinθd,[(xbxa)cosθa+(ybya)sinθad]sinθd+[(xbxa)sinθa+(ybya)cosθa]cosθd,θbθaθd)

    这题需要知道转换矩阵可以是坐标系的描述,也可以表示主动变换和被动变换;这里可以发现,在二维平面中,角度直接加减就可,在上面的坐标系中也可以比较明显得看出来。

  2. 完成基础数学坐标转换的代码作业。(3 分)

    这题的原理比较简单,就是已知 A O T ^O_AT AOT B O T ^O_BT BOT ,求 A B T ^B_AT ABT A B T = O B T ⋅ A O T = B O T − 1 ⋅ A O T ^B_AT=^B_OT\cdot^O_AT=^O_BT^{-1}\cdot^O_AT ABT=OBTAOT=BOT1AOT

    // TODO 参照第一课PPT
    // start your code here (5~10 lines)
    Eigen::Matrix3d TOA;
    TOA << cos(A(2)), -sin(A(2)), A(0),sin(A(2)),  cos(A(2)), A(1),0,          0,        1;
    Eigen::Matrix3d TBA = TBO * TOA;
    cout << TBA << std::endl;
    BA << TBA(0, 2),TBA(1, 2),atan2(TBA(1, 0), TBA(0, 0));
    // end your code here
    

    运行结果为:

    $ ./basicTransformStudy 
    TBA:
    -1.83697e-16           -1            21 -1.83697e-16            10            0            1
    The right answer is BA: 2 1 1.5708
    Your answer is BA:      2      1 1.5708
    

    详见代码仓库。

这篇关于激光SLAM理论与实践 - 第六期 第1章 激光SLAM简介 作业与心得的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/742012

相关文章

MySQL 迁移至 Doris 最佳实践方案(最新整理)

《MySQL迁移至Doris最佳实践方案(最新整理)》本文将深入剖析三种经过实践验证的MySQL迁移至Doris的最佳方案,涵盖全量迁移、增量同步、混合迁移以及基于CDC(ChangeData... 目录一、China编程JDBC Catalog 联邦查询方案(适合跨库实时查询)1. 方案概述2. 环境要求3.

Linux进程CPU绑定优化与实践过程

《Linux进程CPU绑定优化与实践过程》Linux支持进程绑定至特定CPU核心,通过sched_setaffinity系统调用和taskset工具实现,优化缓存效率与上下文切换,提升多核计算性能,适... 目录1. 多核处理器及并行计算概念1.1 多核处理器架构概述1.2 并行计算的含义及重要性1.3 并

全面掌握 SQL 中的 DATEDIFF函数及用法最佳实践

《全面掌握SQL中的DATEDIFF函数及用法最佳实践》本文解析DATEDIFF在不同数据库中的差异,强调其边界计算原理,探讨应用场景及陷阱,推荐根据需求选择TIMESTAMPDIFF或inte... 目录1. 核心概念:DATEDIFF 究竟在计算什么?2. 主流数据库中的 DATEDIFF 实现2.1

Spring WebFlux 与 WebClient 使用指南及最佳实践

《SpringWebFlux与WebClient使用指南及最佳实践》WebClient是SpringWebFlux模块提供的非阻塞、响应式HTTP客户端,基于ProjectReactor实现,... 目录Spring WebFlux 与 WebClient 使用指南1. WebClient 概述2. 核心依

MyBatis-Plus 中 nested() 与 and() 方法详解(最佳实践场景)

《MyBatis-Plus中nested()与and()方法详解(最佳实践场景)》在MyBatis-Plus的条件构造器中,nested()和and()都是用于构建复杂查询条件的关键方法,但... 目录MyBATis-Plus 中nested()与and()方法详解一、核心区别对比二、方法详解1.and()

Spring Boot @RestControllerAdvice全局异常处理最佳实践

《SpringBoot@RestControllerAdvice全局异常处理最佳实践》本文详解SpringBoot中通过@RestControllerAdvice实现全局异常处理,强调代码复用、统... 目录前言一、为什么要使用全局异常处理?二、核心注解解析1. @RestControllerAdvice2

Spring事务传播机制最佳实践

《Spring事务传播机制最佳实践》Spring的事务传播机制为我们提供了优雅的解决方案,本文将带您深入理解这一机制,掌握不同场景下的最佳实践,感兴趣的朋友一起看看吧... 目录1. 什么是事务传播行为2. Spring支持的七种事务传播行为2.1 REQUIRED(默认)2.2 SUPPORTS2

Qt QCustomPlot库简介(最新推荐)

《QtQCustomPlot库简介(最新推荐)》QCustomPlot是一款基于Qt的高性能C++绘图库,专为二维数据可视化设计,它具有轻量级、实时处理百万级数据和多图层支持等特点,适用于科学计算、... 目录核心特性概览核心组件解析1.绘图核心 (QCustomPlot类)2.数据容器 (QCPDataC

Java中的雪花算法Snowflake解析与实践技巧

《Java中的雪花算法Snowflake解析与实践技巧》本文解析了雪花算法的原理、Java实现及生产实践,涵盖ID结构、位运算技巧、时钟回拨处理、WorkerId分配等关键点,并探讨了百度UidGen... 目录一、雪花算法核心原理1.1 算法起源1.2 ID结构详解1.3 核心特性二、Java实现解析2.

MySQL 中 ROW_NUMBER() 函数最佳实践

《MySQL中ROW_NUMBER()函数最佳实践》MySQL中ROW_NUMBER()函数,作为窗口函数为每行分配唯一连续序号,区别于RANK()和DENSE_RANK(),特别适合分页、去重... 目录mysql 中 ROW_NUMBER() 函数详解一、基础语法二、核心特点三、典型应用场景1. 数据分