融合动态障碍物

简介:考虑怎样把其他节点发布的动态障碍物考虑进来

1.本部分演示了动态障碍物该如何被包含到teb_local_planner中。

2.写一个简单的动态障碍物的发布器publish_dynamic_obstacles.py

  1. #!/usr/bin/env python
  2.  
  3. import rospy, math, tf
  4. from costmap_converter.msg import ObstacleArrayMsg, ObstacleMsg
  5. from geometry_msgs.msg import Point32, QuaternionStamped, Quaternion, TwistWithCovariance
  6. from tf.transformations import quaternion_from_euler
  7.  
  8. def publish_obstacle_msg():
  9. pub = rospy.Publisher('/test_optim_node/obstacles', ObstacleArrayMsg, queue_size=)
  10. rospy.init_node("test_obstacle_msg")
  11.  
  12. y_0 = -3.0
  13. vel_x = 0.0
  14. vel_y = 0.3
  15. range_y = 6.0
  16.  
  17. obstacle_msg = ObstacleArrayMsg()
  18. obstacle_msg.header.stamp = rospy.Time.now()
  19. obstacle_msg.header.frame_id = "odom" # CHANGE HERE: odom/map
  20.  
  21. # Add point obstacle
  22. obstacle_msg.obstacles.append(ObstacleMsg())
  23. obstacle_msg.obstacles[].id =
  24. obstacle_msg.obstacles[].polygon.points = [Point32()]
  25. obstacle_msg.obstacles[].polygon.points[].x = -1.5
  26. obstacle_msg.obstacles[].polygon.points[].y =
  27. obstacle_msg.obstacles[].polygon.points[].z =
  28.  
  29. yaw = math.atan2(vel_y, vel_x)
  30. q = tf.transformations.quaternion_from_euler(,,yaw)
  31. obstacle_msg.obstacles[].orientation = Quaternion(*q)
  32.  
  33. obstacle_msg.obstacles[].velocities.twist.linear.x = vel_x
  34. obstacle_msg.obstacles[].velocities.twist.linear.y = vel_y
  35. obstacle_msg.obstacles[].velocities.twist.linear.z =
  36. obstacle_msg.obstacles[].velocities.twist.angular.x =
  37. obstacle_msg.obstacles[].velocities.twist.angular.y =
  38. obstacle_msg.obstacles[].velocities.twist.angular.z =
  39.  
  40. r = rospy.Rate() # 10hz
  41. t = 0.0
  42. while not rospy.is_shutdown():
  43.  
  44. # Vary y component of the point obstacle
  45. if (vel_y >= ):
  46. obstacle_msg.obstacles[].polygon.points[].y = y_0 + (vel_y*t)%range_y
  47. else:
  48. obstacle_msg.obstacles[].polygon.points[].y = y_0 + (vel_y*t)%range_y - range_y
  49.  
  50. t = t + 0.1
  51.  
  52. pub.publish(obstacle_msg)
  53.  
  54. r.sleep()
  55.  
  56. if __name__ == '__main__':
  57. try:
  58. publish_obstacle_msg()
  59. except rospy.ROSInterruptException:
  60. pass

运行:

  1. roslaunch teb_local_planner test_optim_node.launch
  2. roslaunch mypublisher publish_dynamic_obstacles.py

3.设置规划器来考虑动态障碍物

启动rosrun rqt_reconfigure rqt_reconfigure;选中参数include_dynamic_obstacles,teb local planner使用一个常速度模型来预测障碍物将来的行为。现在的轨迹是根据时间和空间来避免障碍物而不是仅仅考当前障碍物的位置来避免。对于速度模型的估计精确性是很重要的,常速度假设是合理且满足的。

如果调节参数visualize_with_time_as_z_axis,可以可视化规划的和预测的速度的时间变化。设置该参数值为0.1。在rviz中的z轴被解释为时间轴,且可被扩展。也可以看到homotopy-class-planning把动态障碍物的预测考虑进去。

相关的参数

  1. ~<name>/min_obstacle_dist: Desired minimal distance from (static and dynamic) obstacles
  2.  
  3. ~<name>/inflation_dist: Non-zero cost region around (static) obstacles
  4.  
  5. ~<name>/include_dynamic_obstacles: Specify whether the motion of dynamic obstacles should be included (constant-velocity-model) or not.
  6.  
  7. ~<name>/dynamic_obstacle_inflation_dist: Non-zero cost region around (dynamic) obstacles
  8.  
  9. ~<name>/include_costmap_obstacles: Deactivate costmap obstacles completely
  10.  
  11. ~<name>/costmap_obstacles_behind_robot_dist: Maximum distance behind the robot searched for occupied costmap cells.
  12.  
  13. ~<name>/obstacle_poses_affected: Specify how many trajectory configurations/poses should be taken into account next to the closest one.
  14.  
  15. ~<name>/weight_obstacle: Optimization weight for keeping a distance to static obstacles.
  16.  
  17. ~<name>/weight_inflation: Optimization weight for inflation costs of static obstacles.
  18.  
  19. ~<name>/weight_dynamic_obstacle: Optimization weight for keeping a distance to dynamic obstacles.
  20.  
  21. ~<name>/weight_dynamic_obstacle_inflation: Optimization weight for inflation costs of dynamic obstacles.
  22.  
  23. ~<name>/footprint_model: The robot footprint model

