ROS:gazebo的三轮车实例launch文件解读

一:前言

gazebo三轮车实例里共有四个launch文件,分别是tricycle.gazebo.launch,tricycle.urdf.launch,tricycle_drive_scenario.launch,tricycle_rviz.launch

二:tricycle.urdf.launch

首先考虑tricycle.urdf.launch文件



  
  

  
	  
	  

	  
		  
		  
	  
  


具体分析

表明开始launch文件

  
  

本launch文件中需要使用的两个参数,一个robot_name默认值设为"tricycle",另一个参数robot_position默认设为“0  0  0.01  0  0  0 ”

  

启动节点多了可以分组,这行的作用是使用分组,命名空间的名称使用参数robot_name的值

	  
	  

对于参数服务器中的系统参数robot_description,使用xacro/xacro.py解析gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle.xacro文件

	  
		  
		  
	  

启动节点,对应程序是robot_state_publisher包里的state_publisher程序,在ros节点管理器中的节点名称是robot_state_publisher。

传递给该节点publisher_frequency参数的值是double类型,大小为30.0

传递给该节点tf_prefix参数的值是string类型,内容为launch文件参数robot_name的值

节点描述完成

  


组描述完成

launch文件描述完成

三:tricycle_rviz.launch文件



  
  

启动节点,rviz包里的rviz程序,ros节点管理器中名称为rviz,参数为tricycle.rviz文件(-d实在不知道什么意思)

四:tricycle_gazebo.launch



  
  

	
  

    
    

    
    

    
      
      
    
  

具体解释

  
  

launch文件中的参数robot_name,默认设为r1

launch文件中的参数robot_position,默认设为"0  0  0.01"

  

node组,命名空间为launch文件参数robot_name的值

    
    

对于参数服务器中的系统参数robot_description,使用xacro/xacro.py解析gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle.xacro文件

    
    

不明白...

    
      
      
    

启动robot_state_publisher包内的state_publisher程序作为节点,在ros节点管理器内的名称为robot_state_publisher

节点参数publish_frequency的值为double类型,值为30

节点参数tf_prefix的类型为string,值为launch文件参数robot_name的值

五:ricycle_drive_scenario.launch文件



  
  

  
  

  
    
    
      
      
    

    
  

  
    
    
      
      
    

    
  

具体解释

  
  

launch内参数r1,默认设为true

launch内参数r2,默认设为true

  
  

载入gazebo_ros/launch文件夹内的empty_world.launch文件

  

如果r1则进入组的描述

    
    
      
      
    

载入gazebo_plugins/text/tricycle_drive/launch/tricycle.gazebo.launch文件

被载入的launch文件内的参数robot_name赋值为r1

被载入的launch文件内的参数robot_position,赋值为"0  0  0.01  0  0  1.57"

    

启动tf包内的static_transform_publisher程序作为节点,在节点管理器内的名称为base_to_odom_r1

参数值为。。。

 

你可能感兴趣的:(ros系统)