百度Apollo规划算法——OBB障碍物检测代码解析

这篇具有很好参考价值的文章主要介绍了百度Apollo规划算法——OBB障碍物检测代码解析。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

前言

本文主要分析Apollo代码中函数bool Box::HasOverlap(const Box2d &box) const {}的数学原理。

在阅读此部分代码时,第一遍没看懂return的一堆什么意思,百度之后说是采用OBB原理,所以就去了解下OBB原理,回来看还是没太明白,直到看到了博客[1],通过博主的图解才有了进一步的了解,但对照代码还是没能完全理解,后来结合向量的相关知识,才算彻底明白了HasOverlap()实现的具体数学原理。
下面,作者仅对代码进行数学解读。

代码

直接上代码,代码路径/self_driving/Optimization/Apollo-DL-IAPS/util/box2d.cc,作者在这里将代码划分为几个部分分别解读。Apollo对Box2d的碰撞检测分为两步进行,第一步使用AABB进行粗检测(f1部分)快速剔除非碰撞的box,第二部分使用OBB进行细检测(f2~f6部分),对f1检测到有碰撞的box进一步进行检测。

bool Box2d::HasOverlap(const Box2d &box) const {
  // f1
  if (box.max_x() < min_x() || box.min_x() > max_x() || box.max_y() < min_y() ||
      box.min_y() > max_y()) {
    return false;
  }

  //f2
  const double shift_x = box.center_x() - center_.x();
  const double shift_y = box.center_y() - center_.y();

  const double dx1 = cos_heading_ * half_length_;
  const double dy1 = sin_heading_ * half_length_;
  const double dx2 = sin_heading_ * half_width_;
  const double dy2 = -cos_heading_ * half_width_;
  const double dx3 = box.cos_heading() * box.half_length();
  const double dy3 = box.sin_heading() * box.half_length();
  const double dx4 = box.sin_heading() * box.half_width();
  const double dy4 = -box.cos_heading() * box.half_width();

  //f3
  return std::abs(shift_x * cos_heading_ + shift_y * sin_heading_) <=
             std::abs(dx3 * cos_heading_ + dy3 * sin_heading_) +
                 std::abs(dx4 * cos_heading_ + dy4 * sin_heading_) +
                 half_length_ &&
  //f4
         std::abs(shift_x * sin_heading_ - shift_y * cos_heading_) <=
             std::abs(dx3 * sin_heading_ - dy3 * cos_heading_) +
                 std::abs(dx4 * sin_heading_ - dy4 * cos_heading_) +
                 half_width_ &&
  //f5
         std::abs(shift_x * box.cos_heading() + shift_y * box.sin_heading()) <=
             std::abs(dx1 * box.cos_heading() + dy1 * box.sin_heading()) +
                 std::abs(dx2 * box.cos_heading() + dy2 * box.sin_heading()) +
                 box.half_length() &&
  //f6
         std::abs(shift_x * box.sin_heading() - shift_y * box.cos_heading()) <=
             std::abs(dx1 * box.sin_heading() - dy1 * box.cos_heading()) +
                 std::abs(dx2 * box.sin_heading() - dy2 * box.cos_heading()) +
                 box.half_width();
}

代码分析

f1

AABB检测用于粗检测,根据自车和障碍物的box角点构建两个长宽分别平行于坐标轴的box,查看这两个box(两个虚线box表示)是否有交集,可以直接根据新构建的box的角点的坐标值来判断。如下图所示,通过这种方式可以粗略检测到A、B有碰撞,但是是否真的有碰撞还需要通过OBB进一步检测。
百度Apollo规划算法——OBB障碍物检测代码解析,Apollo,自动驾驶运动规划,算法,自动驾驶,碰撞检测,障碍物

f2

根据OBB检测原理,构建向量如下图所示:
百度Apollo规划算法——OBB障碍物检测代码解析,Apollo,自动驾驶运动规划,算法,自动驾驶,碰撞检测,障碍物
假设有两个Box类型的对象A和B,计算A.HasOverlap(B)的结果。
以下两行代码计算的时A的中心到B的中心的向量

  const double shift_x = box.center_x() - center_.x();
  const double shift_y = box.center_y() - center_.y();

