Skip to content

Commit

Permalink
transform from one geodetic coord sys to another
Browse files Browse the repository at this point in the history
  • Loading branch information
104H authored and mmeijerdfki committed Aug 23, 2024
1 parent 54ddb0f commit 293e96c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
5 changes: 4 additions & 1 deletion seerep_srv/seerep_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ find_package(catkin REQUIRED COMPONENTS tf2)
find_package(CGAL REQUIRED)
set(CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE TRUE)

# https://github.com/OSGeo/PROJ/issues/3682
pkg_check_modules(PROJ REQUIRED IMPORTED_TARGET)

configure_file(include/SeerepCoreConfig.h.in SeerepCoreConfig.h)

include_directories(
Expand Down Expand Up @@ -66,9 +69,9 @@ target_link_libraries(
${Boost_LOG_LIBRARY}
${Boost_LOG_SETUP_LIBRARY}
${catkin_LIBRARIES}
${CURL_LIBRARIES}
CGAL::CGAL
proj
${CURL_LIBRARIES}
jsoncpp
)

Expand Down
2 changes: 2 additions & 0 deletions seerep_srv/seerep_core/include/seerep_core/core_project.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef SEEREP_CORE_CORE_PROJECT_H_
#define SEEREP_CORE_CORE_PROJECT_H_

#include <proj.h>

#include <boost/uuid/uuid.hpp> // uuid class
#include <boost/uuid/uuid_generators.hpp> // generators
#include <boost/uuid/uuid_io.hpp> // streaming operators etc.
Expand Down
6 changes: 6 additions & 0 deletions seerep_srv/seerep_core/src/core_project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const std::string CoreProject::getVersion()
return m_version;
}

// <<<<<<< HEAD
seerep_core_msgs::Polygon2D
CoreProject::transformToMapFrame(const seerep_core_msgs::Polygon2D polygon)
{
Expand Down Expand Up @@ -113,10 +114,15 @@ CoreProject::getDataset(seerep_core_msgs::Query& query)
// is the query not in map frame?
if (query.polygon && !query.inMapFrame)
{
if (query.coordinateSystem)
{
// TODO add transformation using the EPSG code
}
query.polygon.value() = transformToMapFrame(query.polygon.value());
}

result.dataOrInstanceUuids = m_coreDatasets->getData(query);

return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,24 +176,24 @@ class CorePbConversion
static void fromPbInMapFrame(const seerep::pb::Query& query,
seerep_core_msgs::Query& queryCore);
/**
<<<<<<< HEAD
* @brief converts the fullyEncapsulated flag of the protobuf query message to
* seerep core specific message
=======
* @brief converts the inMapFrame flag of the protobuf query message to seerep core specific message
* @brief converts the inMapFrame flag 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 fromPbInMapFrame(const seerep::pb::Query& query, seerep_core_msgs::Query& queryCore);
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 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 fromPbCoordinateSystem(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
>>>>>>> bool inMapFrame in query
* @brief converts the fullyEncapsulated flag of the protobuf query message to
* seerep core specific message
* @param query the protobuf query message
* @param queryCore query message in seerep core format
*/
Expand Down

0 comments on commit 293e96c

Please sign in to comment.