Skip to content

Commit

Permalink
feat(lanelet2_utils)!: introduce lanelet2_utils by renaming from lane…
Browse files Browse the repository at this point in the history
…et2_utility (#248)
  • Loading branch information
soblin authored Mar 7, 2025
1 parent 08d72a8 commit 46f144b
Show file tree
Hide file tree
Showing 39 changed files with 69 additions and 69 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.8)
project(autoware_lanelet2_utility)
project(autoware_lanelet2_utils)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# autoware_lanelet2_utility
# autoware_lanelet2_utils

## Nomenclature

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef AUTOWARE_LANELET2_UTILITY__KIND_HPP_
#define AUTOWARE_LANELET2_UTILITY__KIND_HPP_
#ifndef AUTOWARE_LANELET2_UTILS__KIND_HPP_
#define AUTOWARE_LANELET2_UTILS__KIND_HPP_

#include <lanelet2_core/Forward.h>

namespace autoware::lanelet2_utility
namespace autoware::lanelet2_utils
{
static constexpr const char * k_road_lane_type = "road";
static constexpr const char * k_shoulder_lane_type = "road_shoulder";
Expand Down Expand Up @@ -58,5 +58,5 @@ bool is_shoulder_lane(const lanelet::ConstLanelet & lanelet);
* @return if the lanelet is bicycle_lane or not
*/
bool is_bicycle_lane(const lanelet::ConstLanelet & lanelet);
} // namespace autoware::lanelet2_utility
#endif // AUTOWARE_LANELET2_UTILITY__KIND_HPP_
} // namespace autoware::lanelet2_utils
#endif // AUTOWARE_LANELET2_UTILS__KIND_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef AUTOWARE_LANELET2_UTILITY__TOPOLOGY_HPP_
#define AUTOWARE_LANELET2_UTILITY__TOPOLOGY_HPP_
#ifndef AUTOWARE_LANELET2_UTILS__TOPOLOGY_HPP_
#define AUTOWARE_LANELET2_UTILS__TOPOLOGY_HPP_

#include <lanelet2_core/primitives/Lanelet.h>
#include <lanelet2_routing/Forward.h>
Expand All @@ -22,7 +22,7 @@
#include <optional>
#include <vector>

namespace autoware::lanelet2_utility
namespace autoware::lanelet2_utils
{
/**
* @brief instantiate RoutingGraph from given LaneletMap only from "road" lanes
Expand Down Expand Up @@ -181,6 +181,6 @@ lanelet::ConstLanelets sibling_lanelets(
*/
lanelet::ConstLanelets from_ids(
const lanelet::LaneletMapConstPtr lanelet_map, const std::vector<lanelet::Id> & ids);
} // namespace autoware::lanelet2_utility
} // namespace autoware::lanelet2_utils

#endif // AUTOWARE_LANELET2_UTILITY__TOPOLOGY_HPP_
#endif // AUTOWARE_LANELET2_UTILS__TOPOLOGY_HPP_
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>autoware_lanelet2_utility</name>
<name>autoware_lanelet2_utils</name>
<version>0.0.0</version>
<description>The autoware_lanelet2_utility package</description>
<description>The autoware_lanelet2_utils package</description>
<maintainer email="mamoru.sobue@tier4.jp">Mamoru Sobue</maintainer>
<maintainer email="kosuke.takeuchi@tier4.jp">Kosuke Takeuchi</maintainer>
<license>Apache License 2.0</license>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <autoware_lanelet2_utility/kind.hpp>
#include <autoware_lanelet2_utils/kind.hpp>

#include <lanelet2_core/primitives/Lanelet.h>

namespace autoware::lanelet2_utility
namespace autoware::lanelet2_utils
{
bool is_road_lane(const lanelet::ConstLanelet & lanelet)
{
Expand All @@ -35,4 +35,4 @@ bool is_bicycle_lane(const lanelet::ConstLanelet & lanelet)
return strcmp(
lanelet.attributeOr(lanelet::AttributeName::Subtype, "none"), k_bicycle_lane_type) == 0;
}
} // namespace autoware::lanelet2_utility
} // namespace autoware::lanelet2_utils
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <autoware_lanelet2_utility/topology.hpp>
#include <autoware_lanelet2_utils/topology.hpp>
#include <range/v3/all.hpp>
#include <rclcpp/logging.hpp>

