Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Negative GPS coordinate #390

Open
s1887252 opened this issue Mar 26, 2020 · 5 comments
Open

Negative GPS coordinate #390

s1887252 opened this issue Mar 26, 2020 · 5 comments
Labels

Comments

@s1887252
Copy link

While modifying the UUV sensor plugins for a project, I have found this:

// Copy the output of Gazebo's GPS sensor into a NavSatFix message this->gpsMessage.latitude = -this->gazeboGPSSensor->Latitude().Degree(); this->gpsMessage.longitude = -this->gazeboGPSSensor->Longitude().Degree();

what is the reason for making negative the latitude and longitude?

Thank you for your availability.

@nicolaje
Copy link

I have the same remark.

@MohitGupta007
Copy link

Is there a reason for the negative signs?

@pxalcantara
Copy link

@musamarcusso Can you help with this answer ?

@musamarcusso
Copy link
Member

This was an issue raised by another user (I don't recall the issue number but I will look for it) where Gazebo's GPS sensor (for which the sensor here is a ROS wrapper) was delivering the readings with the axes flipped. I will check it again.

@ViVittori
Copy link

I think the issue that @musamarcusso was pointing out is that Gazebo (as of Gazebo 11) output lat lon in (-E) -(N) U instead of the expected ENU...

This is due to a bug in Gazebo with the spherical coordinates (see gazebo issue 2022 ) and how some internal function is malfunctioning (see ign-math issue 235 )

The quick fix to get everything back to normal (ENU normal) consists as explained here to add the following to the world definition :

  <spherical_coordinates>
        <!-- currently gazebo has a bug: instead of outputing lat, long, altitude in ENU
        (x = East, y = North and z = Up) as the default configurations, it's outputting (-E)(-N)U,
        therefore we rotate the default frame 180 so that it would go back to ENU -->
        <heading_deg>180</heading_deg>
    </spherical_coordinates>

This combined with the removal of the negative latitude and longitude in the uuv simulator GPS ROS wrapper fixed the issue for me.

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

No branches or pull requests

6 participants