teb教程8的更多相关文章

  1. teb教程1

    http://wiki.ros.org/teb_local_planner/Tutorials/Setup%20and%20test%20Optimization 简介:本部分关于teb怎样优化轨迹以 ...

  2. teb教程3

    配置和运行机器人导航 简介:配置teb_local_planner作为navigation中local planner的插件 参考teb安装 由于局部代价地图的大小和分辨率对优化性能影响很大,因为占据 ...

  3. teb教程10 teb questions

    http://wiki.ros.org/teb_local_planner/Tutorials/Frequently%20Asked%20Questions

  4. teb教程9

    通过costmap_converter来跟踪和包含动态障碍物 简介:利用costmap_converter来很容易跟踪动态障碍物 1.costmap_converter中提供了一个插件称之为costm ...

  5. teb教程7

    融合自定义的障碍物 简介:本部分讲解怎样考虑其他节点发布的多边形的障碍物. 1.在一些应用当中,可能不想依赖于代价地图或者想添加其他的除了点状的障碍物.你可以发送你自己的障碍物列表到teb_local ...

  6. teb教程6

    代价地图的转换 简介:本部分关于怎样把代价地图转换插件应用到转换占据栅格costmap2d到几何形状来优化(测试阶段) teb_local_planner包支持costmap_converter插件, ...

  7. teb教程5

    跟随全局规划器 简介:本部分是关于如何配置局部规划器严格跟随全局规划,也包括调节在时优和路径跟随上的权衡. 1.先看一下via-points当前的优化行为:启动下面节点 roslaunch teb_l ...

  8. teb教程4

    障碍物避障以及机器人足迹模型 简介:障碍物避障的实现,以及必要参数的设置对于机器人足迹模型和其对应的影响 1.障碍物避障是怎样工作的 1.1 惩罚项 障碍物避障作为整个路径优化的一部分.显然,优化是找 ...

  9. teb教程2

    http://wiki.ros.org/teb_local_planner/Tutorials/Inspect%20optimization%20feedback 检查优化反馈 简介:怎样检查优化的轨 ...

随机推荐

  1. webpack4入门到进阶案例实战课程

    愿景:"让编程不在难学,让技术与生活更加有趣" 更多教程请访问xdclass.net 第一章 webpack4前言 第一集 webpack4入门到进阶案例实战课程介绍 简介:讲述w ...

  2. 命令分析nginx访问日志的用法

    awk分析日志常用高级使用命令方法 分析访问日志(Nginx为例) 日志格式: '$remote_addr - $remote_user [$time_local] "$request&qu ...

  3. Hdu-3333 Turning Tree (离线树状数组/线段树)

    Hdu-3333 Turning Tree 题目大意:先给出n个数字.面对q个询问区间,输出这个区间不同数的和. 题解:这道题有多重解法.我另一篇博客写了分块的解法  HDU-3333 Turing ...

  4. Vue-cli使用prerender-spa-plugin插件预渲染和配置cdn

    参考:https://www.jianshu.com/p/6a4c0b281e7f 使用vue-cli打包项目一般为spa项目,众所周知单页面应用不利于SEO,有ssr和预渲染两种解决方案,这里我们只 ...

  5. OAuth_3

    端点: 授权断点.令牌断点.重定向端点 除了重定向端点在客户端应用上,其他在服务器端 授权端点: 资源拥有者所登录的授权服务器,并授权给客户端应用的端点 令牌端点: 授权服务器上为了一个访问令牌,客户 ...

  6. windows消息机制(转)

    1. 引言Windows 在操作系统平台占有绝对统治地位,基于Windows 的编程和开发越来越广泛.Dos 是过程驱动的,而Windows 是事件驱动的[6],这种差别的存在使得很多Dos 程序员不 ...

  7. 对struct typedef *的认识

    typedef struct node { ……… }NODE,*PNODE; 应该等价于 typedef struct node NODE;//struct node = NODE,eg:struc ...

  8. 2018/8/26学习Mysql笔记

    SELECT * FROM product; #.基本增删改查 #新增 #需求:添加一条数据到产品表 产品名称为苹果手机 卖价为5000 ); #删除 #需求:删除产品表中id=20的数据 ; #需求 ...

  9. ofbiz保存jsp页面数据

    1.前台js保存 <script type="text/javascript" src="/ecloud/js/js/jquery.min.js"> ...

  10. oralce存储过程

    简单的存储 create or replace procedure sayhelloworld as begin dbms_output.put_line('Hello World'); end;