前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ROS1云课→27机器人SLAM小结

ROS1云课→27机器人SLAM小结

作者头像
zhangrelay
发布2022-09-28 13:50:11
4260
发布2022-09-28 13:50:11
举报

从turtlesim到stdr,从示意到仿真。

stdr:

ROS1云课→26机器人Gmapping等环境地图构建

ROS1云课→25机器人控制配置

ROS1云课→24机器人感知配置

turtlesim:

ROS1云课→23turtlesim绘制小结(数学和编程)

为什么要学习如上内容?

为了使用导航功能包集,需要逐步学习如何一步步配置自定义机器人。介绍了应用导航功能包集对机器人平台的需求,即需要使用平面激光雷达、差动轮式机器人、基础控制器,而且还要满足特定的几何形状。

注意使用stdr来展示示例和解释不同配置下导航功能包集的工作原理。如果直接使用一个真的机器人平台来解释这一切就会麻烦许多,而且并不是每位读者都能拥有或者能接触到这样的机器人。在任何情况下,使用不同的机器人平台,所下发的指令都可能是不同的,其硬件执行器也可能会出现故障,因此在仿真环境中执行这些代码更加安全也更加可靠。在此之后,在满足需要的基础之上,也可以将这些代码移植到实际的机器人上应用。

在后面,将会学习如何配置导航功能包集,创建.launch文件,并在stdr中完成之前所创建的机器人的自主导航。

简单来说,之后所学的内容都将是非常有用的,因为它不仅会提供在示例中进行正确的配置,还会提供在其他的机器人(无论是仿真机器人还是真正的机器人)中使用导航功能包集。


<!--
  Turtlebot navigation simulation:
  - stdr
  - move_base
  - amcl
  - map_server
  - rviz view
 -->
<launch>
  <arg name="base"       default="$(optenv TURTLEBOT_BASE kobuki)"/>  <!-- create, rhoomba -->
  <arg name="stacks"     default="$(optenv TURTLEBOT_STACKS hexagons)"/>  <!-- circles, hexagons -->
  <arg name="3d_sensor"  default="$(optenv TURTLEBOT_3D_SENSOR kinect)"/>  <!-- kinect, asus_xtion_pro -->
  <arg name="laser_topic" default="robot0/laser_0"/> <!-- default laser topic in stdr for 1 robot -->
  <arg name="odom_topic" default="robot0/odom"/>
  <arg name="odom_frame_id" default="map"/>
  <arg name="base_frame_id" default="robot0"/>
  <arg name="global_frame_id" default="world"/>
  <!-- Name of the map to use (without path nor extension) and initial position -->
  <arg name="map_file"       default="$(env TURTLEBOT_STDR_MAP_FILE)"/>
  <arg name="initial_pose_x" default="2.0"/>
  <arg name="initial_pose_y" default="2.0"/>
  <arg name="initial_pose_a" default="0.0"/>
  <arg name="min_obstacle_height" default="0.0"/>
  <arg name="max_obstacle_height" default="5.0"/>

  <!--  ******************** Stdr********************  -->
  <include file="$(find stdr_robot)/launch/robot_manager.launch" />
  <!-- Run STDR server with a prefedined map-->
  <node pkg="stdr_server" type="stdr_server_node" name="stdr_server" output="screen" args="$(arg map_file)"/>
  <!--Spawn new robot at init position 2 2 0-->
  <node pkg="stdr_robot" type="robot_handler" name="$(anon robot_spawn)" args="add $(find turtlebot_stdr)/robot/turtlebot.yaml $(arg initial_pose_x) $(arg initial_pose_y) 0"/>
  <!-- Run Gui  -->
  <include file="$(find stdr_gui)/launch/stdr_gui.launch"/>
  <!-- Run the relay to remap topics -->
  <include file="$(find turtlebot_stdr)/launch/includes/relays.launch.xml"/>

  <!--  ***************** Robot Model *****************  -->
  <include file="$(find turtlebot_bringup)/launch/includes/robot.launch.xml">
    <arg name="base" value="$(arg base)" />
    <arg name="stacks" value="$(arg stacks)" />
    <arg name="3d_sensor" value="$(arg 3d_sensor)" />
  </include>
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
  </node>

  <!-- Command Velocity multiplexer -->
  <node pkg="nodelet" type="nodelet" name="mobile_base_nodelet_manager" args="manager"/>
  <node pkg="nodelet" type="nodelet" name="cmd_vel_mux" args="load yocs_cmd_vel_mux/CmdVelMuxNodelet mobile_base_nodelet_manager">
    <param name="yaml_cfg_file" value="$(find turtlebot_bringup)/param/mux.yaml"/>
    <remap from="cmd_vel_mux/output" to="mobile_base/commands/velocity"/>
  </node>

  <!-- ****** Maps ***** -->
  <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)">
   <param name="frame_id" value="$(arg global_frame_id)"/>
  </node>


  <!--  ************** Navigation  ***************  -->
  <include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml">
   <arg name="odom_topic" value="$(arg odom_topic)"/>
   <arg name="laser_topic" value="$(arg laser_topic)"/>
   <arg name="odom_frame_id"   value="$(arg odom_frame_id)"/>
   <arg name="base_frame_id"   value="$(arg base_frame_id)"/>
   <arg name="global_frame_id" value="$(arg global_frame_id)"/>
  </include>

  <!-- ***************** Manually setting some parameters ************************* -->
    <param name="move_base/local_costmap/obstacle_layer/scan/min_obstacle_height" value="$(arg min_obstacle_height)"/>
    <param name="move_base/local_costmap/obstacle_layer/scan/max_obstacle_height" value="$(arg max_obstacle_height)"/>
    <param name="move_base/global_costmap/obstacle_layer/scan/min_obstacle_height" value="$(arg min_obstacle_height)"/>
    <param name="move_base/global_costmap/obstacle_layer/scan/max_obstacle_height" value="$(arg max_obstacle_height)"/>

  <!--  ************** AMCL ************** -->
  <include file="$(find turtlebot_navigation)/launch/includes/amcl/amcl.launch.xml">
    <arg name="scan_topic" value="$(arg laser_topic)"/>
    <arg name="use_map_topic" value="true"/>
    <arg name="odom_frame_id" value="$(arg odom_frame_id)"/>
    <arg name="base_frame_id" value="$(arg base_frame_id)"/>
    <arg name="global_frame_id" value="$(arg global_frame_id)"/>
    <arg name="initial_pose_x" value="$(arg initial_pose_x)"/>
    <arg name="initial_pose_y" value="$(arg initial_pose_y)"/>
    <arg name="initial_pose_a" value="$(arg initial_pose_a)"/>
  </include>

 <!-- ********** Small tf tree connector between robot0 and base_footprint********* -->
  <node name="tf_connector" pkg="turtlebot_stdr" type="tf_connector.py" output="screen"/>

  <!--  **************** Visualisation ****************  -->
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find turtlebot_stdr)/rviz/robot_navigation.rviz"/>




</launch>

export TURTLEBOT_STDR_MAP_FILE=fullpath_to_your_map.yaml

export TURTLEBOT_STDR_MAP_FILE=/home/shiyanlou/Code/demo_ws/src/turtlebot_stdr/maps/hospital_section.yaml


本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2022-09-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档