turtlebot3 引入速度平滑

turtlebot3中没有使用速度平滑,但是本人在用turtlebot3跑导航时会出现急停的现象,所以为了解决这个问题,本人在turtlebot3中添加速度平滑处理功能

以下是本人的相关代码及设置

velocity_smoother.launch.xml 文件(按照官网的文件写的,注意文件路径)


 
 
 
 
 
 
 
 
  

 
 
 
 

 
          args="load yocs_velocity_smoother/VelocitySmootherNodelet $(arg nodelet_manager_name)">
   
     
   
 
   

   
 
  
 
  
 

  
 
   
 
 
   
 
 

 

smoothrt.yaml 文件(文件存放位置要和上面 .xml 文件里面的路径相同:turtlebot3_navigation/param/standalone.yaml):


# Default parameters used by the yocs_velocity_smoother module.
# This isn't used by minimal.launch per se, rather by everything
# which runs on top.
 
# Mandatory parameters
speed_lim_v: 0.8
speed_lim_w: 5.4
 
accel_lim_v: 1.0 # maximum is actually 2.0, but we push it down to be smooth
accel_lim_w: 2.0
 
# Optional parameters
frequency: 20.0
decel_factor: 1.5
 
# Robot velocity feedback type:
#  0 - none (default)
#  1 - odometry
#  2 - end robot commands
robot_feedback: 0

 

 

在turtlebot3 的启动文件(turtlebot3_robot.launch)加入这句话(velocity_smoother.launch.xml文件路径要和下面的一样,不一样自己改)

意思是在启动turtlebot3时启动速度平滑功能

 

下面是smoothrt.yaml里面参数意思


~accel_lim_v (double):强制必须设置,线性加速度最大值
~accel_lim_w (double):强制必须设置,角加速度最大值
~speed_lim_v (double):强制必须设置,线速度最大值
~speed_lim_w (double):强制必须设置,角速度最大值
~decel_factor (double, default: 1.0):加减速比,对于惯性大的机器人
~frequency (double, default: 20.0):输出速度频率。不论输入命令的频率。必要时插值
~robot_feedback (int, default: 0):速度反馈(0 - none, 1 - odometry, 2 - end robot commands).

 

 

虽然用了速度平滑,但是效果还是不太好。

 

 

 

 

 

 

你可能感兴趣的:(ros)