Expand All @@ -21,7 +21,7 @@

#include <vector>

namespace autoware::lanelet2_utility
namespace autoware::lanelet2_utils
{

static constexpr size_t k_normal_bundle_max_size = 10;
Expand Down Expand Up @@ -262,4 +262,4 @@ lanelet::ConstLanelets from_ids(
}) |
ranges::to<std::vector>();
}
} // namespace autoware::lanelet2_utility
} // namespace autoware::lanelet2_utils
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "map_loader.hpp"

#include <ament_index_cpp/get_package_share_directory.hpp>
#include <autoware_lanelet2_utility/kind.hpp>
#include <autoware_lanelet2_utils/kind.hpp>

#include <gtest/gtest.h>

Expand All @@ -34,7 +34,7 @@ class TestWithRoadShoulderHighwayMap : public ::testing::Test
void SetUp() override
{
const auto sample_map_dir =
fs::path(ament_index_cpp::get_package_share_directory("autoware_lanelet2_utility")) /
fs::path(ament_index_cpp::get_package_share_directory("autoware_lanelet2_utils")) /
"sample_map";
const auto road_shoulder_highway_map_path = sample_map_dir / "road_shoulder" / "highway.osm";

Expand All @@ -50,7 +50,7 @@ class TestWithIntersectionCrossingMap : public ::testing::Test
void SetUp() override
{
const auto sample_map_dir =
fs::path(ament_index_cpp::get_package_share_directory("autoware_lanelet2_utility")) /
fs::path(ament_index_cpp::get_package_share_directory("autoware_lanelet2_utils")) /
"sample_map";
const auto road_shoulder_highway_map_path = sample_map_dir / "intersection" / "crossing.osm";

Expand All @@ -68,25 +68,25 @@ TEST_F(TestWithRoadShoulderHighwayMap, LoadCheck)
TEST_F(TestWithRoadShoulderHighwayMap, is_road_lane)
{
const auto ll = lanelet_map_ptr_->laneletLayer.get(46);
EXPECT_EQ(lanelet2_utility::is_road_lane(ll), true);
EXPECT_EQ(lanelet2_utility::is_shoulder_lane(ll), false);
EXPECT_EQ(lanelet2_utility::is_bicycle_lane(ll), false);
EXPECT_EQ(lanelet2_utils::is_road_lane(ll), true);
EXPECT_EQ(lanelet2_utils::is_shoulder_lane(ll), false);
EXPECT_EQ(lanelet2_utils::is_bicycle_lane(ll), false);
}

TEST_F(TestWithRoadShoulderHighwayMap, is_shoulder_lane)
{
const auto ll = lanelet_map_ptr_->laneletLayer.get(47);
EXPECT_EQ(lanelet2_utility::is_road_lane(ll), false);
EXPECT_EQ(lanelet2_utility::is_shoulder_lane(ll), true);
EXPECT_EQ(lanelet2_utility::is_bicycle_lane(ll), false);
EXPECT_EQ(lanelet2_utils::is_road_lane(ll), false);
EXPECT_EQ(lanelet2_utils::is_shoulder_lane(ll), true);
EXPECT_EQ(lanelet2_utils::is_bicycle_lane(ll), false);
}

TEST_F(TestWithIntersectionCrossingMap, is_shoulder_lane)
{
const auto ll = lanelet_map_ptr_->laneletLayer.get(2303);
EXPECT_EQ(lanelet2_utility::is_road_lane(ll), false);
EXPECT_EQ(lanelet2_utility::is_shoulder_lane(ll), false);
EXPECT_EQ(lanelet2_utility::is_bicycle_lane(ll), true);
EXPECT_EQ(lanelet2_utils::is_road_lane(ll), false);
EXPECT_EQ(lanelet2_utils::is_shoulder_lane(ll), false);
EXPECT_EQ(lanelet2_utils::is_bicycle_lane(ll), true);
}
} // namespace autoware

Expand Down
Loading

0 comments on commit 46f144b

Please sign in to comment.