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

Custom gazebo world not loading in launchfile

asked 2021-02-05 00:43:55 -0500

GeorgNo gravatar image

Hello there,

I have quite a confusing problem. I created a custom Gazebo world that I am able to launch via:

$ gazebo /home/georg/catkin_ws/src/ml/worlds/chapter1_3.world

as well as with:

$ roslaunch gazebo_ros empty_world.launch world_name:="/home/georg/catkin_ws/src/ml/worlds/chapter1_3.world"

but with the following launchfile I can't manage

<launch>
    <arg name="world_file" default="$(find ml)/worlds/chapter1_3.world"/>

    <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="extra_gazebo_args" default="--verbose"/>

    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" value="$(arg world_file)"/>
        <arg name="paused" value="$(arg paused)"/>
        <arg name="use_sim_time" value="$(arg use_sim_time)"/>
        <arg name="gui" value="$(arg gui)"/>
        <arg name="headless" value="$(arg headless)"/>
        <arg name="debug" value="$(arg debug)"/>
        <arg name="extra_gazebo_args" value="$(arg extra_gazebo_args"/>
    </include>
</launch>

And I can use roscd mlto navigate to /home/georg/catkin_ws/src/ml.

edit retag flag offensive close merge delete

Comments

What is the error that you are getting?

skpro19 gravatar image skpro19  ( 2021-02-05 00:51:44 -0500 )edit

None, it just spawns the empty world.

GeorgNo gravatar image GeorgNo  ( 2021-02-05 01:24:11 -0500 )edit

After adding: <arg name="verbose" value="true"/> inside the include tag I can see the following error:

[Wrn] [SystemPaths.cc:459] File or path does not exist [""] [$(arg]
[Err] [Server.cc:444] Could not open file[$(arg]
[Wrn] [Server.cc:359] Falling back on worlds/empty.world

Replaced $(find ml)/worlds/chapter1_3.world with the absolute path and still the same error.

However if I run roslaunch gazebo_ros empty_world.launch verbose:="true" world_name:="/home/georg/catkin_ws/src/ml/worlds/chapter1_3.world the world spawns.

GeorgNo gravatar image GeorgNo  ( 2021-02-05 01:51:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-02-05 03:47:19 -0500

GeorgNo gravatar image

updated 2021-02-06 07:16:55 -0500

Had a typo at <arg name="extra_gazebo_args" value="$(arg extra_gazebo_args)"/> ...

Edit: Forgot the closing bracket, also needed to remove the line <arg name="extra_gazebo_args" value="$(arg extra_gazebo_args)"/> completely for it to work

edit flag offensive delete link more

Comments

What was the typo?

skpro19 gravatar image skpro19  ( 2021-02-05 09:27:32 -0500 )edit

Also, can you please close this question as you have solved the issue at hand.

skpro19 gravatar image skpro19  ( 2021-02-05 09:30:10 -0500 )edit

Also, can you please close this question as you have solved the issue at hand.

no, please don't.

Questions with answers should have the answer marked as accepted by clicking the little checkmark icon to the left of the answer.

Closing questions is reserved for duplicates, off-topic questions etc. Answered questions should not be closed.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-06 07:52:40 -0500 )edit

@gvdhoom Oh okay.

skpro19 gravatar image skpro19  ( 2021-02-06 08:46:03 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-02-05 00:43:55 -0500

Seen: 1,771 times

Last updated: Feb 06 '21