0
$\begingroup$

Rosanswers logo

Hi All,

Thanks to a helpful volunteer I managed to fire up Gazebo from ROS2. However, the gazebo-plugin (on the branch gazebo-plugin) apparently does not load, although I have a set of different logging statements and even a file creation one to create a file in /tmp. I find this message totally misleading:

[spawn_entity.py-2] [INFO] [1617560451.452969406] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [gazebo_arm_model_plugin]

The file in /tmp does not appear after running the command below:

What do I do wrong?

Thank you in advance. Best regards: Balázs Bámer

balazs@sohivatal:~/munka/cuda-trajectory-planner/ros-workspace$ ros2 launch src/link-intersection-brute-force/launch/gazebo.launch.py 
[INFO] [launch]: All log files can be found below /home/balazs/.ros/log/2021-04-04-20-20-46-684235-sohivatal-25224
[INFO] [launch]: Default logging verbosity is set to INFO
{'GAZEBO_MODEL_PATH': '/home/balazs/munka/cuda-trajectory-planner/ros-workspace/install/link-intersection-brute-force/share/link-intersection-brute-force', 'GAZEBO_PLUGIN_PATH': '', 'GAZEBO_RESOURCE_PATH': ''}
[INFO] [gazebo-1]: process started with pid [25226]
[INFO] [spawn_entity.py-2]: process started with pid [25228]
[spawn_entity.py-2] [INFO] [1617560448.238524946] [spawn_entity]: Spawn Entity started
[spawn_entity.py-2] [INFO] [1617560448.239773694] [spawn_entity]: Loading entity XML from file /home/balazs/munka/cuda-trajectory-planner/ros-workspace/install/link-intersection-brute-force/share/link-intersection-brute-force/px150_coll.sdf
[spawn_entity.py-2] [INFO] [1617560448.248038657] [spawn_entity]: Waiting for service /spawn_entity, timeout = 5
[spawn_entity.py-2] [INFO] [1617560448.250261885] [spawn_entity]: Waiting for service /spawn_entity
[gazebo-1] Gazebo multi-robot simulator, version 11.3.0
[gazebo-1] Copyright (C) 2012 Open Source Robotics Foundation.
[gazebo-1] Released under the Apache 2 License.
[gazebo-1] http://gazebosim.org
[gazebo-1] 
[gazebo-1] Gazebo multi-robot simulator, version 11.3.0
[gazebo-1] Copyright (C) 2012 Open Source Robotics Foundation.
[gazebo-1] Released under the Apache 2 License.
[gazebo-1] http://gazebosim.org
[gazebo-1] 
[gazebo-1] [Msg] Waiting for master.
[gazebo-1] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[gazebo-1] [Msg] Publicized address: 192.168.0.153
[gazebo-1] [Wrn] [ModelDatabase.cc:340] Getting models from[/]. This may take a few seconds.
[gazebo-1] [Wrn] [ModelDatabase.cc:212] Unable to connect to model database using [//database.config]. Only locally installed models will be available.
[gazebo-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [""] [model://sun]
[gazebo-1] [Wrn] [ModelDatabase.cc:340] Getting models from[/]. This may take a few seconds.
[gazebo-1] [Wrn] [ModelDatabase.cc:212] Unable to connect to model database using [//database.config]. Only locally installed models will be available.
[gazebo-1] [Wrn] [SystemPaths.cc:459] File or path does not exist [""] [model://ground_plane]
[gazebo-1] Error Code 12 Msg: Unable to find uri[model://sun]
[gazebo-1] Error Code 12 Msg: Unable to find uri[model://ground_plane]
[spawn_entity.py-2] [INFO] [1617560451.028068043] [spawn_entity]: Calling service /spawn_entity
[gazebo-1] [Msg] Waiting for master.
[gazebo-1] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[gazebo-1] [Msg] Publicized address: 192.168.0.153
[gazebo-1] [Err] [InsertModelWidget.cc:402] Missing model.config for model "/home/balazs/munka/cuda-trajectory-planner/ros-workspace/install/link-intersection-brute-force/share/link-intersection-brute-force/cmake"
[gazebo-1] [Err] [InsertModelWidget.cc:402] Missing model.config for model "/home/balazs/munka/cuda-trajectory-planner/ros-workspace/install/link-intersection-brute-force/share/link-intersection-brute-force/environment"
[gazebo-1] [Err] [InsertModelWidget.cc:402] Missing model.config for model "/home/balazs/munka/cuda-trajectory-planner/ros-workspace/install/link-intersection-brute-force/share/link-intersection-brute-force/hook"
[gazebo-1] [Err] [InsertModelWidget.cc:402] Missing model.config for model "/home/balazs/munka/cuda-trajectory-planner/ros-workspace/install/link-intersection-brute-force/share/link-intersection-brute-force/meshes"
[gazebo-1] [Wrn] [ModelDatabase.cc:212] Unable to connect to model database using [//database.config]. Only locally installed models will be available.
[spawn_entity.py-2] [INFO] [1617560451.452969406] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [gazebo_arm_model_plugin]
[spawn_entity.py-2] [INFO] [1617560451.454247959] [spawn_entity]: Waiting for shutdown to delete entity [gazebo_arm_model_plugin]
[gazebo-1] [Msg] Loading world file [/home/balazs/munka/cuda-trajectory-planner/ros-workspace/install/link-intersection-brute-force/share/link-intersection-brute-force/empty.world]
[gazebo-1] [Wrn] [Publisher.cc:136] Queue limit reached for topic /gazebo/default/physics/contacts, deleting message. This warning is printed only once.
[INFO] [gazebo-1]: process has finished cleanly [pid 25226]
[gazebo-1] 
[gazebo-1] 
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[spawn_entity.py-2] [INFO] [1617561223.906878550] [spawn_entity]: Ctrl-C detected
[spawn_entity.py-2] [INFO] [1617561223.907866406] [spawn_entity]: Deleting entity [gazebo_arm_model_plugin]
[ERROR] [spawn_entity.py-2]: process[spawn_entity.py-2] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[INFO] [spawn_entity.py-2]: sending signal 'SIGTERM' to process[spawn_entity.py-2]
[ERROR] [spawn_entity.py-2]: process has died [pid 25228, exit code -15, cmd '/opt/ros/foxy/lib/gazebo_ros/spawn_entity.py -entity gazebo_arm_model_plugin -x 0 -y 0 -z 0 -b -file /home/balazs/munka/cuda-trajectory-planner/ros-workspace/install/link-intersection-brute-force/share/link-intersection-brute-force/px150_coll.sdf --ros-args'].
balazs@sohivatal:~/munka/cuda-trajectory-planner/ros-workspace$

Originally posted by balazs-bamer on ROS Answers with karma: 15 on 2021-04-04

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I see a things you can fix right off the bat.

1st, your Gazebo model path seems to only include your custom folder:

{'GAZEBO_MODEL_PATH': '/home/balazs/munka/cuda-trajectory-planner/ros-workspace/install/link-intersection-brute-force/share/link-intersection-brute-force', 'GAZEBO_PLUGIN_PATH': '', 'GAZEBO_RESOURCE_PATH': ''}

You should always append to the Gazebo model path, not overwrite it. In theory, your model path should also include /home/balazs/.gazebo/models. This is where it will find the models that are giving you warnings (sun, ground plane), without having to try to download them every time you launch your simulation.

Depending on how you are setting it, it would be something like this, to preserve gazebo's default path: export GAZEBO_MODEL_PATH=[MY_PACKAGE_PATH]/models:$GAZEBO_MODEL_PATH

You have many [gazebo-1] [Err] [InsertModelWidget.cc:402] Missing model.config for model errors. I would recommend making a 'models' folder within your package and moving your model.config and urdf inside it. Gazebo expects all folders in the model path to contain a model.config.e.g.

link-intersection-brute-force
|-- models
|--|-- link-intersection-brute-force
|--|--|-- model.config
|--|--|-- urdf
|--|--|-- meshes

I am a bit confused by your question, however. Your URDF file does not have a plugin... Could you clarify what is not working as expected? Is your robot not being loaded into Gazebo? Or is it being spawned, but a specific model plugin you've attached is not working as expected?


Originally posted by shonigmann with karma: 1567 on 2021-04-05

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by balazs-bamer on 2021-04-06:
Thank you for pointing out errors in the paths and folder structure. I will fix them in the evening. About what not works:

The model appears in Gazebo, does some swings as it hangs without torques. This is fine.

The library compiuled from gazebo-plugin.cpp does not actually run, although Gazebo logs say it has been spawned. I know it does not run because I creaste a file in /tmp in the Load method and it doesn't get created.

Comment by shonigmann on 2021-04-06:
Thanks for the clarification.

So where do you expect the plugin you created to get started? You haven't included a tag in your sdf, so Gazebo won't start it for you.

And the only mention I can see of your plugin in your launch file is in the --entity tag on your spawn_model node. If you look at the details of [spawn_model.py](https://github.com/ros-simulation/gazebo_ros_pkgs/blob/foxy/gazebo_ros/scripts/spawn_entity.py) you will see that the entity tag only sets the name of the model in Gazebo. It has nothing to do with a plugin you want to add.

Gazebo is telling you that the model is spawned correctly, because, from your description, it has done everything you asked it to. I would suggest looking at the tutorial here for details on adding your plugin to your model.

Also, I assume you are using ROS2 Foxy and Gazebo 11. I encourage you to add tags to your question to reflect what software you are using.

Comment by balazs-bamer on 2021-04-06:
I experimented a while with these things could not get anything close to my previous solution. About plugin launch: after reading your last comment, I could hack it together. Not a standard solution, but after wasting several days on getting this stuff work, no more time on it. Thank you very much!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.