Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to implement the plugin into Ros and Gazebo #2

Open
Giaco94 opened this issue Dec 5, 2019 · 5 comments
Open

How to implement the plugin into Ros and Gazebo #2

Giaco94 opened this issue Dec 5, 2019 · 5 comments

Comments

@Giaco94
Copy link

Giaco94 commented Dec 5, 2019

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!

@plumewind
Copy link

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?

@plumewind
Copy link

I fixed it !
true

@wangshanpao1991
Copy link

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.

@wangshanpao1991
Copy link

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.

@gennscar
Copy link

gennscar commented Apr 16, 2021

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:

model://sun model://ground_plane 0 0 -9.8066 quick 10 1.3 0 0 0.2 100 0.001 0.004 1 250 6.0e-6 2.3e-5 -4.2e-5 0 0 1.5 0 0 0 1 0.2 0.2 0.2
  <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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants