You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Description
When using DEM models that have the global origin in the meta data, it is not possible to override the world location using the spherical_coordinates tag in the sdf file(world).
Even if the spherical_coordinates are modified, the world->SphericalCoords() returns the origin of the DEM file, not the origin defined with the spherical_coordinates flag.
It seems like gazebo overrides the spherical coordinate defined in the world file and uses the origin of the DEM if I understand correctly the following.
// Modify the reference geotedic latitude/longitude.
// A GPS sensor will use the real georeferenced coordinates of the terrain.
common::SphericalCoordinatesPtr sphericalCoordinates;
sphericalCoordinates = this->world->SphericalCoords();
if (sphericalCoordinates)
{
ignition::math::Angle latitude, longitude;
double elevation;
this->dem.GetGeoReferenceOrigin(latitude, longitude);
elevation = this->dem.GetElevation(0.0, 0.0);
sphericalCoordinates->SetLatitudeReference(latitude);
sphericalCoordinates->SetLongitudeReference(longitude);
sphericalCoordinates->SetElevationReference(elevation);
sphericalCoordinates.reset();
}
else
gzerr << "Unable to get a valid SphericalCoordinates pointer\n";
return 0;
}
Expected behavior
world->SphericalCoords() returns the origin of the DEM file if there are no spherical_coordinates defined in the world file
world->SphericalCoords() returns the location defined in spherical_coordinates if defined in world file
Hello all. I know this issue is quite old, but the bug seems to be still happening. See for example this issue in PX4 forum.
Pinging recent contributors @chapulina@scpeters@iche033, anything you can do would help me.
Problem Description
When using DEM models that have the global origin in the meta data, it is not possible to override the world location using the
spherical_coordinates
tag in the sdf file(world).Even if the
spherical_coordinates
are modified, theworld->SphericalCoords()
returns the origin of the DEM file, not the origin defined with thespherical_coordinates
flag.It seems like gazebo overrides the spherical coordinate defined in the world file and uses the origin of the DEM if I understand correctly the following.
https://github.com/osrf/gazebo/blob/063d7386ed5499c2883de48e19ff5fb9dec01dff/gazebo/physics/HeightmapShape.cc#L109-L131
Expected behavior
world->SphericalCoords()
returns the origin of the DEM file if there are nospherical_coordinates
defined in the world fileworld->SphericalCoords()
returns the location defined inspherical_coordinates
if defined in world file@ahcorde FYI
Additional Context
The text was updated successfully, but these errors were encountered: