Skip to content

Commit

Permalink
Added namespace
Browse files Browse the repository at this point in the history
Signed-off-by: Shintaro Sakoda <[email protected]>
  • Loading branch information
SakodaShintaro committed Nov 13, 2023
1 parent 32b3179 commit 9110793
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,13 @@ bool ArTagBasedLocalizer::setup()

void ArTagBasedLocalizer::map_bin_callback(const HADMapBin::ConstSharedPtr & msg)
{
const std::vector<Landmark> landmarks = parse_landmarks(msg, "apriltag_16h5", this->get_logger());
for (const Landmark & landmark : landmarks) {
const std::vector<landmark_manager::Landmark> landmarks =
landmark_manager::parse_landmarks(msg, "apriltag_16h5", this->get_logger());
for (const landmark_manager::Landmark & landmark : landmarks) {
landmark_map_[landmark.id] = landmark.pose;
}

const MarkerArray marker_msg = convert_landmarks_to_marker_array_msg(landmarks);
const MarkerArray marker_msg = landmark_manager::convert_landmarks_to_marker_array_msg(landmarks);
marker_pub_->publish(marker_msg);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include <map>
#include <string>

namespace landmark_manager
{

struct Landmark
{
std::string id;
Expand All @@ -38,4 +41,6 @@ std::vector<Landmark> parse_landmarks(
visualization_msgs::msg::MarkerArray convert_landmarks_to_marker_array_msg(
const std::vector<Landmark> & landmarks);

} // namespace landmark_manager

#endif // LANDMARK_MANAGER__LANDMARK_MANAGER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include <lanelet2_core/LaneletMap.h>
#include <lanelet2_core/primitives/Polygon.h>

namespace landmark_manager
{

std::vector<Landmark> parse_landmarks(

Check warning on line 28 in localization/landmark_based_localizer/landmark_manager/src/landmark_manager.cpp

View check run for this annotation

Codecov / codecov/patch

localization/landmark_based_localizer/landmark_manager/src/landmark_manager.cpp#L28

Added line #L28 was not covered by tests
const autoware_auto_mapping_msgs::msg::HADMapBin::ConstSharedPtr & msg,
const std::string & target_subtype, const rclcpp::Logger & logger)
Expand Down Expand Up @@ -153,3 +156,5 @@ visualization_msgs::msg::MarkerArray convert_landmarks_to_marker_array_msg(
}
return marker_array;
}

} // namespace landmark_manager

0 comments on commit 9110793

Please sign in to comment.