Gazebo plugin does not print anything
Hi,
I'm try to modify the ActorPlugin in order to put it in the simpleoffice 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, ROSINFO.
I added the plugin in the palgazeboplugins 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.
Asked by bach on 2021-03-31 03:14:29 UTC
Answers
Is it possible to use another terminal to launch your ActorPlugin, and do the debug mode in that terminal?
Asked by piupiu_island on 2021-03-31 03:26:59 UTC
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.
Asked by bach on 2021-03-31 04:27:58 UTC
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.
Asked by saikishor on 2021-03-31 03:31:11 UTC
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.
Asked by bach on 2021-03-31 04:22:29 UTC
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
Asked by saikishor on 2021-03-31 04:45:03 UTC
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
Asked by bach on 2021-03-31 05:22:10 UTC
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
Asked by saikishor on 2021-03-31 05:26:55 UTC
I guess this log line means that the plugin is correctly loaded, doesn't it?
[ INFO] [1617211835.384747793]: Finished loading Gazebo ROS API Plugin.
Asked by bach on 2021-03-31 12:34:49 UTC
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.
Asked by saikishor on 2021-03-31 12:37:43 UTC
Comments