No force_torque topic is published when loading xacro into ignition gazebo via ros2 launch
Hi, I want to simulate the force torque sensor in ignition gazebo together with ros2. I loaded the xacro file to ignition gazebo, the force torque sensor seems to be created successfully, but no forcetorque topic is published by "ign topic -l". If I save the world into sdf file and load it into ignition gazebo, the forcetorque topic appears.
The package is modified from rosgzsimdemos. link: https://github.com/gazebosim/docs/files/10556514/testdemos.zip
ros2 launch testdemos loadxacro.launch.py
ros2 launch testdemos loadsdf.launch.py
ign topic -l
Environment: ubuntu 22.04, ros2 humble, Ignition Gazebo 6.11.0
Thanks for any help!
Jia
Asked by xibeisiber on 2023-01-31 20:00:44 UTC
Answers
Partly solved.
For some unknown reason, the <plugin filename="ignition-gazebo-forcetorque-system" name="ignition::gazebo::systems::ForceTorque" />
can not be successfully loaded when written in xacro file.
A makeshift solution is to add this plugin in /usr/share/ignition/ignition-gazebo6/worlds/empty.sdf
.
Asked by xibeisiber on 2023-02-02 03:24:52 UTC
Comments
hmm, that's really strange. Do you have a small example that can demonstrate the xacro issue?
Asked by azeey on 2023-02-03 14:09:56 UTC
yes. The example package is https://github.com/gazebosim/docs/files/10556514/test_demos.zip.
Asked by xibeisiber on 2023-02-05 02:34:17 UTC
Ah, after looking into this quite a bit, I realized the problem was that the plugin was being added as part of the model while, as you've discovered, it should have been part of the world. i.e, the ForceTorque
system is meant to be a world plugin, not a model plugin.
Asked by azeey on 2023-02-06 18:15:46 UTC
Thanks for your reply!
Asked by xibeisiber on 2023-04-07 02:38:32 UTC
Comments