Gazebo | Ignition | Community
Ask Your Question
0

How to set physics engine in Gazebo through ROS

asked 2018-10-12 09:00:49 -0600

kumpakri gravatar image

I was researching the physics engines available for Gazebo and wanted to try other then default engine. In those slides, it says, that you can define what engine to use in the world file. In form

<world><physics type=”simbody” />...

I found this in my world file that was created in Gazebo client

<physics name='default_physics' default='0' type='ode'>

If I rewrite the type to an nonexistent engine type and launch the world from ROS launch file, there is no error. If I rewrite it to 'simbody' or 'bullet', nothing changes. The simulation in all the cases starts with the ode engine. If I start Gazebo client with commands

rosrun gazebo_ros gazebo --verbose -e bullet

or

rosrun gazebo_ros gazebo --verbose -e simbody

the physics engine does correspond to the given type. So how can I do it within the world file?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2018-10-12 09:49:11 -0600

chapulina gravatar image

If I rewrite the type to an nonexistent engine type and launch the world from ROS launch file, there is no error. If I rewrite it to 'simbody' or 'bullet', nothing changes. The simulation in all the cases starts with the ode engine.

Have you tried removing the default="0"? You can read more about physics profiles here.

edit flag offensive delete link more

Comments

That is a good point. But even though I put `default="1" type="simbody"` in there, it loads ODE.

kumpakri gravatar imagekumpakri ( 2018-10-15 03:59:49 -0600 )edit

How are you checking which physics engine is being loaded, through the GUI?

chapulina gravatar imagechapulina ( 2018-10-15 14:37:20 -0600 )edit

I check the engine type in the physics tab in the loaded gazebo client.

kumpakri gravatar imagekumpakri ( 2018-10-15 14:56:29 -0600 )edit
1

That's strange, it works for me. Do you get the correct engine if you load the world without passing through ROS? Maybe gazebo_ros_pkgs is overriding the value in the world file.

chapulina gravatar imagechapulina ( 2018-10-15 15:05:50 -0600 )edit
1

You are right. I am always using the empty_world.launch from the gazebo_ros packgae to run the Gazebo from ROS launch files. This launch file defines the default physics engine to be the ode, so if I don't add the physics argument to the parameters of gazebo world, the ode engine will load no matter what I set in the world sdf file. In order for the physics type setting in the WORLD file to work, the -e $(arg physics) argument in the gzserver node launching tags needs to be removed.

kumpakri gravatar imagekumpakri ( 2019-08-16 11:08:51 -0600 )edit

What did you end up changing in your launch file to make it work?

Rellum gravatar imageRellum ( 2022-09-09 04:37:14 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2018-10-12 09:00:49 -0600

Seen: 3,631 times

Last updated: Oct 12 '18