diff --git a/examples/python/gRPC/images/gRPC_fb_sendImages.py b/examples/python/gRPC/images/gRPC_fb_sendImages.py index df3a3d3a5..4d5286db3 100644 --- a/examples/python/gRPC/images/gRPC_fb_sendImages.py +++ b/examples/python/gRPC/images/gRPC_fb_sendImages.py @@ -156,7 +156,7 @@ def create_project(grpc_channel: Channel, project_name: str) -> str: """ fbb = flatbuffers.Builder() return createProject( - grpc_channel, fbb, project_name, "map", "WGS84", 0.0, 85.0, 23.0 + grpc_channel, fbb, project_name, "map", "EPSG:4326", 0.0, 85.0, 23.0 ) diff --git a/examples/python/gRPC/images/gRPC_pb_queryImage.py b/examples/python/gRPC/images/gRPC_pb_queryImage.py index 96081e439..68a4c7355 100755 --- a/examples/python/gRPC/images/gRPC_pb_queryImage.py +++ b/examples/python/gRPC/images/gRPC_pb_queryImage.py @@ -48,6 +48,7 @@ def query_images( theQuery.polygon.height = 800 theQuery.inMapFrame = True + theQuery.crsString = "EPSG:4326" scale = 150 vertices = [ diff --git a/examples/python/gRPC/util/fb_helper.py b/examples/python/gRPC/util/fb_helper.py index a83b3a2af..c8a1233a3 100644 --- a/examples/python/gRPC/util/fb_helper.py +++ b/examples/python/gRPC/util/fb_helper.py @@ -138,8 +138,8 @@ def getProjectInfo( {project.GeodeticPosition().Latitude()},\ long: {project.GeodeticPosition().Longitude()},\ alt: {project.GeodeticPosition().Altitude()}", - "coordinate_system": project.GeodeticPosition() - .CoordinateSystem() + "crs_string": project.GeodeticPosition() + .CrsString() .decode("utf-8"), } @@ -151,7 +151,7 @@ def createProjectRaw( builder: Builder, name: str, frameId: str, - coordSys: str, + crsStr: str, altitude: float, latitude: float, longitude: float, @@ -164,15 +164,14 @@ def createProjectRaw( builder: A flatbuffers Builder name: The name of the project frameId: The coordinate frame of the project - coordSys: The coordinate system type as a - [proj ellipsoid](https://proj.org/en/stable/usage/ellipsoids.html#built-in-ellipsoid-definitions)\ - code + crsStr: The coordinate system type as a + [crs string](https://spatialreference.org/) altitude: The altitude of the projects position on the globe - (according to coordSys) + (according to crsStr) latitude: The latitude of the projects position on the globe - (according to coordSys) + (according to crsStr) longitude: The longitude of the project positition on the globe - (according to coordSys) + (according to crsStr) Returns: A flatbuffers object of type ProjectInfo representing the project @@ -183,10 +182,10 @@ def createProjectRaw( nameBuf = builder.CreateString(name) # create a geodetic coordinates object - coordSysBuf = builder.CreateString(coordSys) + crsBuf = builder.CreateString(crsStr) GeodeticCoordinates.Start(builder) - GeodeticCoordinates.AddCoordinateSystem(builder, coordSysBuf) + GeodeticCoordinates.AddCrsString(builder, crsBuf) GeodeticCoordinates.AddAltitude(builder, altitude) GeodeticCoordinates.AddLatitude(builder, latitude) GeodeticCoordinates.AddLongitude(builder, longitude) @@ -210,7 +209,7 @@ def createProject( builder: Builder, name: str, frameId: str, - coordSys: str, + crsStr: str, altitude: float, latitude: float, longitude: float, @@ -223,14 +222,14 @@ def createProject( builder: A flatbuffers Builder name: The name of the project frameId: The coordinate frame of the project - coordSys: The coordinate system type as a [proj ellipsoid](https://proj.org/en/stable/usage/ellipsoids.html#built-in-ellipsoid-definitions)\ - code + crsStr: The coordinate system type as a + [crs string](https://spatialreference.org/) altitude: The altitude of the projects position on the globe - (according to coordSys) + (according to crsStr) latitude: The latitude of the projects position on the globe - (according to coordSys) + (according to crsStr) longitude: The longitude of the project positition on the globe - (according to coordSys) + (according to crsStr) Returns: The UUID of the created project @@ -242,7 +241,7 @@ def createProject( builder, name, frameId, - coordSys, + crsStr, altitude, latitude, longitude, @@ -259,7 +258,7 @@ def getOrCreateProject( name: str, create: bool = True, mapFrameId: str = "map", - coordSys: str = "", + crsStr: str = "", altitude: float = 0.0, latitude: float = 0.0, longitude: float = 0.0, @@ -273,14 +272,14 @@ def getOrCreateProject( name: The name of the project create: Whether to create the project if it does not exist mapFrameId: The coordinate frame of the project - coordSys: The coordinate system type as a [proj ellipsoid](https://proj.org/en/stable/usage/ellipsoids.html#built-in-ellipsoid-definitions)\ - code + crsStr: The coordinate system type as a + [crs string](https://spatialreference.org/) altitude: The altitude of the projects position on the globe - (according to coordSys) + (according to ) latitude: The latitude of the project position on the globe - (according to coordSys) + (according to crsStr) longitude: The longitude of the project position on the globe - (according to coordSys) + (according to crsStr) Returns: The UUID of the project @@ -294,7 +293,7 @@ def getOrCreateProject( builder, name, mapFrameId, - coordSys, + crsStr, altitude, latitude, longitude, diff --git a/seerep_hdf5/seerep_hdf5_core/include/seerep_hdf5_core/hdf5_core_general.h b/seerep_hdf5/seerep_hdf5_core/include/seerep_hdf5_core/hdf5_core_general.h index 3294e93ed..759ef2462 100644 --- a/seerep_hdf5/seerep_hdf5_core/include/seerep_hdf5_core/hdf5_core_general.h +++ b/seerep_hdf5/seerep_hdf5_core/include/seerep_hdf5_core/hdf5_core_general.h @@ -325,8 +325,8 @@ class Hdf5CoreGeneral inline static const std::string PROJECTFRAMEID = "projectframeid"; inline static const std::string VERSION = "version"; - inline static const std::string GEODETICLOCATION_COORDINATESYSTEM = - "geoloc_coordinatesystem"; + inline static const std::string GEODETICLOCATION_CRSSTRING = + "geoloc_crsstring"; inline static const std::string GEODETICLOCATION_ELLIPSOID = "geoloc_ellipsoid"; inline static const std::string GEODETICLOCATION_ALTITUDE = "geoloc_altitude"; diff --git a/seerep_hdf5/seerep_hdf5_core/src/hdf5_core_general.cpp b/seerep_hdf5/seerep_hdf5_core/src/hdf5_core_general.cpp index 3fe6bc794..27fa1e61d 100644 --- a/seerep_hdf5/seerep_hdf5_core/src/hdf5_core_general.cpp +++ b/seerep_hdf5/seerep_hdf5_core/src/hdf5_core_general.cpp @@ -348,8 +348,8 @@ Hdf5CoreGeneral::getHdf5Group(const std::string& group_path, bool create) void Hdf5CoreGeneral::writeGeodeticLocation( const seerep_core_msgs::GeodeticCoordinates& geo_coordinates) { - writeAttributeToHdf5(*m_file, GEODETICLOCATION_COORDINATESYSTEM, - geo_coordinates.coordinateSystem); + writeAttributeToHdf5(*m_file, GEODETICLOCATION_CRSSTRING, + geo_coordinates.crsString); writeAttributeToHdf5(*m_file, GEODETICLOCATION_ALTITUDE, geo_coordinates.altitude); writeAttributeToHdf5(*m_file, GEODETICLOCATION_LATITUDE, @@ -365,8 +365,8 @@ Hdf5CoreGeneral::readGeodeticLocation() seerep_core_msgs::GeodeticCoordinates geocoords; try { - geocoords.coordinateSystem = readAttributeFromHdf5( - *m_file, GEODETICLOCATION_COORDINATESYSTEM, m_file->getName()); + geocoords.crsString = readAttributeFromHdf5( + *m_file, GEODETICLOCATION_CRSSTRING, m_file->getName()); geocoords.altitude = readAttributeFromHdf5( *m_file, GEODETICLOCATION_ALTITUDE, m_file->getName()); geocoords.latitude = readAttributeFromHdf5( diff --git a/seerep_hdf5/seerep_hdf5_py/include/seerep_hdf5_py/hdf5_py_general.h b/seerep_hdf5/seerep_hdf5_py/include/seerep_hdf5_py/hdf5_py_general.h index fd3bd073d..069fedd9c 100644 --- a/seerep_hdf5/seerep_hdf5_py/include/seerep_hdf5_py/hdf5_py_general.h +++ b/seerep_hdf5/seerep_hdf5_py/include/seerep_hdf5_py/hdf5_py_general.h @@ -41,7 +41,7 @@ class Hdf5FileWrapper void createProject(const std::string& projectName, const std::string& rootFrameId); - void setProjectGeolocation(const std::string& coordinateSystem, + void setProjectGeolocation(const std::string& crsString, const std::string& ellipsoid, double latitude, double longitude, double altitude); @@ -129,7 +129,7 @@ class Hdf5PyGeneral : public virtual seerep_hdf5_core::Hdf5CoreGeneral // Project // ######### - void setProjectGeolocation(const std::string& coordinateSystem, + void setProjectGeolocation(const std::string& crsString, const std::string& ellipsoid, double latitude, double longitude, double altitude); diff --git a/seerep_hdf5/seerep_hdf5_py/src/hdf5_py_general.cpp b/seerep_hdf5/seerep_hdf5_py/src/hdf5_py_general.cpp index 7db803d20..90f929a42 100644 --- a/seerep_hdf5/seerep_hdf5_py/src/hdf5_py_general.cpp +++ b/seerep_hdf5/seerep_hdf5_py/src/hdf5_py_general.cpp @@ -13,15 +13,14 @@ void Hdf5FileWrapper::createProject(const std::string& projectName, io.writeProjectFrameId(rootFrameId); } -void Hdf5FileWrapper::setProjectGeolocation(const std::string& coordinateSystem, +void Hdf5FileWrapper::setProjectGeolocation(const std::string& crsString, const std::string& ellipsoid, double latitude, double longitude, double altitude) { Hdf5PyGeneral io(*this); - io.setProjectGeolocation(coordinateSystem, ellipsoid, latitude, longitude, - altitude); + io.setProjectGeolocation(crsString, ellipsoid, latitude, longitude, altitude); } Hdf5PyGeneral::Hdf5PyGeneral(Hdf5FileWrapper& hdf5File) @@ -29,15 +28,14 @@ Hdf5PyGeneral::Hdf5PyGeneral(Hdf5FileWrapper& hdf5File) { } -void Hdf5PyGeneral::setProjectGeolocation(const std::string& coordinateSystem, +void Hdf5PyGeneral::setProjectGeolocation(const std::string& crsString, const std::string& ellipsoid, double latitude, double longitude, double altitude) { const std::scoped_lock lock(*m_write_mtx); - writeAttributeToHdf5(*m_file, GEODETICLOCATION_COORDINATESYSTEM, - coordinateSystem); + writeAttributeToHdf5(*m_file, GEODETICLOCATION_CRSSTRING, crsString); writeAttributeToHdf5(*m_file, GEODETICLOCATION_ELLIPSOID, ellipsoid); writeAttributeToHdf5(*m_file, GEODETICLOCATION_LATITUDE, latitude); writeAttributeToHdf5(*m_file, GEODETICLOCATION_LONGITUDE, longitude); diff --git a/seerep_msgs/core/geodetic_coordinates.h b/seerep_msgs/core/geodetic_coordinates.h index 3ed07ea34..214e623fb 100644 --- a/seerep_msgs/core/geodetic_coordinates.h +++ b/seerep_msgs/core/geodetic_coordinates.h @@ -7,7 +7,7 @@ namespace seerep_core_msgs { struct GeodeticCoordinates { - std::string coordinateSystem; + std::string crsString; double altitude; double latitude; diff --git a/seerep_msgs/core/query.h b/seerep_msgs/core/query.h index 76b88e973..ddb7202c5 100644 --- a/seerep_msgs/core/query.h +++ b/seerep_msgs/core/query.h @@ -26,7 +26,7 @@ struct Query bool inMapFrame; // if false the query polygon is in geodetic coordinates, // otherwise in map frame std::string - coordinateSystem; // the geodetic coordinate system in which the polygon is defined + crsString; // the coordinate reference system in which the polygon is defined std::optional timeinterval; ///< only do temporal query if set std::optional>> label; ///< only do semantic query if set diff --git a/seerep_msgs/fbs/geodeticCoordinates.fbs b/seerep_msgs/fbs/geodeticCoordinates.fbs index 462b0b667..94a911b19 100644 --- a/seerep_msgs/fbs/geodeticCoordinates.fbs +++ b/seerep_msgs/fbs/geodeticCoordinates.fbs @@ -3,7 +3,7 @@ namespace seerep.fb; // source: https://en.wikipedia.org/wiki/Geodetic_coordinates table GeodeticCoordinates { - coordinateSystem:string; // e.g EPSG::4326 + crsString:string; // e.g EPSG::4326 longitude:double; // longitude measured in radians latitude:double; // latitude measured in radians diff --git a/seerep_msgs/fbs/query.fbs b/seerep_msgs/fbs/query.fbs index 78b33183e..c9a112890 100644 --- a/seerep_msgs/fbs/query.fbs +++ b/seerep_msgs/fbs/query.fbs @@ -9,7 +9,7 @@ table Query { polygon:Polygon2D; polygonSensorPosition:Polygon2D; fullyEncapsulated:bool; - coordinateSystem:string; + crsString:string; inMapFrame:bool; timeinterval:TimeInterval; label:[LabelCategory]; diff --git a/seerep_msgs/protos/geodetic_coordinates.proto b/seerep_msgs/protos/geodetic_coordinates.proto index 2dc23aaf8..45dfb8283 100644 --- a/seerep_msgs/protos/geodetic_coordinates.proto +++ b/seerep_msgs/protos/geodetic_coordinates.proto @@ -4,7 +4,7 @@ package seerep; message GeodeticCoordinates { - string coordinateSystem = 1; + string crsString = 1; double altitude = 2; double latitude = 3; diff --git a/seerep_msgs/protos/query.proto b/seerep_msgs/protos/query.proto index 46af53716..91ff2f941 100644 --- a/seerep_msgs/protos/query.proto +++ b/seerep_msgs/protos/query.proto @@ -20,5 +20,5 @@ message Query bool withoutdata = 10; uint32 maxNumData = 11; bool sortByTime = 12; - string coordinateSystem = 13; + string crsString = 13; } diff --git a/seerep_ros/seerep_ros_comm/src/point_dumper.cpp b/seerep_ros/seerep_ros_comm/src/point_dumper.cpp index b182eb35f..2ee34ac3c 100644 --- a/seerep_ros/seerep_ros_comm/src/point_dumper.cpp +++ b/seerep_ros/seerep_ros_comm/src/point_dumper.cpp @@ -53,7 +53,7 @@ void JsonPointDumper::readAndDumpJsonUos(const std::string& jsonFilePath) geoCoordinates.latitude = 0.0; geoCoordinates.longitude = 0.0; geoCoordinates.altitude = 0.0; - geoCoordinates.coordinateSystem = "EPSG:32632"; + geoCoordinates.crsString = "EPSG:32632"; ioCoreGeneral->writeGeodeticLocation(geoCoordinates); std::ifstream file(jsonFilePath, std::ifstream::binary); @@ -122,7 +122,7 @@ void JsonPointDumper::readAndDumpJsonFr(const std::string& jsonFilePath, geoCoordinates.longitude = completeJsonData["anchor_lla"]["longitude"].asDouble(); geoCoordinates.altitude = 0.0; - geoCoordinates.coordinateSystem = "EPSG:4326"; + geoCoordinates.crsString = "EPSG:4326"; ioCoreGeneral->writeGeodeticLocation(geoCoordinates); std::unordered_map classesMapping = diff --git a/seerep_ros/seerep_ros_comm/src/rosbag_dumper.cpp b/seerep_ros/seerep_ros_comm/src/rosbag_dumper.cpp index 6ed213599..272779184 100644 --- a/seerep_ros/seerep_ros_comm/src/rosbag_dumper.cpp +++ b/seerep_ros/seerep_ros_comm/src/rosbag_dumper.cpp @@ -89,7 +89,7 @@ void RosbagDumper::getGeoAnchor() geoCoordinates.latitude = msg->position.latitude; geoCoordinates.longitude = msg->position.longitude; geoCoordinates.altitude = msg->position.altitude; - geoCoordinates.coordinateSystem = "EPSG:4326"; + geoCoordinates.crsString = "EPSG:4326"; ioCoreGeneral->writeGeodeticLocation(geoCoordinates); } } diff --git a/seerep_srv/seerep_core/src/core_project.cpp b/seerep_srv/seerep_core/src/core_project.cpp index 09d1a087e..cc84d0f37 100644 --- a/seerep_srv/seerep_core/src/core_project.cpp +++ b/seerep_srv/seerep_core/src/core_project.cpp @@ -87,7 +87,7 @@ CoreProject::transformToMapFrame(const seerep_core_msgs::Polygon2D& polygon, seerep_core_msgs::GeodeticCoordinates g = m_geodeticCoordinates.value(); // check if a coordinate system on the project is not set - if (g.coordinateSystem == "") + if (g.crsString == "") { throw std::invalid_argument( "Could not transform to the projects map frame, " @@ -108,8 +108,8 @@ CoreProject::transformToMapFrame(const seerep_core_msgs::Polygon2D& polygon, // when the query was made in a seperate coordinate reference system if (query_crs != "") { - PJ* to_project_crs_rawptr = proj_create_crs_to_crs( - ctx, query_crs.c_str(), g.coordinateSystem.c_str(), 0); + PJ* to_project_crs_rawptr = + proj_create_crs_to_crs(ctx, query_crs.c_str(), g.crsString.c_str(), 0); // check whether an error occured if (to_project_crs_rawptr == nullptr) @@ -147,15 +147,51 @@ CoreProject::transformToMapFrame(const seerep_core_msgs::Polygon2D& polygon, proj_destroy(to_project_crs_rawptr); } + + PJ* crs_rawptr = proj_create(ctx, g.crsString.c_str()); + + if (crs_rawptr == nullptr) + { + int errnum = proj_context_errno(ctx); + if (errnum == 0) + { + proj_context_destroy(ctx); + throw std::runtime_error("An error occured, retrieving the ellipsoid of " + "the projects coordinate reference system, " + "couldn't identify the error code!"); + } + std::string err_info(proj_errno_string(errnum)); + proj_context_destroy(ctx); + + throw std::invalid_argument( + "Could not retrieve the ellipsoid of the projects" + "projects coordinate reference system: " + + err_info); + } + + // get the ellipsoid used in the projects crs + // TODO: handling errors + PJ* ellps_rawptr = proj_get_ellipsoid(ctx, crs_rawptr); + + proj_destroy(crs_rawptr); + if (ellps_rawptr == nullptr) + { + proj_context_destroy(ctx); + throw std::runtime_error( + "Could not retrieve the ellipsoid from the PJ object " + "created from the epsg code"); + } + // https://proj.org/en/6.3/operations/conversions/topocentric.html - // the proj pipeline has two steps, convert geodesic to cartesian coordinates - // then project to topocentric coordinates - std::string proj_pipeline = "step +proj=cart +ellps=" + g.coordinateSystem + - " \nstep +proj=topocentric +ellps" + - g.coordinateSystem + - "+lon_0=" + std::to_string(g.longitude) + - "lat_0=" + std::to_string(g.latitude) + - "h_0=" + std::to_string(g.altitude); + // the proj pipeline has two steps, convert geodesic to cartesian + // coordinates then project to topocentric coordinates + // TODO: get ellps from proj using + std::string proj_pipeline = + "+proj=pipeline +step +init=" + g.crsString + + " +step +proj=cart +ellps=WGS84 +step +proj=topocentric" + + " +ellps=WGS84 +lat_0=" + std::to_string(g.latitude) + + " +lon_0=" + std::to_string(g.longitude) + + " +h_0=" + std::to_string(g.altitude); // perform an affine transform to transpose the query polygon to map frame // the first argument is the thread context, the second is the pipeline @@ -214,7 +250,7 @@ CoreProject::getDataset(seerep_core_msgs::Query& query) if (query.polygon && !query.inMapFrame) { query.polygon.value() = - transformToMapFrame(query.polygon.value(), query.coordinateSystem); + transformToMapFrame(query.polygon.value(), query.crsString); } result.dataOrInstanceUuids = m_coreDatasets->getData(query); diff --git a/seerep_srv/seerep_core_fb/include/seerep_core_fb/core_fb_conversion.h b/seerep_srv/seerep_core_fb/include/seerep_core_fb/core_fb_conversion.h index 0084f3680..c16ccea29 100644 --- a/seerep_srv/seerep_core_fb/include/seerep_core_fb/core_fb_conversion.h +++ b/seerep_srv/seerep_core_fb/include/seerep_core_fb/core_fb_conversion.h @@ -304,7 +304,13 @@ class CoreFbConversion */ static bool fromFbQueryInMapFrame(const seerep::fb::Query* query); - static std::string fromFbQueryCoordinateSystem(const seerep::fb::Query* query); + /** + * @brief get the coordinate reference system string from the flatbuffers + * query object + * @param query the flatbuffers query object + * @return std::string the crs string + */ + static std::string fromFbQueryCrsString(const seerep::fb::Query* query); /** * @brief extracts the fullyEncapsulated flag of the flatbuffer query message diff --git a/seerep_srv/seerep_core_fb/src/core_fb_conversion.cpp b/seerep_srv/seerep_core_fb/src/core_fb_conversion.cpp index b8131a56f..209f076f5 100644 --- a/seerep_srv/seerep_core_fb/src/core_fb_conversion.cpp +++ b/seerep_srv/seerep_core_fb/src/core_fb_conversion.cpp @@ -50,7 +50,7 @@ CoreFbConversion::fromFb(const seerep::fb::Query* query, queryCore.polygon = fromFbQueryPolygon(query); queryCore.polygonSensorPos = fromFbQueryPolygonSensorPosition(query); queryCore.fullyEncapsulated = fromFbQueryFullyEncapsulated(query); - queryCore.coordinateSystem = fromFbQueryCoordinateSystem(query); + queryCore.crsString = fromFbQueryCrsString(query); queryCore.inMapFrame = fromFbQueryInMapFrame(query); queryCore.sortByTime = query->sortByTime(); @@ -430,7 +430,7 @@ CoreFbConversion::toFb(flatbuffers::grpc::MessageBuilder& fbb, const seerep_core_msgs::ProjectInfo& prjInfo) { auto geoCordsOffset = seerep::fb::CreateGeodeticCoordinatesDirect( - fbb, prjInfo.geodetCoords.coordinateSystem.c_str(), + fbb, prjInfo.geodetCoords.crsString.c_str(), prjInfo.geodetCoords.longitude, prjInfo.geodetCoords.latitude, prjInfo.geodetCoords.altitude); @@ -563,11 +563,12 @@ CoreFbConversion::fromFbSparqlQuery(const seerep::fb::Query* query) return std::nullopt; } -std::string CoreFbConversion::fromFbQueryCoordinateSystem(const seerep::fb::Query* query) +std::string +CoreFbConversion::fromFbQueryCrsString(const seerep::fb::Query* query) { - if (flatbuffers::IsFieldPresent(query, seerep::fb::Query::VT_COORDINATESYSTEM)) + if (flatbuffers::IsFieldPresent(query, seerep::fb::Query::VT_CRSSTRING)) { - return query->coordinateSystem()->str(); + return query->crsString()->str(); } return ""; diff --git a/seerep_srv/seerep_core_pb/include/seerep_core_pb/core_pb_conversion.h b/seerep_srv/seerep_core_pb/include/seerep_core_pb/core_pb_conversion.h index 977549fa6..32cecb182 100644 --- a/seerep_srv/seerep_core_pb/include/seerep_core_pb/core_pb_conversion.h +++ b/seerep_srv/seerep_core_pb/include/seerep_core_pb/core_pb_conversion.h @@ -176,13 +176,13 @@ class CorePbConversion static void fromPbInMapFrame(const seerep::pb::Query& query, seerep_core_msgs::Query& queryCore); /** - * @brief converts the coordinate systen string of the protobuf query message - * to seerep core specific message + * @brief converts the coordinate reference systen string of the protobuf + * query message to seerep core specific message * @param query the protobuf query message * @param queryCore query message in seerep core format */ - static void fromPbCoordinateSystem(const seerep::pb::Query& query, - seerep_core_msgs::Query& queryCore); + static void fromPbCrsString(const seerep::pb::Query& query, + seerep_core_msgs::Query& queryCore); /** * @brief converts the fullyEncapsulated flag of the protobuf query message to * seerep core specific message diff --git a/seerep_srv/seerep_core_pb/src/core_pb_conversion.cpp b/seerep_srv/seerep_core_pb/src/core_pb_conversion.cpp index 44c686036..137a24a30 100644 --- a/seerep_srv/seerep_core_pb/src/core_pb_conversion.cpp +++ b/seerep_srv/seerep_core_pb/src/core_pb_conversion.cpp @@ -20,7 +20,7 @@ CorePbConversion::fromPb(const seerep::pb::Query& query, fromPbWithOutData(query, queryCore); fromFbQueryMaxNumData(query, queryCore); fromPbFullyEncapsulated(query, queryCore); - fromPbCoordinateSystem(query, queryCore); + fromPbCrsString(query, queryCore); fromPbInMapFrame(query, queryCore); queryCore.sortByTime = query.sortbytime(); @@ -379,10 +379,10 @@ void CorePbConversion::fromPbInMapFrame(const seerep::pb::Query& query, queryCore.inMapFrame = query.inmapframe(); } -void CorePbConversion::fromPbCoordinateSystem(const seerep::pb::Query& query, - seerep_core_msgs::Query& queryCore) +void CorePbConversion::fromPbCrsString(const seerep::pb::Query& query, + seerep_core_msgs::Query& queryCore) { - queryCore.coordinateSystem = query.coordinatesystem(); + queryCore.crsString = query.crsstring(); } void CorePbConversion::fromPbFullyEncapsulated( diff --git a/seerep_srv/seerep_server/src/fb_meta_operations.cpp b/seerep_srv/seerep_server/src/fb_meta_operations.cpp index 7f11b7e6d..21b5058a9 100644 --- a/seerep_srv/seerep_server/src/fb_meta_operations.cpp +++ b/seerep_srv/seerep_server/src/fb_meta_operations.cpp @@ -26,8 +26,8 @@ grpc::Status FbMetaOperations::CreateProject( // extracting geodetic coordinates attribute information from flatbuffer and // saving in seerep core msg struct - projectInfo.geodetCoords.coordinateSystem = - requestMsg->geodetic_position()->coordinateSystem()->str(); + projectInfo.geodetCoords.crsString = + requestMsg->geodetic_position()->crsString()->str(); projectInfo.geodetCoords.longitude = requestMsg->geodetic_position()->longitude(); projectInfo.geodetCoords.latitude = @@ -43,7 +43,7 @@ grpc::Status FbMetaOperations::CreateProject( builder.CreateString(boost::lexical_cast(projectInfo.uuid)); auto frameIdOffset = builder.CreateString(projectInfo.frameId); auto geodeticPositionOffset = seerep::fb::CreateGeodeticCoordinates( - builder, builder.CreateString(projectInfo.geodetCoords.coordinateSystem), + builder, builder.CreateString(projectInfo.geodetCoords.crsString), projectInfo.geodetCoords.longitude, projectInfo.geodetCoords.latitude, projectInfo.geodetCoords.altitude); auto versionOffset = builder.CreateString(projectInfo.version); diff --git a/seerep_srv/seerep_server/src/pb_meta_operations.cpp b/seerep_srv/seerep_server/src/pb_meta_operations.cpp index 5eb309567..81e8de498 100644 --- a/seerep_srv/seerep_server/src/pb_meta_operations.cpp +++ b/seerep_srv/seerep_server/src/pb_meta_operations.cpp @@ -27,8 +27,8 @@ PbMetaOperations::CreateProject(grpc::ServerContext* context, projectInfo.uuid = boost::uuids::random_generator()(); // assigning geodetic coords attributes individually - projectInfo.geodetCoords.coordinateSystem = - request->geodeticcoordinates().coordinatesystem(); + projectInfo.geodetCoords.crsString = + request->geodeticcoordinates().crsstring(); projectInfo.geodetCoords.altitude = request->geodeticcoordinates().altitude(); projectInfo.geodetCoords.latitude = @@ -43,8 +43,8 @@ PbMetaOperations::CreateProject(grpc::ServerContext* context, response->set_frameid(projectInfo.frameId); response->set_version(projectInfo.version); - response->mutable_geodeticcoordinates()->set_coordinatesystem( - projectInfo.geodetCoords.coordinateSystem); + response->mutable_geodeticcoordinates()->set_crsstring( + projectInfo.geodetCoords.crsString); response->mutable_geodeticcoordinates()->set_altitude( projectInfo.geodetCoords.altitude); response->mutable_geodeticcoordinates()->set_latitude( @@ -94,8 +94,8 @@ PbMetaOperations::GetProjects(grpc::ServerContext* context, responseProjectInfo->set_version(projectInfo.version); // assigning geodetic coords attributes individually - responseProjectInfo->mutable_geodeticcoordinates()->set_coordinatesystem( - projectInfo.geodetCoords.coordinateSystem); + responseProjectInfo->mutable_geodeticcoordinates()->set_crsstring( + projectInfo.geodetCoords.crsString); responseProjectInfo->mutable_geodeticcoordinates()->set_altitude( projectInfo.geodetCoords.altitude); responseProjectInfo->mutable_geodeticcoordinates()->set_latitude(