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

Adding world file to launch gazebo crashes robot model [closed]

asked 2021-06-25 10:16:49 -0600

HarunTeper gravatar image


I am currently working on getting my car robot to work with Ros2. The current state of the robot can be found here:

I created a urdf for the robot model and implemented the plugins for the gazebo sensors and ackermann_drive. When I try to spawn the robot in an empty world (with the launch file), there is no problem and I can control it by sending /cmd_vel commands.

However, when I add the world-file to the command

    launch.actions.ExecuteProcess(cmd=['gazebo', '--verbose', '-s', '', world], output='screen' ),

the robot wheels and steering wheel all reset to the base_link position and don't move. When I remove the world argument again, everything works fine and is shown properly in Rviz and Gazebo.

Does anyone know how to fix this problem or had a similar problem?

I am using Ros2 Foxy with Gazebo11 on Ubuntu 20.04. If you want to replicate it you need to move the sonoma_raceway model to your .gazebo models folder.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by HarunTeper
close date 2021-07-07 07:29:51.283616

1 Answer

Sort by ยป oldest newest most voted

answered 2021-06-26 08:58:23 -0600

HarunTeper gravatar image

I solved it. I had to update the parameters in my .world file. Before it was:

<physics type='ode'>
  <gravity>0 0 -9.8</gravity>

and I changed it to

<physics type='ode'>
  <gravity>0 0 -9.8</gravity>

I don't know why this happened, but this solved it for me. Now all wheels are published properly in Gazebo and Rviz, even when spawned in this world.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2021-06-25 10:16:49 -0600

Seen: 585 times

Last updated: Jun 26 '21