ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

spawn a map in sdf file

asked 2021-06-12 07:07:59 -0600

helloros gravatar image

updated 2022-03-05 18:19:29 -0600

lucasw gravatar image

hello everyone,

i have created a map in gazebo building, and safed the .config and .sdf in my workspace/worlds.

In my launch file i put the following:

<arg name= "world_name" value="$(find catkin_ws)/src/worlds/model.sdf" />

everytime i launch it, i get the error that the following package was not found in

<arg name= "world_name" value="$(find catkin_ws)/src/worlds/model.sdf" />: catkin_ws

i also sourced the workspace in my ~/-bashrc, but it doesn't work either way.

can someone please explain me, how i can spawn my self created map in gazebo?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-06-15 15:15:12 -0600

Youssef_Lah gravatar image

updated 2021-06-15 15:17:13 -0600

I think you mean spawn gazebo world not the map. This is how i do to start my world in gazebo.

<launch>
      <!-- Arguments -->
      <arg name="paused" default="false"/>
      <arg name="use_sim_time" default="true"/>
      <arg name="gui" default="true"/>
      <arg name="headless" default="false"/>
      <arg name="debug" default="false"/>
      <arg name="world_name" value="$(find your_package)/worlds/your_world"/>

      <!-- Launch Gazebo with the specified world -->
      <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="debug" value="$(arg debug)" />
        <arg name="gui" value="$(arg gui)" />
        <arg name="paused" value="$(arg paused)"/>
        <arg name="use_sim_time" value="$(arg use_sim_time)"/>
        <arg name="headless" value="$(arg headless)"/>
        <arg name="world_name" value="$(arg world_name)"/>
      </include>
 ...
edit flag offensive delete link more

Question Tools

Stats

Asked: 2021-06-12 07:07:59 -0600

Seen: 333 times

Last updated: Jun 15 '21