源码位于:turtlebot_simulator/turtlebot_stage
ps.想要得到如上图所示的文件结构构成的树,需要先下载
sudo apt-get install tree
,然后在对需要的文件夹中输入tree
即可。
turtlebot_in_stage.launch
<!--
Turtlebot navigation simulation:
- stage
- map_server
- move_base
- static map
- amcl
- rviz view
-->
<launch>
<arg name="base" default="$(optenv TURTLEBOT_BASE kobuki)"/> <!-- create, rhoomba(设置底座为kobuki,可通过env |grep TURTLEBOT_BASE查看) -->
<arg name="stacks" default="$(optenv TURTLEBOT_STACKS hexagons)"/> <!-- circles, hexagons (托盘)-->
<arg name="3d_sensor" default="$(optenv TURTLEBOT_3D_SENSOR kinect)"/> <!-- kinect, asus_xtion_pro(3D传感器) -->
<!-- Name of the map to use (without path nor extension) and initial position -->
<arg name="map_file" default=" $(env TURTLEBOT_STAGE_MAP_FILE)"/> <!-- robopark_plan -->
<arg name="world_file" default=" $(env TURTLEBOT_STAGE_WORLD_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"/>
<param name="/use_sim_time" value="true"/><!-- -In order for a ROS node to use simulation time according to the /clock topic, the /use_sim_time parameter must be set to true before the node is initialized.->
<!-- ******************** Stage ******************** -->
<!--
Publishes transforms:
/base_link -> /base_laser
/base_footprint -> /base_link (identity)
/odom -> base_footprint
Publishes topics:
/odom : odometry data from the simulated odometry
/base_scan : laser data from the simulated laser
/base_pose_ground_truth : the ground truth pose
Parameters:
base_watchdog_timeout : time (s) after receiving the last command on cmd_vel before stopping the robot
Args:
-g : run in headless mode.
-->
<node pkg="stage_ros" type="stageros" name="stageros" args="$(arg world_file)">
<param name="base_watchdog_timeout" value="0.5"/>
<remap from="odom" to="odom"/>
<remap from="base_pose_ground_truth" to="base_pose_ground_truth"/>
<remap from="cmd_vel" to="mobile_base/commands/velocity"/>
<remap from="base_scan" to="scan"/>
</node>
<!-- ***************** 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">
<param name="use_gui" value="true"/>
</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>
<!-- ************** Navigation *************** -->
<include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml"/>
<!-- ****** Maps ***** -->
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)">
<param name="frame_id" value="/map"/>
</node>
<include file="$(find turtlebot_navigation)/launch/includes/amcl/amcl.launch.xml">
<arg name="scan_topic" value="scan"/>
<arg name="use_map_topic" value="true"/>
<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>
<!-- **************** Visualisation **************** -->
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find turtlebot_stage)/rviz/robot_navigation.rviz"/>
</launch>