gmapping 中一些關鍵定義

2021-10-02 01:33:39 字數 2389 閱讀 7865

/**所有粒子的濾波結構體陣列*/

typedef std::vectorparticlevector;   

particlevector m_particles;

/** 粒子濾波器中的粒子結構體  每個粒子有自己的地圖、位姿、權重、軌跡

* 軌跡是按照時間順序排列的,葉子節點表示最近的節點

*/

struct particle

inline operator orientedpoint() const

inline void setweight(double w)

/* the map 地圖 高解析度地圖*/

scanmatchermap map;

/** the pose of the robot 機械人位姿*/

orientedpoint pose;

/*機械人上一幀的位姿 這個位姿是用來計算里程計的位移的*/

orientedpoint previouspose;

/*粒子的權重*/

double weight;

/*粒子的累計權重*/

double weightsum;

double gweight;

/*上乙個粒子的下標*/

int previousindex;

// 該粒子對應的整條軌跡 記錄的是粒子的最近的乙個節點

tnode* node;

};

tnode 樹的定義,在gridslamprocessor.h 中

/**該類定義儲存軌跡的反向樹的節點。

樹的每個節點都有乙個指向父節點的指標和乙個指示子節點數目的計數器。

更新樹的方式與對粒子執行的操作一致

//樹的節點,乙個樹儲存了一整條軌跡,乙個節點表示這條軌跡中的其中乙個點。

//因為fastslam是乙個full slam的方法,因此它需要儲存機械人的整條軌跡。

//軌跡上的乙個節點(相當於一幀)儲存了一下幾個資訊:

機械人的位姿

該節點粒子的權重

軌跡前面所有的節點的粒子的權重之和

指向父節點的指標

子節點的數量

*/

struct tnode;
orientedpoint 的定義在utils/point.h 中

/*帶方向的點  即除了位置之外,還有角度,可以理解為機械人的位姿*/

template

struct orientedpoint: public point;

inline orientedpoint(const point& p);

inline orientedpoint(t x, t y, a _theta): point(x,y), theta(_theta){}

inline void normalize();

inline orientedpointrotate(a alpha)

a theta;

map地圖的定義:(在smmap.h中)

//定義最終使用的地圖資料型別 cell型別為pointaccumulator

//儲存資料型別為hierarchicalarray2d,在grid/harray2d.h中

typedef map> scanmatchermap;

cell柵格的定義:

/*表示地圖中的乙個cell*/

struct pointaccumulator

pointaccumulator(int i): acc(0,0), n(0), visits(0)

inline void update(bool value, const point& p=point(0,0));

inline point mean() const

/*返回被占用的概率*/

inline operator double() const

inline void add(const pointaccumulator& p)

static const pointaccumulator& unknown();

static pointaccumulator* unknown_ptr;

/** cell的位置的累計值 這裡認為每個cell算被擊中的時候,有可能不是在同乙個位置被擊中的

* 畢竟在查詢對應點的時候是在乙個kernelsize的視窗裡面進行查詢的,所以這裡累計被擊中的座標值。

* 而這個cell的真實座標由這些累計值的均值表示

*/floatpoint acc;

/*n表示被hit中的次數  visits表示訪問的次數*/

int n, visits;

inline double entropy() const;

};

gluoncv中一些關鍵函式解析

1 按名稱返回預定義的模型引數,名稱 str模型的名稱。pretrained bool或str布林值控制是否為模型載入預設的預訓練權重 1 從函式的名字可以看出,此函式主要是把獲取的frame進行轉化,轉化為yolo可以接受的引數格式。2 此函式有2個返回結果 x為ndarray,shape為 ba...

PLSQL中一些特殊型別定義方法

plsql中一些特殊型別定義方法 1.record 初始不存在資料 declare 定義型別 type record type name is record column name column type,或record type name table name rowtype 這樣省去了乙個個定義...

PB中一些技巧

取資料視窗中可列新的表名。string ls table ls table dw 1.describe datawindow.updatetable.table 22.取資料視窗物件中列的名稱及型別 string ls cols,ls types intli count,i li count int...