Skip to content

Commit

Permalink
refactor(signal_processing): prefix package and namespace with autoware
Browse files Browse the repository at this point in the history
Signed-off-by: Esteve Fernandez <[email protected]>
  • Loading branch information
esteve authored and xmfcx committed Sep 19, 2024
1 parent 2a2d037 commit 9f4964f
Show file tree
Hide file tree
Showing 35 changed files with 72 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin/** khalil@leodr
common/autoware_path_distance_calculator/** [email protected]
common/autoware_perception_rviz_plugin/** [email protected] [email protected] [email protected] [email protected] [email protected]
common/autoware_point_types/** [email protected] [email protected]
common/autoware_signal_processing/** [email protected] [email protected] [email protected] [email protected] [email protected]
common/autoware_test_utils/** [email protected] [email protected] [email protected] [email protected]
common/autoware_testing/** [email protected] [email protected] [email protected] [email protected]
common/autoware_universe_utils/** [email protected] [email protected] [email protected]
Expand All @@ -27,7 +28,6 @@ common/object_recognition_utils/** [email protected] takayuki.murooka@tier
common/osqp_interface/** [email protected] [email protected] [email protected] [email protected]
common/polar_grid/** [email protected]
common/qp_interface/** [email protected] [email protected] [email protected] [email protected]
common/signal_processing/** [email protected] [email protected] [email protected] [email protected] [email protected]
common/tensorrt_common/** [email protected] [email protected]
common/tier4_adapi_rviz_plugin/** [email protected] [email protected] [email protected]
common/tier4_api_utils/** [email protected]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(signal_processing)
project(autoware_signal_processing)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SIGNAL_PROCESSING__BUTTERWORTH_HPP_
#define SIGNAL_PROCESSING__BUTTERWORTH_HPP_
#ifndef AUTOWARE__SIGNAL_PROCESSING__BUTTERWORTH_HPP_
#define AUTOWARE__SIGNAL_PROCESSING__BUTTERWORTH_HPP_

#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <vector>

namespace autoware::signal_processing
{

template <typename T>
const T & append_separator(const T & arg)
{
Expand Down Expand Up @@ -133,5 +136,6 @@ class ButterworthFilter
// Computes continuous time roots from the phase angles
void computeContinuousTimeRoots(bool const & use_sampling_frequency = false);
};
} // namespace autoware::signal_processing

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

#ifndef SIGNAL_PROCESSING__LOWPASS_FILTER_HPP_
#define SIGNAL_PROCESSING__LOWPASS_FILTER_HPP_
#ifndef AUTOWARE__SIGNAL_PROCESSING__LOWPASS_FILTER_HPP_
#define AUTOWARE__SIGNAL_PROCESSING__LOWPASS_FILTER_HPP_

#include "signal_processing/lowpass_filter_1d.hpp"
#include "autoware/signal_processing/lowpass_filter_1d.hpp"

#include "geometry_msgs/msg/twist.hpp"

namespace autoware::signal_processing
{
/**
* @class First-order low-pass filter
* @brief filtering values
Expand Down Expand Up @@ -51,5 +53,6 @@ class LowpassFilterTwist : public LowpassFilterInterface<geometry_msgs::msg::Twi

geometry_msgs::msg::Twist filter(const geometry_msgs::msg::Twist & u) override;
};
} // namespace autoware::signal_processing

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

#ifndef SIGNAL_PROCESSING__LOWPASS_FILTER_1D_HPP_
#define SIGNAL_PROCESSING__LOWPASS_FILTER_1D_HPP_
#ifndef AUTOWARE__SIGNAL_PROCESSING__LOWPASS_FILTER_1D_HPP_
#define AUTOWARE__SIGNAL_PROCESSING__LOWPASS_FILTER_1D_HPP_

#include <boost/optional.hpp>

namespace signal_processing
namespace autoware::signal_processing
{
double lowpassFilter(const double current_val, const double prev_val, const double gain);
}

/**
* @class First-order low-pass filter
Expand All @@ -43,5 +42,6 @@ class LowpassFilter1d
boost::optional<double> getValue() const;
double filter(const double u);
};
} // namespace autoware::signal_processing

#endif // SIGNAL_PROCESSING__LOWPASS_FILTER_1D_HPP_
#endif // AUTOWARE__SIGNAL_PROCESSING__LOWPASS_FILTER_1D_HPP_
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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>signal_processing</name>
<name>autoware_signal_processing</name>
<version>0.1.0</version>
<description>The signal processing package</description>
<maintainer email="[email protected]">Takayuki Murooka</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "signal_processing/butterworth.hpp"
#include "autoware/signal_processing/butterworth.hpp"

#include <rclcpp/logging.hpp>

#include <iomanip>
#include <numeric>
#include <sstream>

namespace autoware::signal_processing
{
/**
* @brief Computes the minimum of an analog Butterworth filter order and cut-off frequency give
* the pass and stop-band frequencies and ripple magnitude (tolerances).
Expand Down Expand Up @@ -341,3 +343,4 @@ void ButterworthFilter::printFilterSpecs() const
rclcpp::get_logger("rclcpp"), "Cut-off Frequency : %2.2f rad/sec",
this->filter_specs_.Wc_rad_sec);
}
} // namespace autoware::signal_processing
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "signal_processing/lowpass_filter.hpp"
#include "autoware/signal_processing/lowpass_filter.hpp"

namespace autoware::signal_processing
{
geometry_msgs::msg::Twist LowpassFilterTwist::filter(const geometry_msgs::msg::Twist & u)
{
if (x_) {
Expand All @@ -31,3 +33,4 @@ geometry_msgs::msg::Twist LowpassFilterTwist::filter(const geometry_msgs::msg::T
x_ = u;
return x_.get();
}
} // namespace autoware::signal_processing
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "signal_processing/lowpass_filter_1d.hpp"
#include "autoware/signal_processing/lowpass_filter_1d.hpp"

namespace signal_processing
namespace autoware::signal_processing
{
double lowpassFilter(const double current_val, const double prev_val, const double gain)
{
return gain * prev_val + (1.0 - gain) * current_val;
}
} // namespace signal_processing

LowpassFilter1d::LowpassFilter1d(const double gain) : gain_(gain)
{
Expand Down Expand Up @@ -57,3 +56,4 @@ double LowpassFilter1d::filter(const double u)
x_ = u;
return x_.get();
}
} // namespace autoware::signal_processing
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#ifndef BUTTERWORTH_FILTER_TEST_HPP_
#define BUTTERWORTH_FILTER_TEST_HPP_

#include "autoware/signal_processing/butterworth.hpp"
#include "gtest/gtest.h"
#include "rclcpp/rclcpp.hpp"
#include "signal_processing/butterworth.hpp"

class ButterWorthTestFixture : public ::testing::Test
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "butterworth_filter_test.hpp"

using autoware::signal_processing::ButterworthFilter;

TEST_F(ButterWorthTestFixture, butterworthOrderTest)
{
double tol = 1e-4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "signal_processing/lowpass_filter_1d.hpp"
#include "autoware/signal_processing/lowpass_filter_1d.hpp"

#include <gtest/gtest.h>

constexpr double epsilon = 1e-6;

using autoware::signal_processing::LowpassFilter1d;

TEST(lowpass_filter_1d, filter)
{
LowpassFilter1d lowpass_filter_1d(0.1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "signal_processing/lowpass_filter.hpp"
#include "autoware/signal_processing/lowpass_filter.hpp"

#include <gtest/gtest.h>

constexpr double epsilon = 1e-6;

using autoware::signal_processing::LowpassFilterTwist;

geometry_msgs::msg::Twist createTwist(
const double lx, const double ly, const double lz, const double ax, const double ay,
const double az)
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 "signal_processing/butterworth.hpp"
#include "autoware/signal_processing/butterworth.hpp"

#include <iostream>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include "control_performance_analysis/msg/driving_monitor_stamped.hpp"
#include "control_performance_analysis/msg/error_stamped.hpp"

#include <autoware/signal_processing/lowpass_filter_1d.hpp>
#include <autoware/universe_utils/ros/self_pose_listener.hpp>
#include <rclcpp/rclcpp.hpp>
#include <signal_processing/lowpass_filter_1d.hpp>

#include <autoware_control_msgs/msg/control.hpp>
#include <autoware_planning_msgs/msg/trajectory.hpp>
Expand Down
2 changes: 1 addition & 1 deletion control/control_performance_analysis/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<depend>autoware_control_msgs</depend>
<depend>autoware_motion_utils</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_signal_processing</depend>
<depend>autoware_universe_utils</depend>
<depend>autoware_vehicle_info_utils</depend>
<depend>autoware_vehicle_msgs</depend>
Expand All @@ -36,7 +37,6 @@
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>sensor_msgs</depend>
<depend>signal_processing</depend>
<depend>std_msgs</depend>
<depend>tf2</depend>
<depend>tf2_eigen</depend>
Expand Down
2 changes: 1 addition & 1 deletion localization/autoware_twist2accel/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>autoware_signal_processing</depend>
<depend>geometry_msgs</depend>
<depend>nav_msgs</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>signal_processing</depend>
<depend>tf2</depend>
<depend>tier4_debug_msgs</depend>

Expand Down
2 changes: 2 additions & 0 deletions localization/autoware_twist2accel/src/twist2accel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <string>
#include <utility>

using autoware::signal_processing::LowpassFilter1d;

namespace autoware::twist2accel
{
using std::placeholders::_1;
Expand Down
4 changes: 3 additions & 1 deletion localization/autoware_twist2accel/src/twist2accel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef TWIST2ACCEL_HPP_
#define TWIST2ACCEL_HPP_

#include "signal_processing/lowpass_filter_1d.hpp"
#include "autoware/signal_processing/lowpass_filter_1d.hpp"

#include <rclcpp/rclcpp.hpp>

Expand All @@ -37,6 +37,8 @@
#include <string>
#include <vector>

using autoware::signal_processing::LowpassFilter1d;

namespace autoware::twist2accel
{
class Twist2Accel : public rclcpp::Node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

#include "yabloc_common/ground_server/filter/moving_averaging.hpp"

#include <autoware/signal_processing/lowpass_filter_1d.hpp>
#include <rclcpp/rclcpp.hpp>
#include <signal_processing/lowpass_filter_1d.hpp>
#include <yabloc_common/ground_plane.hpp>

#include <autoware_map_msgs/msg/lanelet_map_bin.hpp>
Expand All @@ -38,6 +38,8 @@

#include <vector>

using autoware::signal_processing::LowpassFilter1d;

namespace yabloc::ground_server
{
class GroundServer : public rclcpp::Node
Expand Down
2 changes: 1 addition & 1 deletion localization/yabloc/yabloc_common/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

<depend>autoware_lanelet2_extension</depend>
<depend>autoware_map_msgs</depend>
<depend>autoware_signal_processing</depend>
<depend>autoware_universe_utils</depend>
<depend>cv_bridge</depend>
<depend>geometry_msgs</depend>
Expand All @@ -26,7 +27,6 @@
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>sensor_msgs</depend>
<depend>signal_processing</depend>
<depend>sophus</depend>
<depend>std_msgs</depend>
<depend>tf2_ros</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#include "autoware/obstacle_cruise_planner/optimization_based_planner/optimization_based_planner.hpp"
#include "autoware/obstacle_cruise_planner/pid_based_planner/pid_based_planner.hpp"
#include "autoware/obstacle_cruise_planner/type_alias.hpp"
#include "autoware/signal_processing/lowpass_filter_1d.hpp"
#include "autoware/universe_utils/ros/logger_level_configure.hpp"
#include "autoware/universe_utils/ros/polling_subscriber.hpp"
#include "autoware/universe_utils/system/stop_watch.hpp"
#include "signal_processing/lowpass_filter_1d.hpp"

#include <autoware/universe_utils/ros/published_time_publisher.hpp>
#include <rclcpp/rclcpp.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
#include "autoware/obstacle_cruise_planner/pid_based_planner/cruise_planning_debug_info.hpp"
#include "autoware/obstacle_cruise_planner/pid_based_planner/pid_controller.hpp"
#include "autoware/obstacle_cruise_planner/planner_interface.hpp"
#include "signal_processing/lowpass_filter_1d.hpp"
#include "autoware/signal_processing/lowpass_filter_1d.hpp"

#include "visualization_msgs/msg/marker_array.hpp"

#include <memory>
#include <optional>
#include <vector>

using autoware::signal_processing::LowpassFilter1d;

class PIDBasedPlanner : public PlannerInterface
{
public:
Expand Down
2 changes: 1 addition & 1 deletion planning/autoware_obstacle_cruise_planner/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<depend>autoware_perception_msgs</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_planning_test_manager</depend>
<depend>autoware_signal_processing</depend>
<depend>autoware_universe_utils</depend>
<depend>autoware_vehicle_info_utils</depend>
<depend>geometry_msgs</depend>
Expand All @@ -32,7 +33,6 @@
<depend>osqp_interface</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>signal_processing</depend>
<depend>std_msgs</depend>
<depend>tf2</depend>
<depend>tf2_ros</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

#include "tier4_planning_msgs/msg/velocity_limit.hpp"

using autoware::signal_processing::LowpassFilter1d;

namespace
{
VelocityLimit createVelocityLimitMsg(
Expand Down
Loading

0 comments on commit 9f4964f

Please sign in to comment.