我用键盘指令设置的时候,机器人一直没法自主导航规划路径
roslaunch turtlebot_teleop keyboard_teleop.launch
在找机器人导航launch文件的时候,找到了
<include file="$(find turtlebot_navigation)/launch/includes/rplidar_move_base.launch.xml">
链接到的:
<include file="$(find turtlebot_navigation)/launch/includes/velocity_smoother.launch.xml"/>
<include file="$(find turtlebot_navigation)/launch/includes/safety_controller.launch.xml"/>
百度网址:https://blog.csdn.net/sunyoop/article/details/78222938?utm_source=blogxgwz4,解释了我为什么用键盘指令设置机器人速度的时候,机器人一直没法正常进行自主导航.
smoother : 是一个速度平滑控制器,用来防止robot navigation的速度/转速过快,加速度/快减速过大
smoother针对navigation或者其他一些例子,robot有一个命令选择node cmd_vel_mux,防止robot被多个ros app下发的运动命令控制从而出现运动问题。
<include file="$(find turtlebot_navigation)/launch/includes/velocity_smoother.launch.xml"/>
路径下的文件内容:
<!--
Velocity smoother
-->
<launch>
<node pkg="nodelet" type="nodelet" name="navigation_velocity_smoother" args="load yocs_velocity_smoother/VelocitySmootherNodelet mobile_base_nodelet_manager">
<rosparam file="$(find turtlebot_bringup)/param/defaults/smoother.yaml" command="load"/>
<remap from="navigation_velocity_smoother/smooth_cmd_vel" to="cmd_vel_mux/input/navi"/>
<!-- Robot velocity feedbacks; use the default base configuration -->
<remap from="navigation_velocity_smoother/odometry" to="odom"/>
<remap from="navigation_velocity_smoother/robot_cmd_vel" to="mobile_base/commands/velocity"/>
</node>
</launch>
我一直在找:
remap from="navigation_velocity_smoother/smooth_cmd_vel" to="cmd_vel_mux/input/navi"的信息内容怎么去更改turtlebot的速度,其实是在"$(find turtlebot_bringup)/param/defaults/smoother.yaml"文件里更改机器人最大线速度/角速度
参数配置文件smoothrt.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 强制必须设置,角速度最大值
speed_lim_v: 0.15
speed_lim_w: 0.5
# accel_lim_v: 1.0 强制必须设置,线性加速度最大值maximum is actually 2.0, but we
# push it down to be smooth
# accel_lim_w: 2.0 强制必须设置,角加速度最大值
accel_lim_v: 0.5 # maximum is actually 2.0, but we push it down to be smooth
accel_lim_w: 0.5
# Optional parameters
frequency: 20.0 #输出速度频率。不论输入命令的频率。必要时插值
decel_factor: 1.5 #加减速比,对于惯性大的机器人
# Robot velocity feedback type:
# 0 - none (default)
# 1 - odometry
# 2 - end robot commands
robot_feedback: 2 #速度反馈(0 - none, 1 - odometry, 2 - end robot commands).
这个是参考上述博主的.PS:做一下笔记,以防忘记