gazebosensorplugins
gazebosensorplugins copied to clipboard
How to implement the plugin into Ros and Gazebo
I'm sorry but i have some trouble implementing your plugin on my gazebo simulation. The plugin has to be write into an .sdf file as
<sdf version="1.5">
<plugin name='libgtec_uwb_plugin' filename='libgtec_uwb_plugin.so'>
<update_rate>25</update_rate>
<nlosSoftWallWidth>0.25</nlosSoftWallWidth>
<tag_z_offset>1.5</tag_z_offset>
<tag_link>tag_0</tag_link>
<anchor_prefix>uwb_anchor</anchor_prefix>
<all_los>false</all_los>
<tag_id>0</tag_id>
</plugin>
</sdf>
or i need to write something more inside my sdf file?
Moreover the following code
<sdf version="1.5">
<model name="uwb_anchor0">
<pose>0 0 1.5 0 0 0</pose>
<static>1</static>
<link name="link">
<visual name="visual">
<geometry>
<box>
<size>0.2 0.2 0.2</size>
</box>
</geometry>
</visual>
</link>
</model>
i have to write inside the same .sdf file where i have write the plugin or inside the .world file?
Can you provide a simple example of it?
Thank you for your help!
me, too
and I got a problem: In the model type plugin(UwbPlugin.cpp), I check the links like this:
std::vector<physics::LinkPtr> links = _model->GetLinks(); for (int i = 0; i < links.size(); ++i) { ROS_INFO("Link[%d]: %s", i, links[i]->GetName().c_str()); }
but no uwb_tag_link(which I want , and is writen in urdf.xacro), so the link->getWorldPose is wrong, what should i do?
I fixed it !
I fixed it ! true
Hello, I have met the same wrong with you. Could you tell me how to fix it? Thank you very much.
I'm sorry but i have some trouble implementing your plugin on my gazebo simulation. The plugin has to be write into an .sdf file as
<sdf version="1.5"> <plugin name='libgtec_uwb_plugin' filename='libgtec_uwb_plugin.so'> <update_rate>25</update_rate> <nlosSoftWallWidth>0.25</nlosSoftWallWidth> <tag_z_offset>1.5</tag_z_offset> <tag_link>tag_0</tag_link> <anchor_prefix>uwb_anchor</anchor_prefix> <all_los>false</all_los> <tag_id>0</tag_id> </plugin> </sdf>
or i need to write something more inside my sdf file?
Moreover the following code
<sdf version="1.5"> <model name="uwb_anchor0"> <pose>0 0 1.5 0 0 0</pose> <static>1</static> <link name="link"> <visual name="visual"> <geometry> <box> <size>0.2 0.2 0.2</size> </box> </geometry> </visual> </link> </model>
i have to write inside the same .sdf file where i have write the plugin or inside the .world file?
Can you provide a simple example of it?
Thank you for your help!
Hello , the plugin should be added in the .sdf file with 'link_uwb' . And the model "UWB_anchor*" should be added in .world file.
When I try to open the gazebo world with the plugin, after succesfully compiling the workspace, I receive this error
"A ROS node for Gazebo has not been initialized, unable to load plugin. Load the Gazebo system plugin 'libgazebo_ros_api_plugin.so' in the gazebo_ros package)".
This is the world I have created:
<plugin name='libgtec_uwb_plugin' filename='libgtec_uwb_plugin.so'>
<update_rate>25</update_rate>
<nlosSoftWallWidth>0.25</nlosSoftWallWidth>
<tag_z_offset>1.5</tag_z_offset>
<tag_link>tag_0</tag_link>
<anchor_prefix>uwb_anchor</anchor_prefix>
<all_los>false</all_los>
<tag_id>0</tag_id>
</plugin>
</model>
<model name="uwb_anchor1">
<pose>1.5 0 0 0 0 0</pose>
<static>1</static>
<link name="link">
<visual name="visual">
<geometry>
<box>
<size>0.2 0.2 0.2</size>
</box>
</geometry>
</visual>
</link>
<plugin name='libgtec_uwb_plugin' filename='libgtec_uwb_plugin.so'>
<update_rate>25</update_rate>
<nlosSoftWallWidth>0.25</nlosSoftWallWidth>
<tag_z_offset>0.0</tag_z_offset>
<tag_link>tag_1</tag_link>
<anchor_prefix>uwb_anchor</anchor_prefix>
<all_los>false</all_los>
<tag_id>1</tag_id>
</plugin>
</model>
Do you know how to solve this?