Skip to content

Commit

Permalink
fix runtime error
Browse files Browse the repository at this point in the history
Signed-off-by: Takagi, Isamu <[email protected]>
  • Loading branch information
isamu-takagi committed Dec 14, 2023
1 parent e785eba commit 6cf1103
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,27 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LANELET2_MAP_LOADER__LANELET2_DUMMY_PROJECTOR_HPP_
#define LANELET2_MAP_LOADER__LANELET2_DUMMY_PROJECTOR_HPP_
#ifndef LANELET2_MAP_LOADER__LANELET2_LOCAL_PROJECTOR_HPP_
#define LANELET2_MAP_LOADER__LANELET2_LOCAL_PROJECTOR_HPP_

#include <lanelet2_io/Projection.h>

namespace lanelet::projection
{

class DummyProjector : public Projector
class LocalProjector : public Projector
{
public:
BasicPoint3d forward(const GPSPoint &) const override { return {}; } // NOLINT
LocalProjector() : Projector(Origin(GPSPoint{})) {}

BasicPoint3d forward(const GPSPoint & gps) const override // NOLINT
{
return BasicPoint3d{0.0, 0.0, gps.ele};
}

GPSPoint reverse(const BasicPoint3d &) const override { return {}; }
};

} // namespace lanelet::projection

#endif // LANELET2_MAP_LOADER__LANELET2_DUMMY_PROJECTOR_HPP_
#endif // LANELET2_MAP_LOADER__LANELET2_LOCAL_PROJECTOR_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include "map_loader/lanelet2_map_loader_node.hpp"

#include "lanelet2_dummy_projector.hpp"
#include "lanelet2_local_projector.hpp"

#include <ament_index_cpp/get_package_prefix.hpp>
#include <geography_utils/lanelet2_projector.hpp>
Expand Down Expand Up @@ -102,7 +102,7 @@ lanelet::LaneletMapPtr Lanelet2MapLoaderNode::load_map(
return map;
}
} else {
const lanelet::projection::DummyProjector projector;
const lanelet::projection::LocalProjector projector;
const lanelet::LaneletMapPtr map = lanelet::load(lanelet2_filename, projector, &errors);

// overwrite local_x, local_y
Expand Down

0 comments on commit 6cf1103

Please sign in to comment.