转换为数学计算为:
a b ⃗ = ( x s h i f t , y s h i f t ) = ( B . x c e n t e r − A . x c e n t e r , B . y c e n t e r − A . y c e n t e r ) (1) \vec{ab}=(x_{shift},y_{shift})=(B.x_{center}-A.x_{center},B.y_{center}-A.y_{center})\tag{1} ab =(xshift,yshift)=(B.xcenterA.xcenter,B.ycenterA.ycenter)(1)
以下四行代码是分别计算A的纵向方向(指box的朝向)和横向方向的两个向量,其中纵向方向的向量模为 l e n g t h h a l f length_{half} lengthhalf,横向方向的向量模为 w i d t h h a l f width_{half} widthhalf

  const double dx1 = cos_heading_ * half_length_;
  const double dy1 = sin_heading_ * half_length_;
  const double dx2 = sin_heading_ * half_width_;
  const double dy2 = -cos_heading_ * half_width_;

纵向向量:
v 1 ⃗ = ( d x 1 , d y 1 ) = A . l e n g t h h a l f ⋅ ( cos ⁡ ( h e a d i n g A ) , sin ⁡ ( h e a d i n g A ) ) (2) \vec{v_1}=(dx1,dy1)=A.length_{half}\cdot(\cos(heading_A),\sin(heading_A))\tag{2} v1 =(dx1,dy1)=A.lengthhalf(cos(headingA),sin(headingA))(2)
横向向量:
v 2 ⃗ = ( d x 2 , d y 2 ) = A . w i d t h h a l f ⋅ ( sin ⁡ ( h e a d i n g A ) , − cos ⁡ ( h e a d i n g A ) ) (3) \vec{v_2}=(dx2,dy2)=A.width_{half}\cdot(\sin(heading_A),-\cos(heading_A))\tag{3} v2 =(dx2,dy2)=A.widthhalf(sin(headingA),cos(headingA))(3)
其中, h e a d i n g A heading_A headingA为A的方向角,则 ( cos ⁡ ( h e a d i n g A ) ,   s i n ( h e a d i n g A ) ) (\cos(heading_A),\ sin(heading_A)) (cos(headingA), sin(headingA))为A的单位方向向量, ( sin ⁡ ( h e a d i n g A ) , − cos ⁡ ( h e a d i n g A ) (\sin(heading_A),-\cos(heading_A) (sin(headingA),cos(headingA)为A的单位法向量(为啥单位法向量这样表示?可参考线性代数相关知识)。

同理,以下四行代码分别计算的是B的纵向方向和横向方向的两个向量,纵向方向向量和横向方向向量的模分别是B的半长 l e n g t h h a l f length_{half} lengthhalf,半宽 w i d t h h a l f width_{half} widthhalf

  const double dx3 = box.cos_heading() * box.half_length();
  const double dy3 = box.sin_heading() * box.half_length();
  const double dx4 = box.sin_heading() * box.half_width();
  const double dy4 = -box.cos_heading() * box.half_width();

纵向向量:
v 3 ⃗ = ( d x 3 , d y 3 ) = B . l e n g t h h a l f ⋅ ( cos ⁡ ( h e a d i n g B ) , sin ⁡ ( h e a d i n g B ) ) (4) \vec{v_3}=(dx3,dy3)=B.length_{half}\cdot(\cos(heading_B),\sin(heading_B))\tag{4} v3 =(dx3,dy3)=B.lengthhalf(cos(headingB),sin(headingB))(4)
横向向量:
v 4 ⃗ = ( d x 4 , d y 4 ) = B . w i d t h h a l f ⋅ ( sin ⁡ ( h e a d i n g B ) , − cos ⁡ ( h e a d i n g B ) ) (5) \vec{v_4}=(dx4,dy4)=B.width_{half}\cdot(\sin(heading_B),-\cos(heading_B))\tag{5} v4 =(dx4,dy4)=B.widthhalf(sin(headingB),cos(headingB))(5)
其中, h e a d i n g B heading_B headingB为B的方向角,则 ( cos ⁡ ( h e a d i n g B ) ,   s i n ( h e a d i n g B ) ) (\cos(heading_B),\ sin(heading_B)) (cos(headingB), sin(headingB))为B的单位方向向量, ( sin ⁡ ( h e a d i n g B ) , − cos ⁡ ( h e a d i n g B ) (\sin(heading_B),-\cos(heading_B) (sin(headingB),cos(headingB)为A的单位法向量。

f3

f 3 f3 f3表示的是计算往A纵轴上的投影

std::abs(shift_x * cos_heading_ + shift_y * sin_heading_) <=
             std::abs(dx3 * cos_heading_ + dy3 * sin_heading_) +
                 std::abs(dx4 * cos_heading_ + dy4 * sin_heading_) +
                 half_length_

如下图所示
百度Apollo规划算法——OBB障碍物检测代码解析,Apollo,自动驾驶运动规划,算法,自动驾驶,碰撞检测,障碍物
结合代码和图片一块分析:
(1)代码中std::abs(shift_x * cos_heading_ + shift_y * sin_heading_)所表示的是向量 a b ⃗ \vec{ab} ab 在A的纵轴上投影的模c,结合公式(1)可知:
c = ∣ a b ⃗ ⋅ ( cos ⁡ ( h e a d i n g A ) , sin ⁡ ( h e a d i n g A ) ) ∣ = ∣ x s h i f t ⋅ cos ⁡ ( h e a d i n g A ) + y s h i f t ⋅ sin ⁡ ( h e a d i n g A ) ∣ c=|\vec{ab}\cdot(\cos(heading_A),\sin(heading_A))|=|x_{shift}\cdot\cos(heading_A)+y_{shift}\cdot\sin(heading_A)| c=ab (cos(headingA),sin(headingA))=xshiftcos(headingA)+yshiftsin(headingA)
(2)代码中std::abs(dx3 * cos_heading_ + dy3 * sin_heading_)所表示的是向量 v 3 ⃗ \vec{v_3} v3 在A的纵轴上投影的模 b 1 b1 b1,结合公式(4)可知:
b 1 = ∣ v 3 ⃗ ⋅ ( cos ⁡ ( h e a d i n g A ) , sin ⁡ ( h e a d i n g A ) ) ∣ = ∣ d x 3 ⋅ cos ⁡ ( h e a d i n g A ) + d y 3 ⋅ sin ⁡ ( h e a d i n g A ) ∣ b1=|\vec{v_3}\cdot(\cos(heading_A),\sin(heading_A))|=|dx3\cdot\cos(heading_A)+dy3\cdot\sin(heading_A)| b1=v3 (cos(headingA),sin(headingA))=dx3cos(headingA)+dy3sin(headingA)
代码中std::abs(dx4 * cos_heading_ + dy4 * sin_heading_)所表示的是向量 v 4 ⃗ \vec{v_4} v4 在A的纵轴上投影的模 b 2 b2 b2,结合公式(5)可知:
b 2 = ∣ v 4 ⃗ ⋅ ( cos ⁡ ( h e a d i n g A ) , sin ⁡ ( h e a d i n g A ) ) ∣ = ∣ d x 4 ⋅ cos ⁡ ( h e a d i n g A ) + d y 4 ⋅ sin ⁡ ( h e a d i n g A ) ∣ b2=|\vec{v_4}\cdot(\cos(heading_A),\sin(heading_A))|=|dx4\cdot\cos(heading_A)+dy4\cdot\sin(heading_A)| b2=v4 (cos(headingA),sin(headingA))=dx4cos(headingA)+dy4sin(headingA)
由上图可知:
b = b 1 + b 2 b=b1+b2 b=b1+b2
(3)代码中half_length_是向量 v 1 ⃗ \vec{v_1} v1 在其纵轴上的投影的模,另外,向量 v 2 ⃗ \vec{v_2} v2 此时在其纵轴上投影的模为0。
c 1 = b + l e n g t h h a l f c1=b+length_{half} c1=b+lengthhalf

f4

f 4 f4 f4表示的是计算往A横轴上的投影

 std::abs(shift_x * sin_heading_ - shift_y * cos_heading_) <=
     std::abs(dx3 * sin_heading_ - dy3 * cos_heading_) +
         std::abs(dx4 * sin_heading_ - dy4 * cos_heading_) +
         half_width_

如下图所示
百度Apollo规划算法——OBB障碍物检测代码解析,Apollo,自动驾驶运动规划,算法,自动驾驶,碰撞检测,障碍物
结合代码和图片一块分析:
(1)代码中std::abs(shift_x * sin_heading_ - shift_y * cos_heading_)所表示的是向量 a b ⃗ \vec{ab} ab 在A的横轴上投影的模c,结合公式(1)可知:
c = ∣ a b ⃗ ⋅ ( sin ⁡ ( h e a d i n g A ) , − cos ⁡ ( h e a d i n g A ) ) ∣ = ∣ x s h i f t ⋅ sin ⁡ ( h e a d i n g A ) − y s h i f t ⋅ cos ⁡ ( h e a d i n g A ) ∣ c=|\vec{ab}\cdot(\sin(heading_A),-\cos(heading_A))|=|x_{shift}\cdot\sin(heading_A)-y_{shift}\cdot\cos(heading_A)| c=ab (sin(headingA),cos(headingA))=xshiftsin(headingA)yshiftcos(headingA)
(2)代码中std::abs(dx3 * sin_heading_ - dy3 * cos_heading_)所表示的是向量 v 3 ⃗ \vec{v_3} v3 在A的横轴上投影的模 b 1 b1 b1,结合公式(4)可知:
b 1 = ∣ v 3 ⃗ ⋅ ( sin ⁡ ( h e a d i n g A ) , − cos ⁡ ( h e a d i n g A ) ) ∣ = ∣ d x 3 ⋅ sin ⁡ ( h e a d i n g A ) − d y 3 ⋅ cos ⁡ ( h e a d i n g A ) ∣ b1=|\vec{v_3}\cdot(\sin(heading_A),-\cos(heading_A))|=|dx3\cdot\sin(heading_A)-dy3\cdot\cos(heading_A)| b1=v3 (sin(headingA),cos(headingA))=dx3sin(headingA)dy3cos(headingA)
代码中std::abs(dx4 * sin_heading_ - dy4 * cos_heading_)所表示的是向量 v 4 ⃗ \vec{v_4} v4 在A的横轴上投影的模 b 2 b2 b2,结合公式(5)可知:
b 2 = ∣ v 4 ⃗ ⋅ ( sin ⁡ ( h e a d i n g A ) , − cos ⁡ ( h e a d i n g A ) ) ∣ = ∣ d x 4 ⋅ sin ⁡ ( h e a d i n g A ) − d y 4 ⋅ cos ⁡ ( h e a d i n g A ) ∣ b2=|\vec{v_4}\cdot(\sin(heading_A),-\cos(heading_A))|=|dx4\cdot\sin(heading_A)-dy4\cdot\cos(heading_A)| b2=v4 (sin(headingA),cos(headingA))=dx4sin(headingA)dy4cos(headingA)
由上图可知:
b = b 1 + b 2 b=b1+b2 b=b1+b2
(3)代码中half_width_是向量 v 2 ⃗ \vec{v_2} v2 在其横轴上的投影的模,另外,向量 v 1 ⃗ \vec{v_1} v1 此时在其横轴上投影的模为0。
c 1 = b + w i d t h h a l f c1=b+width_{half} c1=b+widthhalf

f5

f 5 f5 f5表示的是计算往B纵轴上的投影

std::abs(shift_x * box.cos_heading() + shift_y * box.sin_heading()) <=
    std::abs(dx1 * box.cos_heading() + dy1 * box.sin_heading()) +
        std::abs(dx2 * box.cos_heading() + dy2 * box.sin_heading()) +
        box.half_length()

如下图所示:
百度Apollo规划算法——OBB障碍物检测代码解析,Apollo,自动驾驶运动规划,算法,自动驾驶,碰撞检测,障碍物
结合代码和图片一块分析:
(1)代码中std::abs(shift_x * box.cos_heading() + shift_y * box.sin_heading())所表示的是向量 a b ⃗ \vec{ab} ab 在B的纵轴上投影的模c,结合公式(1)可知:
c = ∣ a b ⃗ ⋅ ( cos ⁡ ( h e a d i n g B ) , sin ⁡ ( h e a d i n g B ) ) ∣ = ∣ x s h i f t ⋅ cos ⁡ ( h e a d i n g B ) + y s h i f t ⋅ sin ⁡ ( h e a d i n g B ) ∣ c=|\vec{ab}\cdot(\cos(heading_B),\sin(heading_B))|=|x_{shift}\cdot\cos(heading_B)+y_{shift}\cdot\sin(heading_B)| c=ab (cos(headingB),sin(headingB))=xshiftcos(headingB)+yshiftsin(headingB)
(2)代码中std::abs(dx1 * box.cos_heading() + dy1 * box.sin_heading())所表示的是向量 v 1 ⃗ \vec{v_1} v1 在B的纵轴上投影的模 a 1 a1 a1,结合公式(2)可知:
a 1 = ∣ v 1 ⃗ ⋅ ( cos ⁡ ( h e a d i n g B ) , sin ⁡ ( h e a d i n g B ) ) ∣ = ∣ d x 1 ⋅ cos ⁡ ( h e a d i n g B ) + d y 1 ⋅ sin ⁡ ( h e a d i n g B ) ∣ a1=|\vec{v_1}\cdot(\cos(heading_B),\sin(heading_B))|=|dx1\cdot\cos(heading_B)+dy1\cdot\sin(heading_B)| a1=v1 (cos(headingB),sin(headingB))=dx1cos(headingB)+dy1sin(headingB)
代码中std::abs(dx2 * box.cos_heading() + dy2 * box.sin_heading())所表示的是向量 v 2 ⃗ \vec{v_2} v2 在B的纵轴上投影的模 a 2 a2 a2,结合公式(3)可知:
a 2 = ∣ v 2 ⃗ ⋅ ( cos ⁡ ( h e a d i n g B ) , sin ⁡ ( h e a d i n g B ) ) ∣ = ∣ d x 2 ⋅ cos ⁡ ( h e a d i n g B ) + d y 2 ⋅ sin ⁡ ( h e a d i n g B ) ∣ a2=|\vec{v_2}\cdot(\cos(heading_B),\sin(heading_B))|=|dx2\cdot\cos(heading_B)+dy2\cdot\sin(heading_B)| a2=v2 (cos(headingB),sin(headingB))=dx2cos(headingB)+dy2sin(headingB)
由上图可知:
a = a 1 + a 2 a=a1+a2 a=a1+a2
(3)代码中half_length是向量 v 3 ⃗ \vec{v_3} v3 在其纵轴上的投影的模,另外,向量 v 4 ⃗ \vec{v_4} v4 此时在其纵轴上投影的模为0。
c 1 = a + l e n g t h h a l f c1=a+length_{half} c1=a+lengthhalf

f6

f 6 f6 f6表示的是计算往B横轴上的投影

std::abs(shift_x * box.sin_heading() - shift_y * box.cos_heading()) <=
    std::abs(dx1 * box.sin_heading() - dy1 * box.cos_heading()) +
        std::abs(dx2 * box.sin_heading() - dy2 * box.cos_heading()) +
        box.half_width()

如下图所示:
百度Apollo规划算法——OBB障碍物检测代码解析,Apollo,自动驾驶运动规划,算法,自动驾驶,碰撞检测,障碍物
结合代码和图片一块分析:
(1)代码中std::abs(shift_x * box.sin_heading() - shift_y * box.cos_heading())所表示的是向量 a b ⃗ \vec{ab} ab 在B的横轴上投影的模c,结合公式(1)可知:
c = ∣ a b ⃗ ⋅ ( sin ⁡ ( h e a d i n g B ) , − cos ⁡ ( h e a d i n g B ) ) ∣ = ∣ x s h i f t ⋅ sin ⁡ ( h e a d i n g B ) − y s h i f t ⋅ cos ⁡ ( h e a d i n g B ) ∣ c=|\vec{ab}\cdot(\sin(heading_B),-\cos(heading_B))|=|x_{shift}\cdot\sin(heading_B)-y_{shift}\cdot\cos(heading_B)| c=ab (sin(headingB),cos(headingB))=xshiftsin(headingB)yshiftcos(headingB)
(2)代码中std::abs(dx1 * box.sin_heading() - dy1 * box.cos_heading())所表示的是向量 v 1 ⃗ \vec{v_1} v1 在B的横轴上投影的模 a 1 a1 a1,结合公式(2)可知:
a 1 = ∣ v 1 ⃗ ⋅ ( sin ⁡ ( h e a d i n g B ) , − cos ⁡ ( h e a d i n g B ) ) ∣ = ∣ d x 1 ⋅ sin ⁡ ( h e a d i n g B ) − d y 1 ⋅ cos ⁡ ( h e a d i n g B ) ∣ a1=|\vec{v_1}\cdot(\sin(heading_B),-\cos(heading_B))|=|dx1\cdot\sin(heading_B)-dy1\cdot\cos(heading_B)| a1=v1 (sin(headingB),cos(headingB))=dx1sin(headingB)dy1cos(headingB)
代码中std::abs(dx2 * box.sin_heading() - dy2 * box.cos_heading())所表示的是向量 v 2 ⃗ \vec{v_2} v2 在B的横轴上投影的模 a 2 a2 a2,结合公式(3)可知:
a 2 = ∣ v 2 ⃗ ⋅ ( sin ⁡ ( h e a d i n g B ) , − cos ⁡ ( h e a d i n g B ) ) ∣ = ∣ d x 2 ⋅ sin ⁡ ( h e a d i n g B ) − d y 2 ⋅ cos ⁡ ( h e a d i n g B ) ∣ a2=|\vec{v_2}\cdot(\sin(heading_B),-\cos(heading_B))|=|dx2\cdot\sin(heading_B)-dy2\cdot\cos(heading_B)| a2=v2 (sin(headingB),cos(headingB))=dx2sin(headingB)dy2cos(headingB)
由上图可知:
a = a 1 + a 2 a=a1+a2 a=a1+a2
(3)代码中half_width是向量 v 4 ⃗ \vec{v_4} v4 在其横轴上的投影的模,另外,向量 v 3 ⃗ \vec{v_3} v3 此时在其横轴上投影的模为0。
c 1 = a + w i d t h h a l f c1=a+width_{half} c1=a+widthhalf

若步骤f3~f6均满足 c < = c 1 c<=c1 c<=c1,则可判定两个Box存在碰撞(具体原理可参考OBB原理)。

参考

[1] Apollo中Lattice轨迹碰撞检测
[2]自动驾驶运动规划中的碰撞检测文章来源地址https://www.toymoban.com/news/detail-624622.html

到了这里,关于百度Apollo规划算法——OBB障碍物检测代码解析的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包赞助服务器费用

相关文章

  • 【路径规划】粒子群算法求解机器人障碍物环境的Voronoi图路径规划【含GUI Matlab源码 3748期】

    【路径规划】粒子群算法求解机器人障碍物环境的Voronoi图路径规划【含GUI Matlab源码 3748期】

    粒子群算法(Particle Swarm Optimization, PSO)可以用于栅格地图上机器人的最短路径规划。在这种问题中,栅格地图被划分为离散的单元格,每个单元格可以是阻挡或可通过的区域。机器人需要从起始位置移动到目标位置,避免碰到阻挡。 PSO算法中,通过使用一群粒子来搜索最优

    2024年01月17日
    浏览(50)
  • 第九章动态规划——不同路径(二)有障碍物

    第九章动态规划——不同路径(二)有障碍物

    目录 力扣题号:63. 不同路径 II - 力扣(LeetCode) 题目描述 示例 提示 思路 解法一:动态规划 (1)dp数组的下标及其含义 (2)确定递推公式 (3)初始化递推数组 (4)确定遍历顺序 (5)根据题意推出dp数组对照 障碍物处理 代码实现 总结 注:下述题目描述和示例均来自力

    2024年04月23日
    浏览(13)
  • Python 动态规划 实现机器人躲避障碍物获取最短路径

    要设计一种算法来寻找机器人从左上角移动到右下角的路径,可以使用动态规划来解决这个问题。下面是一种可能的算法: 创建一个处理机器人运动的函数 find_path ,函数接受一个矩阵 grid 作为参数,用于表示机器人移动的网格环境,该矩阵一个由 0 和 1 组成的二位列表,其

    2024年04月09日
    浏览(10)
  • 动态规划解“不同路径问题”(所有路径、有障碍物时的所有路径)

    动态规划解“不同路径问题”(所有路径、有障碍物时的所有路径)

    题目1:不同路径(求到达右下角的所有路径) 一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为 “Start” )。 机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为 “Finish” )。 问总共有多少条不同的路径?    解题思路

    2024年02月14日
    浏览(8)
  • 【动态规划之路径问题】路径条数与带障碍物的路径条数

    【动态规划之路径问题】路径条数与带障碍物的路径条数

    ⭐️ 前面的话 ⭐️ 本篇文章将介绍动态规划之路径条数的问题,我将通过两道力扣上面的题来介绍使用动态规划来解决路径条数问题以及路上存在障碍物时路径的条数。 📒博客主页:未见花闻的博客主页 🎉欢迎关注🔎点赞👍收藏⭐️留言📝 📌本文由 未见花闻 原创,

    2023年04月09日
    浏览(9)
  • opencv案例06-基于opencv图像匹配的消防通道障碍物检测与深度yolo检测的对比

    opencv案例06-基于opencv图像匹配的消防通道障碍物检测与深度yolo检测的对比

    技术背景 消防通道是指在各种险情发生时,用于消防人员实施营救和被困人员疏散的通道。消防法规定任何单位和个人不得占用、堵塞、封闭消防通道。事实上,由于消防通道通常缺乏管理,导致各种垃圾,物品以及车辆等障碍物常常出现在消防通道中,堵塞消防通道,当险

    2024年02月03日
    浏览(11)
  • 【路径规划】人工势场法APF机器人不同形状障碍物避障路径规划【含Matlab源码 3705期】

    【路径规划】人工势场法APF机器人不同形状障碍物避障路径规划【含Matlab源码 3705期】

    ✅博主简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,Matlab项目合作可私信。 🍎个人主页:海神之光 🏆代码获取方式: 海神之光Matlab王者学习之路—代码获取方式 ⛳️座右铭:行百里者,半于九十。 更多Matlab仿真内容点击👇 Matlab图像处理(进阶版) 路径规划

    2024年02月20日
    浏览(15)
  • 毕业设计-基于深度学习的交通路面障碍物目标检测系统 YOLO python 卷积神经网络 人工智能

    毕业设计-基于深度学习的交通路面障碍物目标检测系统 YOLO python 卷积神经网络 人工智能

    目录  前言 设计思路 一、课题背景与意义 二、算法理论原理 三、检测的实现 3.1 数据集 3.2 实验及结果分析 实现效果图样例 最后        📅大四是整个大学期间最忙碌的时光,一边要忙着备考或实习为毕业后面临的就业升学做准备,一边要为毕业设计耗费大量精力。近几年各

    2024年02月03日
    浏览(17)
  • 10.Unity2D 横版 简单AI 之 敌人随机移动+自动巡逻+障碍物跳跃+悬崖处转身+射线检测

    10.Unity2D 横版 简单AI 之 敌人随机移动+自动巡逻+障碍物跳跃+悬崖处转身+射线检测

    总目录 9.Unity2D 简单AI 之 敌人跳跃条件优化+自动范围内检测敌人发起攻击(索敌)+对象池优化+主角受伤死亡_ζั͡ ั͡雾 ั͡狼 ั͡✾的博客-CSDN博客 Unity2D 简单AI 之 敌人跳跃条件优化+自动范围内检测敌人攻击+敌人二连击。在敌人预制体下,创建空物体EnemyCanAttack,改成不

    2023年04月20日
    浏览(24)
  • ros机器人在navigation下导航costmap_2d动态层(障碍物层)障碍物无法及时消除的情况解决办法

    ros机器人在navigation下导航costmap_2d动态层(障碍物层)障碍物无法及时消除的情况解决办法

    设备 杉川-3a激光雷达 win10笔记本电脑 ubuntu18.04 ros-melodic 问题 ros机器人在move_base下导航,有静态图层与动态图层,静态图层显示之前已经建立好的地图,而动态层显示现在激光雷达实时扫描到的障碍物。 假设机器人雷达最大范围为8m,在某一时刻,以机器人为原点,在机器人

    2024年02月06日
    浏览(9)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包