智能机器人(53):定位调试

Q:
性能的平衡
A:
各sensor发布topic, amcl和robot_pose_ekf模块发布tf, 这些frequency需要和cpu性能进行trade-off, 搞折衷做平衡。

top查看系统性能,’1′ 查看多核的具体cpu, 节后’b’ ‘x’ ‘y’等指令, 并要关注average load指标:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
14706 ubuntu 20 0 296736 212296 5564 R 71.5 11.0 1:51.56 amcl
14245 ubuntu 20 0 79408 5592 4792 S 47.0 0.3 2:30.72 laser_node
14250 ubuntu 20 0 105876 5348 4616 S 3.0 0.3 0:09.73 lpms_imu_node
23344 ubuntu 20 0 91032 6960 6140 S 4.0 0.4 0:00.77 robot_pose_ekf
这个就好了。

如果配置不切实际, 类似arm板配置20Hz的transform frequency, 则资源受限出错:
$ roswtf
— —
ERROR: receiving transform from [/amcl] that differed from ROS time by 2.96s
这个时间,设置的越快会,大的越夸张。

此外还要关注内存情况:
$ free -m
— —

也要关注磁盘介质:
$ df -h

$ du -h –max-depth=1

Q:
amcl的node会die掉

$ rosnode ping amcl
— —
ERROR: connection refused to [http://192.168.0.40:38282/]

查看 ~/.ros/log/latest/… …/amcl-1.log:
amcl: /tmp/buildd/ros-indigo-amcl-1.12.4-0trusty-20150604-0435/src/amcl/pf/pf_kdtree.c:378: pf_kdtree_cluster: Assertion `node == pf_kdtree_find_node(self, self->root, node->key)’ failed.
Aborted (core dumped)

A:
原因是激光雷达被不恰当遮挡, pf程序没有足够健壮导致的。

Q:
ERROR: receiving transform from [/robot_state_publisher] that differed from ROS time by 12.34s
A:
如果是多机系统:
可能是没有进行时间同步。
$ install chrony
$ sudo ntpdate 192.168.1.1 <--- 如果是单机系统系统, 而且时间相差很大: 可能是/use_sime_time要为false。 如果是单机系统系统, 时间相差细微: 第一感就是降低某些重载模块的频率, 50Hz ---> 20Hz—>5Hz。
或者换个PC。

Q:
WARNING The following node subscriptions are unconnected:
* /amcl:
* /tf_static
* /robot_pose_ekf:
* /tf_static
A:
roswtf发出的警告,说amcl节点订阅了tf_static这个topic,但是却没有其他节点发布内容的topic。
这个警告正是所期望看到的:
因为我们没有使用tf_static来发布模型urdf,所以可以忽略这些警告。

0 回复

发表评论

Want to join the discussion?
Feel free to contribute!

发表评论