Skip to content

Commit

Permalink
refactor(radar_crossing_objects_noise_filter)!: fix namespace and dir…
Browse files Browse the repository at this point in the history
…ectory structure (#7649)

* feat: Refactor radar_crossing_objects_noise_filter node

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: fix the node name

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: move header file to src

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: remove unused dependency

Signed-off-by: Taekjin LEE <[email protected]>

---------

Signed-off-by: Taekjin LEE <[email protected]>
  • Loading branch information
technolojin authored and KhalilSelyan committed Jul 22, 2024
1 parent 54494d6 commit 8c2f044
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 23 deletions.
14 changes: 7 additions & 7 deletions perception/radar_crossing_objects_noise_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_crossing_objects_noise_filter_node_component SHARED
src/radar_crossing_objects_noise_filter_node/radar_crossing_objects_noise_filter_node.cpp
ament_auto_add_library(${PROJECT_NAME}_node_component SHARED
src/radar_crossing_objects_noise_filter_node.cpp
)

rclcpp_components_register_node(radar_crossing_objects_noise_filter_node_component
PLUGIN "radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode"
rclcpp_components_register_node(${PROJECT_NAME}_node_component
PLUGIN "autoware::radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode"
EXECUTABLE radar_crossing_objects_noise_filter_node
)

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

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

target_link_libraries(radar_crossing_objects_noise_filter
radar_crossing_objects_noise_filter_node_component
target_link_libraries(${PROJECT_NAME}
${PROJECT_NAME}_node_component
)
endif()

Expand Down
1 change: 0 additions & 1 deletion perception/radar_crossing_objects_noise_filter/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

<depend>autoware_perception_msgs</depend>
<depend>autoware_universe_utils</depend>
<depend>geometry_msgs</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>tf2</depend>
Expand Down
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_crossing_objects_noise_filter/radar_crossing_objects_noise_filter_node.hpp"
#include "radar_crossing_objects_noise_filter_node.hpp"

#include "autoware/universe_utils/geometry/geometry.hpp"
#include "autoware/universe_utils/math/normalization.hpp"
Expand Down Expand Up @@ -50,7 +50,7 @@ bool update_param(
}
} // namespace

namespace radar_crossing_objects_noise_filter
namespace autoware::radar_crossing_objects_noise_filter
{
using autoware_perception_msgs::msg::DetectedObject;
using autoware_perception_msgs::msg::DetectedObjects;
Expand Down Expand Up @@ -142,8 +142,8 @@ bool RadarCrossingObjectsNoiseFilterNode::isNoise(const DetectedObject & object)
}
}

} // namespace radar_crossing_objects_noise_filter
} // namespace autoware::radar_crossing_objects_noise_filter

#include "rclcpp_components/register_node_macro.hpp"
RCLCPP_COMPONENTS_REGISTER_NODE(
radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode)
autoware::radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode)
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_CROSSING_OBJECTS_NOISE_FILTER__RADAR_CROSSING_OBJECTS_NOISE_FILTER_NODE_HPP_
#define RADAR_CROSSING_OBJECTS_NOISE_FILTER__RADAR_CROSSING_OBJECTS_NOISE_FILTER_NODE_HPP_
#ifndef RADAR_CROSSING_OBJECTS_NOISE_FILTER_NODE_HPP_
#define RADAR_CROSSING_OBJECTS_NOISE_FILTER_NODE_HPP_

#include "rclcpp/rclcpp.hpp"

Expand All @@ -23,7 +23,7 @@
#include <memory>
#include <vector>

namespace radar_crossing_objects_noise_filter
namespace autoware::radar_crossing_objects_noise_filter
{
using autoware_perception_msgs::msg::DetectedObject;
using autoware_perception_msgs::msg::DetectedObjects;
Expand Down Expand Up @@ -63,6 +63,6 @@ class RadarCrossingObjectsNoiseFilterNode : public rclcpp::Node
bool isNoise(const DetectedObject & object);
};

} // namespace radar_crossing_objects_noise_filter
} // namespace autoware::radar_crossing_objects_noise_filter

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

#include "../../src/radar_crossing_objects_noise_filter_node.hpp"
#include "autoware/universe_utils/geometry/geometry.hpp"
#include "autoware/universe_utils/math/unit_conversion.hpp"
#include "radar_crossing_objects_noise_filter/radar_crossing_objects_noise_filter_node.hpp"

#include <geometry_msgs/msg/point32.hpp>

#include <gtest/gtest.h>

std::shared_ptr<radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode> get_node(
double angle_threshold, double velocity_threshold)
std::shared_ptr<autoware::radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode>
get_node(double angle_threshold, double velocity_threshold)
{
rclcpp::NodeOptions node_options;

node_options.parameter_overrides(
{{"angle_threshold", angle_threshold}, {"velocity_threshold", velocity_threshold}});
auto node =
std::make_shared<radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode>(
node_options);
auto node = std::make_shared<
autoware::radar_crossing_objects_noise_filter::RadarCrossingObjectsNoiseFilterNode>(
node_options);
return node;
}

Expand Down

0 comments on commit 8c2f044

Please sign in to comment.