0

I'm trying to read laser scan data and then use that for building a map of the environment.

My problem is, that I don't understand in what format the data has to be provided to the CObservation2DRangeScan object.

I've tried:

X,Y,X,Y,...
Y,X,Y,X,...
X,X,Y,Y,...
Y,Y,X,X,...

I write the data into a rawlog file and then look at it in the rawlog viewer. I used [1,1] and the point appears at X=-1 and Y=0. Why is that?

Here is the data from the rawlog viewer

Timestamp (UTC): 2016/06/21,07:22:42.166880
(as time_t): 1466493762.16688
(as TTimestamp): 131109673621668800
Sensor label: ''

Homogeneous matrix for the sensor's 3D pose, relative to robot base:
1.00000 0.00000 0.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
0.00000 0.00000 0.00000 1.00000(x,y,z,yaw,pitch,roll)
(0.0000,0.0000,0.0000,0.00deg,-0.00deg,0.00deg)
Samples direction: Right->Left
Points in the scan: 2
Estimated sensor 'sigma': 0.010000
Increment in pitch during the scan: 0.000000 deg
Invalid points in the scan: 0
Sensor maximum range: 80.00 m 
Sensor field-of-view ("aperture"): 360.0 deg
Raw scan values: [1.000 1.000 ]
Raw valid-scan values: [1 1 ]

Here is the code that I'm using:

CSensoryFrame SF;

CActionCollection actionCol;

CPose2D actualOdometryReading(0.0f, 0.0f, DEG2RAD(.0f));

// Prepare the "options" structure:
CActionRobotMovement2D                      actMov;
CActionRobotMovement2D::TMotionModelOptions opts;

opts.modelSelection = CActionRobotMovement2D::mmThrun;
opts.thrunModel.alfa3_trans_trans = 0.10f;

// Create the probability density distribution (PDF) from a 2D odometry reading:
actMov.computeFromOdometry(actualOdometryReading, opts);

actionCol.insert(actMov);

CObservation2DRangeScanPtr myObs = CObservation2DRangeScan::Create();


myObs->scan = scan; // = [1,0]
myObs->validRange = vranges; // = [1,1]
myObs->aperture = 2 * M_PI;


SF.insert(myObs);
4

1 回答 1

0

我并不完全熟悉 MRPT 的激光数据类的细节,但在使用过其他机器人框架后,我可以告诉您,激光扫描通常表示为范围值的集合,而不是笛卡尔 (x,y) 坐标。确实,参考文献CObservation2DRangeScan说,

具有所有范围测量值的浮点值向量(以米为单位)。

你的程序的输出显示:

Raw scan values: [1.000 1.000 ]

即,1m 距离的两个范围测量。由于您的传感器配置为具有 360 度视野,因此第一次测量将在传感器姿势的 -180° 方向上进行。您的传感器面向 +X,因此该激光射线瞄准机器人“后面”,从而为您提供坐标 (−1, 0)。第二条(也是最后一条)测量射线朝向 +180°,给出相同的坐标。

尝试传入 1 米的 360 范围测量列表,您应该会看到与圆圈相对应的东西。

于 2016-06-21T07:51:28.060 回答