以官方教程为准
http://gazebosim.org/tutorials
记录一下spawn_model用法
rosrun gazebo_ros spawn_model -h可以看到帮助
SpawnModel script started
Commands:
-[urdf|sdf|trimesh|gazebo] - specify incoming xml is urdf, sdf or trimesh format. gazebo arg is deprecated in ROS Hydro
-[file|param|database] [<file_name>|<param_name>|<model_name>] - source of the model xml or the trimesh file
-model <model_name> - name of the model to be spawned.
-reference_frame <entity_name> - optinal: name of the model/body where initial pose is defined.
If left empty or specified as "world", gazebo world frame is used.
-gazebo_namespace <gazebo ros_namespace> - optional: ROS namespace of gazebo offered ROS interfaces. Defaults to /gazebo/ (e.g. /gazebo/spawn_model).
-robot_namespace <robot ros_namespace> - optional: change ROS namespace of gazebo-plugins.
-unpause - optional: !!!Experimental!!! unpause physics after spawning model
-wait - optional: !!!Experimental!!! wait for model to exist
-trimesh_mass <mass in kg> - required if -trimesh is used: linear mass
-trimesh_ixx <moment of inertia in kg*m^2> - required if -trimesh is used: moment of inertia about x-axis
-trimesh_iyy <moment of inertia in kg*m^2> - required if -trimesh is used: moment of inertia about y-axis
-trimesh_izz <moment of inertia in kg*m^2> - required if -trimesh is used: moment of inertia about z-axis
-trimesh_gravity <bool> - required if -trimesh is used: gravity turned on for this trimesh model
-trimesh_material <material name as a string> - required if -trimesh is used: E.g. Gazebo/Blue
-trimesh_name <link name as a string> - required if -trimesh is used: name of the link containing the trimesh
-x <x in meters> - optional: initial pose, use 0 if left out
-y <y in meters> - optional: initial pose, use 0 if left out
-z <z in meters> - optional: initial pose, use 0 if left out
-R <roll in radians> - optional: initial pose, use 0 if left out
-P <pitch in radians> - optional: initial pose, use 0 if left out
-Y <yaw in radians> - optional: initial pose, use 0 if left out
-J <joint_name joint_position> - optional: initialize the specified joint at the specified value
-package_to_model - optional: convert urdf <mesh filename="package://..." to <mesh filename="model://..."
-b - optional: bond to gazebo and delete the model when this program is interrupted
例如 rosrun gazebo_ros spawn_model -sdf -model model.sdf
也可以写到launch文件中一次性启动