Skip to content

Commit

Permalink
refactor(radar_threshold_filter): fix namespace and directory structu…
Browse files Browse the repository at this point in the history
…re (#7913)

Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
  • Loading branch information
technolojin authored Jul 10, 2024
1 parent ea0276a commit cfbf040
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
14 changes: 7 additions & 7 deletions sensing/radar_threshold_filter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ find_package(autoware_cmake REQUIRED)
autoware_package()

## Targets
ament_auto_add_library(radar_threshold_filter_node_component SHARED
src/radar_threshold_filter_node/radar_threshold_filter_node.cpp
ament_auto_add_library(${PROJECT_NAME} SHARED
src/radar_threshold_filter_node.cpp
)

rclcpp_components_register_node(radar_threshold_filter_node_component
PLUGIN "radar_threshold_filter::RadarThresholdFilterNode"
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "autoware::radar_threshold_filter::RadarThresholdFilterNode"
EXECUTABLE radar_threshold_filter_node
)

Expand All @@ -24,10 +24,10 @@ if(BUILD_TESTING)
ament_lint_auto_find_test_dependencies()

file(GLOB_RECURSE test_files test/**/*.cpp)
ament_add_ros_isolated_gtest(radar_threshold_filter ${test_files})
ament_add_ros_isolated_gtest(${PROJECT_NAME}_test ${test_files})

target_link_libraries(radar_threshold_filter
radar_threshold_filter_node_component
target_link_libraries(${PROJECT_NAME}_test
${PROJECT_NAME}
)
endif()

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

#include "radar_threshold_filter/radar_threshold_filter_node.hpp"
#include "radar_threshold_filter_node.hpp"

#include <radar_msgs/msg/radar_scan.hpp>

#include <memory>
#include <string>
#include <vector>

using std::placeholders::_1;

namespace
{
template <class T>
Expand Down Expand Up @@ -51,10 +49,11 @@ bool isWithin(double value, double max, double min)
}
} // namespace

namespace radar_threshold_filter
namespace autoware::radar_threshold_filter
{
using radar_msgs::msg::RadarReturn;
using radar_msgs::msg::RadarScan;
using std::placeholders::_1;

RadarThresholdFilterNode::RadarThresholdFilterNode(const rclcpp::NodeOptions & node_options)
: Node("radar_threshold_filter", node_options)
Expand Down Expand Up @@ -156,7 +155,7 @@ bool RadarThresholdFilterNode::isWithinThreshold(const RadarReturn & radar_retur
return true;
}

} // namespace radar_threshold_filter
} // namespace autoware::radar_threshold_filter

#include "rclcpp_components/register_node_macro.hpp"
RCLCPP_COMPONENTS_REGISTER_NODE(radar_threshold_filter::RadarThresholdFilterNode)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::radar_threshold_filter::RadarThresholdFilterNode)
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 RADAR_THRESHOLD_FILTER__RADAR_THRESHOLD_FILTER_NODE_HPP_
#define RADAR_THRESHOLD_FILTER__RADAR_THRESHOLD_FILTER_NODE_HPP_
#ifndef RADAR_THRESHOLD_FILTER_NODE_HPP_
#define RADAR_THRESHOLD_FILTER_NODE_HPP_

#include <rclcpp/rclcpp.hpp>

Expand All @@ -24,7 +24,7 @@
#include <string>
#include <vector>

namespace radar_threshold_filter
namespace autoware::radar_threshold_filter
{
using radar_msgs::msg::RadarReturn;
using radar_msgs::msg::RadarScan;
Expand Down Expand Up @@ -73,6 +73,6 @@ class RadarThresholdFilterNode : public rclcpp::Node
bool isWithinThreshold(const RadarReturn & radar_return);
};

} // namespace radar_threshold_filter
} // namespace autoware::radar_threshold_filter

#endif // RADAR_THRESHOLD_FILTER__RADAR_THRESHOLD_FILTER_NODE_HPP_
#endif // RADAR_THRESHOLD_FILTER_NODE_HPP_
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 "radar_threshold_filter/radar_threshold_filter_node.hpp"
#include "../../src/radar_threshold_filter_node.hpp"

#include <radar_msgs/msg/radar_scan.hpp>

Expand All @@ -21,8 +21,8 @@
TEST(RadarThresholdFilter, isWithinThreshold)
{
rclcpp::init(0, nullptr);
using autoware::radar_threshold_filter::RadarThresholdFilterNode;
using radar_msgs::msg::RadarReturn;
using radar_threshold_filter::RadarThresholdFilterNode;

const double amplitude_min = -10.0;
const double amplitude_max = 100.0;
Expand Down

0 comments on commit cfbf040

Please sign in to comment.