Gazebo | Ignition | Community
Ask Your Question
0

GPS sensor plugin in Ignition

asked 2022-12-12 01:00:32 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi!

Is there an equivalent to the "libhector_gazebo_ros_gps.so" plugin in Ignition (Fortress)? From what I can see, the NavSat-plugin is the closest, but I can't find any parameters to link it to a model.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-12-13 10:06:26 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

By browsing github I found out how to use the NavSat plugin (ignition-gazebo-navsat-system if that was unclear). So basically you have to do something like this if you are using SDF:

<model name="NavSat">
  <pose>0 0 0.05 0 0.0 0</pose>
  <link name="link">
    <inertial>
      <mass>0.1</mass>
      <inertia>
        <ixx>0.000166667</ixx>
        <iyy>0.000166667</iyy>
        <izz>0.000166667</izz>
      </inertia>
    </inertial>

    <collision name="collision">
      <geometry>
        <box>
          <size>0.1 0.1 0.1</size>
        </box>
      </geometry>
    </collision>
    <visual name="visual">
      <geometry>
        <box>
          <size>0.1 0.1 0.1</size>
        </box>
      </geometry>
    </visual>

    <sensor name="navsat" type="navsat">
      <always_on>1</always_on>
      <update_rate>1</update_rate>
      <topic>navsat</topic>
    </sensor>
  </link>
</model>

For this to work you also need to set the spherical coordinates for navsat. I did this is in my world SDF file, and it looks like this:

<spherical_coordinates>
  <surface_model>EARTH_WGS84</surface_model>
  <world_frame_orientation>ENU</world_frame_orientation>
  <latitude_deg>-22.986687</latitude_deg>
  <longitude_deg>-43.202501</longitude_deg>
  <elevation>0</elevation>
  <heading_deg>0</heading_deg>
</spherical_coordinates>

However, I was not able this from an URDF file, which is what I want to do.

EDIT: If you are using ROS2 you can call the service /world/world_name/set_spherical_coordinates service from your launch.py file to set the spherical coordinates.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-12-12 01:00:32 -0600

Seen: 1,085 times

Last updated: Dec 13 '22