-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide GDAL from public interface, fix export #59
Merged
Jaeyoung-Lim
merged 1 commit into
ethz-asl:ros2
from
Ryanf55:fix-exposing-transform-header
Jan 28, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Style Checks | |
on: | ||
push: | ||
branches: | ||
- master | ||
- ros2 | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
****************************************************************************/ | ||
|
||
/** | ||
* @brief Terain map representation | ||
* @brief Terrain map representation | ||
* | ||
* @author Jaeyoung Lim <[email protected]> | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,19 +31,21 @@ | |
* | ||
****************************************************************************/ | ||
/** | ||
* @brief Node to test planner in the view utiltiy map | ||
* @brief Node to test planner in the view utility map | ||
* | ||
* | ||
* @author Jaeyoung Lim <[email protected]> | ||
*/ | ||
|
||
#include "geometry_msgs/msg/transform_stamped.hpp" | ||
#include <grid_map_msgs/msg/grid_map.h> | ||
#include <tf2_ros/static_transform_broadcaster.h> | ||
|
||
#include <geometry_msgs/msg/transform_stamped.hpp> | ||
#include <grid_map_ros/GridMapRosConverter.hpp> | ||
#include <rclcpp/rclcpp.hpp> | ||
#include <std_msgs/msg/string.hpp> | ||
|
||
#include "grid_map_geo/grid_map_geo.hpp" | ||
#include "grid_map_msgs/msg/grid_map.h" | ||
#include "grid_map_ros/GridMapRosConverter.hpp" | ||
#include "rclcpp/rclcpp.hpp" | ||
#include "std_msgs/msg/string.hpp" | ||
#include "tf2_ros/static_transform_broadcaster.h" | ||
|
||
using namespace std::chrono_literals; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/**************************************************************************** | ||
* | ||
* Copyright (c) 2022 Jaeyoung Lim, ASL, ETH Zurich, Switzerland | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* 3. Neither the name terrain-navigation nor the names of its contributors may be | ||
* used to endorse or promote products derived from this software | ||
* without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | ||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | ||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
****************************************************************************/ | ||
|
||
#include "grid_map_geo/transform.hpp" | ||
|
||
#if __APPLE__ | ||
#include <gdal.h> | ||
#include <gdal_priv.h> | ||
#include <ogr_p.h> | ||
#include <ogr_spatialref.h> | ||
#else | ||
#include <gdal/gdal.h> | ||
#include <gdal/gdal_priv.h> | ||
#include <gdal/ogr_p.h> | ||
#include <gdal/ogr_spatialref.h> | ||
#endif | ||
|
||
Eigen::Vector3d transformCoordinates(ESPG src_coord, ESPG tgt_coord, const Eigen::Vector3d source_coordinates) { | ||
OGRSpatialReference source, target; | ||
source.importFromEPSG(static_cast<int>(src_coord)); | ||
target.importFromEPSG(static_cast<int>(tgt_coord)); | ||
|
||
OGRPoint p; | ||
p.setX(source_coordinates(0)); | ||
p.setY(source_coordinates(1)); | ||
p.setZ(source_coordinates(2)); | ||
p.assignSpatialReference(&source); | ||
|
||
p.transformTo(&target); | ||
Eigen::Vector3d target_coordinates(p.getX(), p.getY(), p.getZ()); | ||
return target_coordinates; | ||
} | ||
|
||
Eigen::Vector3d transformCoordinates(ESPG src_coord, const std::string wkt, const Eigen::Vector3d source_coordinates) { | ||
OGRSpatialReference source, target; | ||
char* wkt_string = const_cast<char*>(wkt.c_str()); | ||
source.importFromEPSG(static_cast<int>(src_coord)); | ||
target.importFromWkt(&wkt_string); | ||
|
||
OGRPoint p; | ||
p.setX(source_coordinates(0)); | ||
p.setY(source_coordinates(1)); | ||
p.setZ(source_coordinates(2)); | ||
p.assignSpatialReference(&source); | ||
|
||
p.transformTo(&target); | ||
Eigen::Vector3d target_coordinates(p.getX(), p.getY(), p.getZ()); | ||
return target_coordinates; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Add gtest based cpp test target and link libraries | ||
cmake_minimum_required(VERSION 3.14) | ||
project(grid_map_export_test) | ||
find_package(grid_map_geo REQUIRED) | ||
add_executable(main main.cpp) | ||
target_link_libraries(main PRIVATE grid_map_geo::grid_map_geo) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <iostream> | ||
|
||
#include "grid_map_geo/grid_map_geo.hpp" | ||
|
||
int main() { | ||
// Instantiate the class and call it so this doesn't get optimized out. | ||
auto gmg = GridMapGeo(); | ||
std::cout << gmg.getCoordinateName() << std::endl; | ||
return 0; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to revert this as yaml-cpp does not resolve correctly on macOS. Suggest:
to make it clear why it's included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srmainwaring Thanks for pointing this out. Probably means we need a macOS CI for this package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, though the problem is that the pre-requisite is a functioning humble build for macOS CI and that's expensive as needs to be built from source. Ideally there would be a macOS runner with ROS 2 support we could pull down, put I don't think this exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see yaml being used which is the reason I took it out; can you share the compile or runtime error you have if this is absent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You won't see in on Ubuntu. The compiler error is an unresolved library (yaml-cpp) on macOS. This is because the yaml_cpp_vendored library (transitive) dependencies do not seem to work correctly on macOS. It's a pain, should be fixed upstream, but macOS is Tier 3 support so is unlikely to happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks for the info. I contributed improvements to yamlcpp (not the vendored version, but upstream).
Related: Ryanf55#1 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create an upstream issue just to track?
https://github.com/ros2/yaml_cpp_vendor/issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch: #60