偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.
全部博文(1751)
分类: 其他平台
2019-06-24 14:30:54
点击(此处)折叠或打开
sudo apt-get install ros-kinetic-yocs-velocity-smoother
- 安装过程出现错误, 清华ROS mirror服务区 gpt key 错误, 解决方式
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
在 big_navigation.launch 中加入点击(此处)折叠或打开
- 订阅的话题
- raw_cmd_vel:Input velocity commands. 原始速度指令
- odometry:We compare the output velocity commands to measured velocity to ensure we don't create very big jumps in the velocity profile.
- 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.
- 发布的话题
- smooth_cmd_vel:Smoothed output velocity commands respecting velocity and acceleration limits. 限制幅度后的速度
点击(此处)折叠或打开
- <!-- velocity smoother -->
- <include file="$(find big_navigation)/launch/velocity_smoother.launch" />
velocity_smoother.launch 的内容为
velocity_smoother.yaml内容点击(此处)折叠或打开
- <launch>
- <arg name="node_name" default="velocity_smoother"/>
- <arg name="nodelet_manager_name" default="nodelet_manager"/>
- <arg name="config_file" default="$(find big_navigation)/param/velocity_smoother.yaml"/>
- <arg name="raw_cmd_vel_topic" default="cmd_vel"/> //输入项, Nav时的速度
- <arg name="smooth_cmd_vel_topic" default="smooth_cmd_vel"/> //输出项, 平滑后的速度
- <arg name="robot_cmd_vel_topic" default="cmd_vel"/> //输入项, 底盘上报的速度.本来对应 rc100
- <arg name="odom_topic" default="odom"/> //输入项
- <!-- nodelet manager -->
- <node pkg="nodelet" type="nodelet" name="$(arg nodelet_manager_name)" args="manager"/>
- <node pkg="nodelet" type="nodelet" name="$(arg node_name)" args="load yocs_velocity_smoother/VelocitySmootherNodelet $(arg nodelet_manager_name)" output="screen">
- <!-- parameters -->
- <rosparam file="$(arg config_file)" command="load"/>
- <!-- Subscribed Topics -->
- <remap from="$(arg node_name)/raw_cmd_vel" to="$(arg raw_cmd_vel_topic)"/> <!-- velocity commands Input -->
- <remap from="$(arg node_name)/odometry" to="$(arg odom_topic)"/> <!-- Robot velocity feedbacks -->
- <remap from="$(arg node_name)/robot_cmd_vel" to="$(arg robot_cmd_vel_topic)"/> <!-- Robot velocity feedbacks -->
- <!-- Published Topics -->
- <remap from="$(arg node_name)/smooth_cmd_vel" to="$(arg smooth_cmd_vel_topic)"/> <!-- velocity commands Output -->
- </node>
- </launch>
实测结果发现:点击(此处)折叠或打开
- # Mandatory parameters
- speed_lim_v: 0.26 # Linear velocity limit
- speed_lim_w: 0.6 # Angular velocity limit
- accel_lim_v: 2.5 # Linear acceleration limit
- accel_lim_w: 3.2 # Angular acceleration limit
- # Optional parameters
- frequency: 35.0 # Output messages rate. The velocity smoother keeps it regardless incoming messages rate, interpolating whenever necessary
- decel_factor: 1.0 # Deceleration/acceleration ratio. Useful to make deceleration more aggressive
- # Robot velocity feedback type:
- # 0 - none
- # 1 - odometry
- # 2 - end robot commands
- robot_feedback: 2
有进步, 但是效果不是非常明显, 还是有些行进过程中的卡顿, 所以最根本的方法就是把速度降低.