Gazebo导入创建好的模型

以官方教程为准

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] [||] - source of the model xml or the trimesh file
    -model  - name of the model to be spawned.
    -reference_frame  - 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  - optional: ROS namespace of gazebo offered ROS interfaces.  Defaults to /gazebo/ (e.g. /gazebo/spawn_model).
    -robot_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  - required if -trimesh is used: linear mass
    -trimesh_ixx  - required if -trimesh is used: moment of inertia about x-axis
    -trimesh_iyy  - required if -trimesh is used: moment of inertia about y-axis
    -trimesh_izz  - required if -trimesh is used: moment of inertia about z-axis
    -trimesh_gravity  - required if -trimesh is used: gravity turned on for this trimesh model
    -trimesh_material  - required if -trimesh is used: E.g. Gazebo/Blue
    -trimesh_name  - required if -trimesh is used: name of the link containing the trimesh
    -x  - optional: initial pose, use 0 if left out
    -y  - optional: initial pose, use 0 if left out
    -z  - optional: initial pose, use 0 if left out
    -R  - optional: initial pose, use 0 if left out
    -P  - optional: initial pose, use 0 if left out
    -Y  - optional: initial pose, use 0 if left out
    -J  - optional: initialize the specified joint at the specified value
    -package_to_model - optional: convert urdf 

例如 rosrun gazebo_ros spawn_model -sdf -model model.sdf

也可以写到launch文件中一次性启动

你可能感兴趣的:(ROS)