让ros机器人行走、建图、路径规划、定位和导航

让ros机器⼈⾏⾛、建图、路径规划、定位导航
准备导航所需要的包。
sudo apt-get install ros-kinetic-slam-gmapping
b.安装雷达的驱动(我的是robopack),直接将提供的ros驱动包拷贝到⼯作空间中,
c.安装导航定位包,navigation 进⼊git:github/ros-planning/navigation/tree/indigo-devel,下载和⾃⼰ros版本匹配的包,解压到⾃⼰的⼯作空间中,
cd ~/catkin_ws
catkin_make
indigo的navigation包会出现⼀个依赖问题,:Orocos-bfl not found while installing navigation stack ROS indigo + Ubuntu 14.04
解决⽅法:
rosdep install --from-paths src --ignore-src --rosdistro indigo -y
d.由于导航包在/cmd_val下发布的移动数据加速度会过于不友好,所以我们需要对速度做平滑处理,其实就是控制加速,⼀般通过滤波即可实现,在此我们采⽤turtlebot的平滑包即可,
 安装平滑包yocs_velocity_smoother,具体的平滑算法和输⼊切换请⾃⼰阅读源码。
apt-get install ros-indigo-yocs-velocity-smoother
所有的包准包好后,我们去准备启动所需的launch⽂件,⾸先是机器⼈地盘的启动⽂件base_controller.launch:
<launch>
<param name="use_sim_time" value="false" />
<node name="link_laser" pkg="tf" type="static_transform_publisher" args="0.15 0 0.15 0 0 0 base_link laser 50"/>
<node name="link_footprint" pkg="tf" type="static_transform_publisher" args="0 0 0 0 0 0 base_link base_footprint 50"/>    <node pkg="odom_tf_package" type="tf_broadcaster_node" name="serial_send_recevice" output="screen"/>
<include file="$(find odom_tf_package)/launch/include/rplidar_l">
</include>
<arg name="node_name"            value="velocity_smoother"/>
<arg name="nodelet_manager_name"  value="nodelet_manager"/>
<arg name="config_file"          value="$(find odom_tf_package)/config/yocs_velocity_smoother.yaml"/>
<arg name="raw_cmd_vel_topic"    value="cmd_vel"/>
<arg name="smooth_cmd_vel_topic"  value="smoother_cmd_vel"/>
<arg name="robot_cmd_vel_topic"  value="robot_cmd_vel"/>
<arg name="odom_topic"            value="odom"/>
<!-- nodelet manager -->
<node pkg="nodelet" type="nodelet" name="$(arg nodelet_manager_name)" args="manager"/>
<!-- velocity smoother -->
<include file="$(find yocs_velocity_smoother)/launch/velocity_smoother.launch">
<arg name="node_name"            value="$(arg node_name)"/>
<arg name="nodelet_manager_name"  value="$(arg nodelet_manager_name)"/>
<arg name="config_file"          value="$(arg config_file)"/>
<arg name="raw_cmd_vel_topic"    value="$(arg raw_cmd_vel_topic)"/>
<arg name="smooth_cmd_vel_topic"  value="$(arg smooth_cmd_vel_topic)"/>
<arg name="robot_cmd_vel_topic"  value="$(arg robot_cmd_vel_topic)"/>
<arg name="odom_topic"            value="$(arg odom_topic)"/>
</include>
马铃薯馒头</launch>
2.然后去准备建图包的启动⽂件gmapping.launch
<launch>
<arg name="scan_topic" default="scan" />
<node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen" clear_params="true">
<!--because my used rtabmap_ros -->
<param name="odom_frame" value="/odom""/>
<!--param name="odom_frame" value="/base_controller/odom""/-->
<param name="map_update_interval" value="30.0"/>
<!-- Set maxUrange < actual maximum range of the Laser -->
<!-- Set maxUrange < actual maximum range of the Laser -->
<param name="maxRange" value="5.0"/>
<param name="maxUrange" value="4.5"/>
<param name="sigma" value="0.05"/>
<param name="kernelSize" value="1"/>
<param name="lstep" value="0.05"/>
<param name="astep" value="0.05"/>
<param name="iterations" value="5"/>
<param name="lsigma" value="0.075"/>
<param name="ogain" value="3.0"/>
<param name="lskip" value="0"/>
<param name="srr" value="0.01"/>
<param name="srt" value="0.02"/>
<param name="str" value="0.01"/>
<param name="stt" value="0.02"/>
<param name="linearUpdate" value="0.5"/>
<param name="angularUpdate" value="0.436"/>
<param name="temporalUpdate" value="-1.0"/>
<param name="resampleThreshold" value="0.5"/>
<param name="particles" value="80"/>
<!--
<param name="xmin" value="-50.0"/>
<param name="ymin" value="-50.0"/>
<param name="xmax" value="50.0"/>
<param name="ymax" value="50.0"/>
make the starting size small for the benefit of the Android client'  -->
<param name="xmin" value="-1.0"/>
<param name="ymin" value="-1.0"/>
<param name="xmax" value="1.0"/>
<param name="ymax" value="1.0"/>
<param name="delta" value="0.05"/>
<param name="llsamplerange" value="0.01"/>
<param name="llsamplestep" value="0.01"/>
<param name="lasamplerange" value="0.005"/>
<param name="lasamplestep" value="0.005"/>线性排水沟施工图
<remap from="scan" to="$(arg scan_topic)"/>
</node>
</launch>
3,导航包(move_base)和定位(amcl)的启动⽂件:savvy_amcl.launch
<launch>湿式电除雾器
<param name="use_sim_time" value="false" />
<!-- Set the name of the map yaml file: can be overridden on the command line. -->
氢键受体<arg name="map" default="map.yaml" />
<!--node name="map_odom" pkg="tf" type="static_transform_publisher" args="0 0 0 0 0 0 map odom 50"/-->
<!-- Run the map server with the desired map -->
<node name="map_server" pkg="map_server" type="map_server" args="$(find savvy)/maps/$(arg map)"/>
<!-- The move_base node -->
<include file="$(find savvy)/launch/move_base_amcl.launch" />
<!--zxw add Fire up AMCL-->
<include file="$(find savvy)/launch/tb_amcl.launch" />
</launch>
隔膜胶水
move_base_amcl.launch:
<launch>
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen" clear_params="true">
<rosparam file="$(find savvy)/config/savvyconfig/costmap_common_params.yaml" command="load" ns="global_costmap" />    <rosparam file="$(find savvy)/config/savvyconfig/costmap_common_params.yaml" command="load" ns="local_costmap" />    <rosparam file="$(find savvy)/config/savvyconfig/local_costmap_params.yaml" command="load" />
<rosparam file="$(find savvy)/config/savvyconfig/global_costmap_params.yaml" command="load" />
<rosparam file="$(find savvy)/config/savvyconfig/base_local_planner_params.yaml" command="load" />
<rosparam file="$(find savvy)/config/nav_obstacles_params.yaml" command="load" />
煤矸石烧结砖</node>
</launch>
tb_amcl.launch:
<launch>
<arg name="use_map_topic" default="false"/>
<arg name="scan_topic" default="scan"/>
<node pkg="amcl" type="amcl" name="amcl" clear_params="true">    <param name="use_map_topi
c" value="$(arg use_map_topic)"/>    <!-- Publish scans from best pose at a max of 10 Hz -->
<param name="odom_model_type" value="diff"/>
<param name="odom_alpha5" value="0.1"/>
<param name="gui_publish_rate" value="10.0"/>
<param name="laser_max_beams" value="60"/>
<param name="laser_max_range" value="12.0"/>
<param name="min_particles" value="500"/>
<param name="max_particles" value="2000"/>
<param name="kld_err" value="0.05"/>
<param name="kld_z" value="0.99"/>
<param name="odom_alpha1" value="0.2"/>
<param name="odom_alpha2" value="0.2"/>
<!-- translation std dev, m -->
<param name="odom_alpha3" value="0.2"/>
<param name="odom_alpha4" value="0.2"/>
<param name="laser_z_hit" value="0.5"/>
<param name="laser_z_short" value="0.05"/>
<param name="laser_z_max" value="0.05"/>
<param name="laser_z_rand" value="0.5"/>
<param name="laser_sigma_hit" value="0.2"/>
<param name="laser_lambda_short" value="0.1"/>
<param name="laser_model_type" value="likelihood_field"/>
<!-- <param name="laser_model_type" value="beam"/> -->
<param name="laser_likelihood_max_dist" value="2.0"/>
<param name="update_min_d" value="0.25"/>
<param name="update_min_a" value="0.2"/>
<param name="odom_frame_id" value="odom"/>
<param name="resample_interval" value="1"/>
<!-- Increase tolerance because the computer can get quite busy -->    <param name="transform_tolerance" value="1.0"/>
<param name="recovery_alpha_slow" value="0.0"/>
<param name="recovery_alpha_fast" value="0.0"/>
<remap from="scan" to="$(arg scan_topic)"/>
</node>
</launch>
4.导航的配置参数如下:
base_local_planner_params.yaml

本文发布于:2024-09-22 10:02:55,感谢您对本站的认可!

本文链接:https://www.17tex.com/tex/4/218071.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:导航   启动   准备   匹配   定位   阅读   切换   安装
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议