Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9137993
  • 博文数量: 1725
  • 博客积分: 12961
  • 博客等级: 上将
  • 技术积分: 19840
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-09 11:25
个人简介

偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.

文章分类

全部博文(1725)

文章存档

2024年(1)

2023年(26)

2022年(112)

2021年(217)

2020年(157)

2019年(192)

2018年(81)

2017年(78)

2016年(70)

2015年(52)

2014年(40)

2013年(51)

2012年(85)

2011年(45)

2010年(231)

2009年(287)

分类: 其他平台

2019-06-24 14:30:54

参考 https://www.cnblogs.com/21207-iHome/p/8118875.html



ros中的规划层已经有加速度的限制,  base/dwa_local_planner_params.yaml

点击(此处)折叠或打开

  1.   acc_lim_x: 2.5 # default: 2.5
  2.   acc_lim_y: 0.0
  3.   acc_lim_theta: 3.2 # default: 3.2
但是输出的还是不够友好导致机器人行走不流畅,那么就在速度接口这边就要执行一个平滑的过程。通过使用速度插值的包 yocs_velocity_smoother, 来达到差动轮持续平滑的速度输出.

yocs_velocity_smoother是一个速度、加速度限制器,用来防止robot navigation的速度/转速过快,加速度/快减速过大
sudo apt-get install ros-kinetic-yocs-velocity-smoother 
  1. 安装过程出现错误, 清华ROS mirror服务区 gpt key 错误, 解决方式
  2. wget http://packages.ros.org/ros.key -O - | sudo apt-key add -

点击(此处)折叠或打开

  1. 订阅的话题
  2. raw_cmd_vel:Input velocity commands. 原始速度指令
  3. odometry:We compare the output velocity commands to measured velocity to ensure we don't create very big jumps in the velocity profile.
  4. robot_cmd_vel:Alternatively, we can also compare the output velocity commands to end robot velocity commands to ensure we don't create very big jumps in the velocity profile. See robot_feedback parameter description below for more details.
  5. 发布的话题
  6. smooth_cmd_vel:Smoothed output velocity commands respecting velocity and acceleration limits. 限制幅度后的速度

在 big_navigation.launch 中加入

点击(此处)折叠或打开

  1. <!-- velocity smoother -->
  2.   <include file="$(find big_navigation)/launch/velocity_smoother.launch" />

velocity_smoother.launch 的内容为

点击(此处)折叠或打开

  1. <launch>
  2.   <arg name="node_name" default="velocity_smoother"/>
  3.   <arg name="nodelet_manager_name" default="nodelet_manager"/>
  4.   <arg name="config_file" default="$(find big_navigation)/param/velocity_smoother.yaml"/>
  5.   <arg name="raw_cmd_vel_topic" default="cmd_vel"/> //输入项, Nav时的速度
  6.   <arg name="smooth_cmd_vel_topic" default="smooth_cmd_vel"/> //输出项, 平滑后的速度
  7.   <arg name="robot_cmd_vel_topic" default="cmd_vel"/> //输入项, 底盘上报的速度.本来对应 rc100
  8.   <arg name="odom_topic" default="odom"/> //输入项
  9.   <!-- nodelet manager -->
  10.   <node pkg="nodelet" type="nodelet" name="$(arg nodelet_manager_name)" args="manager"/>
  11.   <node pkg="nodelet" type="nodelet" name="$(arg node_name)" args="load yocs_velocity_smoother/VelocitySmootherNodelet $(arg nodelet_manager_name)" output="screen">
  12.         
  13.     <!-- parameters -->
  14.     <rosparam file="$(arg config_file)" command="load"/>
  15.     <!-- Subscribed Topics -->
  16.     <remap from="$(arg node_name)/raw_cmd_vel" to="$(arg raw_cmd_vel_topic)"/> <!-- velocity commands Input -->
  17.     <remap from="$(arg node_name)/odometry" to="$(arg odom_topic)"/> <!-- Robot velocity feedbacks -->
  18.     <remap from="$(arg node_name)/robot_cmd_vel" to="$(arg robot_cmd_vel_topic)"/> <!-- Robot velocity feedbacks -->
  19.     <!-- Published Topics -->
  20.     <remap from="$(arg node_name)/smooth_cmd_vel" to="$(arg smooth_cmd_vel_topic)"/> <!-- velocity commands Output -->
  21.   </node>
  22. </launch>
velocity_smoother.yaml内容

点击(此处)折叠或打开

  1. # Mandatory parameters
  2. speed_lim_v: 0.26 # Linear velocity limit
  3. speed_lim_w: 0.6 # Angular velocity limit
  4. accel_lim_v: 2.5 # Linear acceleration limit
  5. accel_lim_w: 3.2 # Angular acceleration limit
  6. # Optional parameters
  7. frequency: 35.0 # Output messages rate. The velocity smoother keeps it regardless incoming messages rate, interpolating whenever necessary
  8. decel_factor: 1.0 # Deceleration/acceleration ratio. Useful to make deceleration more aggressive
  9. # Robot velocity feedback type:
  10. # 0 - none
  11. # 1 - odometry
  12. # 2 - end robot commands
  13. robot_feedback: 2
实测结果发现:
有进步, 但是效果不是非常明显, 还是有些行进过程中的卡顿, 所以最根本的方法就是把速度降低. 



阅读(7347) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~