Ask Your Question
0

Gazebo plugin does not print anything

asked 2021-03-31 03:14:29 -0500

bach gravatar image

updated 2021-03-31 03:15:59 -0500

Hi,

I'm try to modify the ActorPlugin in order to put it in the simple_office of PAL Robotics for TIAGo simulation. The behavior of the actor is not so good, so I'm trying to print some debugs, but it doesn't work. I tried with cout, gzdbg, ROS_INFO.

I added the plugin in the pal_gazebo_plugins folder and compiled. Then I launch with:

roslaunch tiago_gazebo tiago_gazebo.launch public_sim:=true robot:=titanium world:=simple_office_with_people

Moreover if I run on the worlds folder:

gazebo simple_office_with_people.world

It prints the debugs.

Without debugging it's pretty hard to solve problems. Thank you in advance if you'll help me.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2021-03-31 03:31:11 -0500

saikishor gravatar image

Hello,

Were you adding the ActorPlugin to the list of plugins to be loaded in the simulation as in this file (gazebo.urdf.xacro)?. Unless you add it to this file, your plugins are not loaded in the gazebo environment.

edit flag offensive delete link more

Comments

Hi, thank you for your answer. I add the plugin in the .world file. The plugin is working. I can see its effects on the gazebo GUI.

However I also to add these lines to the file you point out

 <gazebo>
 <plugin name="actor1_plugin" filename="libActorPlugin.so">
        <target>0 0 1.21</target>
        <target_weight>1.15</target_weight>
        <obstacle_weight>1.8</obstacle_weight>
        <animation_factor>5.1</animation_factor>
    <room_x>-5.0 5.0</room_x>
    <room_y>-5.0 5.0</room_y>
    <room_z>1.21</room_z>
        <!-- Usage: Modify the set of models that the vector field should
             ignore when moving the actor -->
        <ignore_obstacles>
          <model>ground_plane</model>
        </ignore_obstacles>
      </plugin>
  </gazebo>

But nothing changes.

bach gravatar image bach  ( 2021-03-31 04:22:29 -0500 )edit

It seems fine, but probably the plugin is not being loaded or you have some issue exporting the plugin. Run it iand check the log and see what plugins are loaded in gazebo. If your plugin is not listed, then it cannot find or cannot load it properly

saikishor gravatar image saikishor  ( 2021-03-31 04:45:03 -0500 )edit

This is what happens by adding the plugin to the .xarco file:

[INFO] [1617185974.644589, 0.189000]: ...connected.
Traceback (most recent call last):
  File "/home/alberto/ros/tiago_public_ws/src/tiago_simulation/tiago_gazebo/scripts/tuck_arm.py", line 15, in <module>
    rospy.wait_for_message("joint_states", JointState)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/client.py", line 428, in wait_for_message
    raise rospy.exceptions.ROSInterruptException("rospy shutdown")
rospy.exceptions.ROSInterruptException: rospy shutdown
[gazebo-2] killing on exit
Segmentation fault (core dumped)
[hand_controller_spawner-9] escalating to SIGTERM
[bringup_controllers_spawner_imu-7] escalating to SIGTERM
[default_controllers_spawner-5] escalating to SIGTERM
[hand_controller_spawner-9] escalating to SIGKILL
[bringup_controllers_spawner_imu-7] escalating to SIGKILL
[default_controllers_spawner-5] escalating to SIGKILL
[rosout-1] killing on exit
[master] killing on exit
Shutdown errors:
 * process[bringup_controllers_spawner_imu-7, pid 30411]: required SIGKILL. May still be running.
 * process[hand_controller_spawner-9, pid 30428]: required SIGKILL. May still be running.
 * process[default_controllers_spawner-5, pid 30398]: required SIGKILL. May still be running.
shutting down processing monitor...
... shutting down processing monitor complete
done
bach gravatar image bach  ( 2021-03-31 05:22:10 -0500 )edit

The information log you provided is not sufficient at all, the log shows the information of the controllers alone. If there is a Segmentation fault with your plugin but not without your plugin, then something is wrong with your plugin for sure. Check your plugin for some uninitialized variables and debug the code

saikishor gravatar image saikishor  ( 2021-03-31 05:26:55 -0500 )edit

I guess this log line means that the plugin is correctly loaded, doesn't it?

[ INFO] [1617211835.384747793]: Finished loading Gazebo ROS API Plugin.
bach gravatar image bach  ( 2021-03-31 12:34:49 -0500 )edit

It could be any plugin! If this is the one printed by your plugin then yes. It is loaded but when executing your plugin there is a segmentation fault. So they are two different things.

saikishor gravatar image saikishor  ( 2021-03-31 12:37:43 -0500 )edit

Finally, the solution is indicated here.

bach gravatar image bach  ( 2021-04-01 12:53:44 -0500 )edit
0

answered 2021-03-31 03:26:59 -0500

piupiu_island gravatar image

Is it possible to use another terminal to launch your ActorPlugin, and do the debug mode in that terminal?

edit flag offensive delete link more

Comments

Hi, thank you. I didn't find anything about that. As I told I can run gazebo, loading only the world file, and it works. But I haven't the robot.

bach gravatar image bach  ( 2021-03-31 04:27:58 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-03-31 03:14:29 -0500

Seen: 73 times

Last updated: Mar 31