Person Follower
来源:互联网 发布:spss 23 for mac 破解 编辑:程序博客网 时间:2024/06/15 16:59
Person Follower
使用的环境
- Ubuntu14.04
- ROS 版本indigo
- 使用的是rbx1的follower
- 底盘用的是handsfree
运行roscore,然后运行底盘的驱动程序,根据不同的底盘运行不同的驱动。
roslaunch handsfree_hw handsfree_hw.launch
然后运行深度摄像头的驱动程序。
roslaunch handsfree_bringup xtion_fake_laser_openni2.launch
最后运行follower.py
rosrun rbx1_apps follower.py
或者运行它的.launch文件,在.launch文件里面修改参数相对简单一点
roslaunch rbx1_apps follower.launch
到这里,一般来说直接运行不经过参数调成,跟随会特别晃动,那是因为里面的参数都不是根据现在的情况来设定的。
我们进入自己的工作区域在src里面找到rbx1/rbx1_apps/nodes/follower.py。这里以.py为例.launch同样的修改方法
设定人物的身高和横纵范围,参数“min_x”和“max_x”可以设置人物横向范围,大致可以参考自己肩宽。参数“y”下面也有两个最大最小值用来框定人物从前到后长度,“z”则设置为自己的身高,这三个坐标实际上在摄像头面前设置了一个长宽高为“xyz”的长方体,ROS称之为敏感区域,当人物进入该范围,摄像头检测到的点云信息的“xyz”坐标符合设定区间后就进入跟随状态。
self.min_x = rospy.get_param("~min_x", -0.2) self.max_x = rospy.get_param("~max_x", 0.2) self.min_y = rospy.get_param("~min_y", -0.3) self.max_y = rospy.get_param("~max_y", 0.5) self.max_z = rospy.get_param("~max_z", 1.2)
设定小车与人之间的距离“goal_z”,决定了小车该停在多远的距离
self.goal_z = rospy.get_param(“~goal_z”,1.0)
“z_threshold”为一个距离边缘值,用来判断小车是否快要到达指定距离的界限值,如果小车前后晃动厉害可以尝试加大该值。
self.z_threshold = rospy.get_param(“~z_threshold”,0.05)
“x_threshold”为中心边缘值,即用来判断人是否快要接近中心点。同样小车左右晃动厉害可以尝试加大该值,但是过大可能会让小车不能正中地面对被跟随的人物运动起来可能更加晃动。
self.x_threshold = rospy.get_param(“~x_threshold”,0.05)
“z_scale” 和“x_scale”分别是线速度和角速度的权值,通过调整这两个参数来控制线速度和角速度的加速快慢。
设定线速度跟角速度的最大最小值。
self.max_angular_speed = rospy.get_param(“~max_angular_speed”, 2.0)self.min_angular_speed = rospy.get_param(“~min_angular_speed”, 0.0) self.max_linear_speed = rospy.get_param(“~max_linear_speed”, 0.3) self.min_linear_speed = rospy.get_param("~min_linear_speed", 0.1)
参数配置完记得修改发送和接受的话题名字,如果使用的是.launch文件则修改.launch文件下的话题名称,如果不知道需要修改成什么话题的话,可以用rostopic list来查看一下话题。
rospy.Subscriber('point_cloud', PointCloud2, self.set_cmd_vel) rospy.wait_for_message('point_cloud', PointCloud2)
follower.py里的决策函数set_cmd_vel(self,msg)
-通过读取一定数量的点云信息points的0到3为分别对应xyz的值,来判断人物是否进入判断的区域,即之前设置的xyz的最大最小值。
-每一次回调都会吧xyz和n的值清零,n是点的数量
-通过就算区域内的值xyz各个轴的平均值分别x跟水平的中心对比,y跟设定的距离值对比来做出运动判断,然后进行消息发布
-如果设定的xyz区域太大的话人靠近附近的障碍物,会造成识别错误
-设定高度跟停车距离要配合摄像头的采样的仰角,距离太近设定高度过高的,超过了摄像头的采样局域也有可能识别不出人
-follower.py只是一个模糊的跟随,精度有限,出现误跟随的情况也不少
- Person Follower
- person
- person
- Person
- leader follower
- leader-follower 模型读书笔记
- asio: FOLLOWER-LEADER模式
- Leader/Follower线程模型
- leader-follower model
- leader/follower多线程模型
- Leader/Follower线程模型
- Leader/Follower线程模型
- 领导者/追随者(Leader/Follower)
- Leader/Follower线程模型简介
- 领导者/追随者(Leader/Follower)
- Person.writeType?
- new person
- Person基础
- Sql Server 事务
- 51Nod-1084-矩阵取数问题 V2
- Reverse Words in a String II
- 智慧北京:Gson解析的使用
- 报错java.lang.NoClassDefFoundError: com.google.gson.Gson
- Person Follower
- ovs的upcall及ofproto-dpif处理细节
- 读书笔记:C++ primer 5th edition--chapter17.标准库特殊设施
- meta标签设置
- PHP.9-HTML+CSS(三)-CSS样式
- 测试多个线程调用同一静态方法(无静态变量)时是否有线程安全问题
- 2016/10/18
- 记录学习java的历程
- SlideMenu实现沉浸式效果