Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(pid_longitudinal_controller)!: prefix package and namespace with autoware #7383

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ control/autoware_lane_departure_checker/** [email protected] makoto.kuri
control/mpc_lateral_controller/** [email protected] [email protected]
control/obstacle_collision_checker/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
control/operation_mode_transition_manager/** [email protected] [email protected]
control/pid_longitudinal_controller/** [email protected] [email protected] [email protected]
control/autoware_pid_longitudinal_controller/** [email protected] [email protected] [email protected]
control/predicted_path_checker/** [email protected]
control/pure_pursuit/** [email protected]
control/shift_decider/** [email protected]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
cmake_minimum_required(VERSION 3.14)
project(pid_longitudinal_controller)
project(autoware_pid_longitudinal_controller)

find_package(autoware_cmake REQUIRED)
autoware_package()

set(PID_LON_CON_LIB ${PROJECT_NAME}_lib)
ament_auto_add_library(${PID_LON_CON_LIB} SHARED
src/pid_longitudinal_controller.cpp
src/pid.cpp
src/smooth_stop.cpp
src/longitudinal_controller_utils.cpp
DIRECTORY src
)

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

#ifndef PID_LONGITUDINAL_CONTROLLER__DEBUG_VALUES_HPP_
#define PID_LONGITUDINAL_CONTROLLER__DEBUG_VALUES_HPP_
#ifndef AUTOWARE_PID_LONGITUDINAL_CONTROLLER__DEBUG_VALUES_HPP_
#define AUTOWARE_PID_LONGITUDINAL_CONTROLLER__DEBUG_VALUES_HPP_

#include <array>
#include <cstddef>

namespace autoware::motion::control::pid_longitudinal_controller
{
Expand Down Expand Up @@ -92,4 +93,4 @@ class DebugValues
};
} // namespace autoware::motion::control::pid_longitudinal_controller

#endif // PID_LONGITUDINAL_CONTROLLER__DEBUG_VALUES_HPP_
#endif // AUTOWARE_PID_LONGITUDINAL_CONTROLLER__DEBUG_VALUES_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 PID_LONGITUDINAL_CONTROLLER__LONGITUDINAL_CONTROLLER_UTILS_HPP_
#define PID_LONGITUDINAL_CONTROLLER__LONGITUDINAL_CONTROLLER_UTILS_HPP_
#ifndef AUTOWARE_PID_LONGITUDINAL_CONTROLLER__LONGITUDINAL_CONTROLLER_UTILS_HPP_
#define AUTOWARE_PID_LONGITUDINAL_CONTROLLER__LONGITUDINAL_CONTROLLER_UTILS_HPP_

#include "interpolation/linear_interpolation.hpp"
#include "interpolation/spherical_linear_interpolation.hpp"
Expand Down Expand Up @@ -155,4 +155,4 @@ geometry_msgs::msg::Pose findTrajectoryPoseAfterDistance(
} // namespace longitudinal_utils
} // namespace autoware::motion::control::pid_longitudinal_controller

#endif // PID_LONGITUDINAL_CONTROLLER__LONGITUDINAL_CONTROLLER_UTILS_HPP_
#endif // AUTOWARE_PID_LONGITUDINAL_CONTROLLER__LONGITUDINAL_CONTROLLER_UTILS_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 PID_LONGITUDINAL_CONTROLLER__LOWPASS_FILTER_HPP_
#define PID_LONGITUDINAL_CONTROLLER__LOWPASS_FILTER_HPP_
#ifndef AUTOWARE_PID_LONGITUDINAL_CONTROLLER__LOWPASS_FILTER_HPP_
#define AUTOWARE_PID_LONGITUDINAL_CONTROLLER__LOWPASS_FILTER_HPP_

#include <algorithm>
#include <cmath>
Expand Down Expand Up @@ -63,4 +63,4 @@ class LowpassFilter1d
}
};
} // namespace autoware::motion::control::pid_longitudinal_controller
#endif // PID_LONGITUDINAL_CONTROLLER__LOWPASS_FILTER_HPP_
#endif // AUTOWARE_PID_LONGITUDINAL_CONTROLLER__LOWPASS_FILTER_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 PID_LONGITUDINAL_CONTROLLER__PID_HPP_
#define PID_LONGITUDINAL_CONTROLLER__PID_HPP_
#ifndef AUTOWARE_PID_LONGITUDINAL_CONTROLLER__PID_HPP_
#define AUTOWARE_PID_LONGITUDINAL_CONTROLLER__PID_HPP_

#include <vector>

Expand Down Expand Up @@ -91,4 +91,4 @@ class PIDController
};
} // namespace autoware::motion::control::pid_longitudinal_controller

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

#ifndef PID_LONGITUDINAL_CONTROLLER__PID_LONGITUDINAL_CONTROLLER_HPP_
#define PID_LONGITUDINAL_CONTROLLER__PID_LONGITUDINAL_CONTROLLER_HPP_

#ifndef AUTOWARE_PID_LONGITUDINAL_CONTROLLER__PID_LONGITUDINAL_CONTROLLER_HPP_
#define AUTOWARE_PID_LONGITUDINAL_CONTROLLER__PID_LONGITUDINAL_CONTROLLER_HPP_

#include "autoware_pid_longitudinal_controller/debug_values.hpp"
#include "autoware_pid_longitudinal_controller/longitudinal_controller_utils.hpp"
#include "autoware_pid_longitudinal_controller/lowpass_filter.hpp"
#include "autoware_pid_longitudinal_controller/pid.hpp"
#include "autoware_pid_longitudinal_controller/smooth_stop.hpp"
#include "diagnostic_updater/diagnostic_updater.hpp"
#include "pid_longitudinal_controller/debug_values.hpp"
#include "pid_longitudinal_controller/longitudinal_controller_utils.hpp"
#include "pid_longitudinal_controller/lowpass_filter.hpp"
#include "pid_longitudinal_controller/pid.hpp"
#include "pid_longitudinal_controller/smooth_stop.hpp"
#include "rclcpp/rclcpp.hpp"
#include "tf2/utils.h"
#include "tf2_ros/buffer.h"
Expand Down Expand Up @@ -408,4 +408,4 @@ class PidLongitudinalController : public trajectory_follower::LongitudinalContro
};
} // namespace autoware::motion::control::pid_longitudinal_controller

#endif // PID_LONGITUDINAL_CONTROLLER__PID_LONGITUDINAL_CONTROLLER_HPP_
#endif // AUTOWARE_PID_LONGITUDINAL_CONTROLLER__PID_LONGITUDINAL_CONTROLLER_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 PID_LONGITUDINAL_CONTROLLER__SMOOTH_STOP_HPP_
#define PID_LONGITUDINAL_CONTROLLER__SMOOTH_STOP_HPP_
#ifndef AUTOWARE_PID_LONGITUDINAL_CONTROLLER__SMOOTH_STOP_HPP_
#define AUTOWARE_PID_LONGITUDINAL_CONTROLLER__SMOOTH_STOP_HPP_

#include "rclcpp/rclcpp.hpp"

Expand Down Expand Up @@ -112,4 +112,4 @@ class SmoothStop
};
} // namespace autoware::motion::control::pid_longitudinal_controller

#endif // PID_LONGITUDINAL_CONTROLLER__SMOOTH_STOP_HPP_
#endif // AUTOWARE_PID_LONGITUDINAL_CONTROLLER__SMOOTH_STOP_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>pid_longitudinal_controller</name>
<name>autoware_pid_longitudinal_controller</name>
<version>1.0.0</version>
<description>PID-based longitudinal controller</description>

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 "pid_longitudinal_controller/longitudinal_controller_utils.hpp"
#include "autoware_pid_longitudinal_controller/longitudinal_controller_utils.hpp"

#include "tf2/LinearMath/Matrix3x3.h"
#include "tf2/LinearMath/Quaternion.h"
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 "pid_longitudinal_controller/pid.hpp"
#include "autoware_pid_longitudinal_controller/pid.hpp"

#include <algorithm>
#include <memory>
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 "pid_longitudinal_controller/pid_longitudinal_controller.hpp"
#include "autoware_pid_longitudinal_controller/pid_longitudinal_controller.hpp"

#include "motion_utils/trajectory/trajectory.hpp"
#include "tier4_autoware_utils/geometry/geometry.hpp"
Expand Down Expand Up @@ -1148,7 +1148,7 @@ void PidLongitudinalController::updateDebugVelAcc(const ControlData & control_da

void PidLongitudinalController::setupDiagnosticUpdater()
{
diagnostic_updater_.setHardwareID("pid_longitudinal_controller");
diagnostic_updater_.setHardwareID("autoware_pid_longitudinal_controller");
diagnostic_updater_.add("control_state", this, &PidLongitudinalController::checkControlState);
}

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 "pid_longitudinal_controller/smooth_stop.hpp"
#include "autoware_pid_longitudinal_controller/smooth_stop.hpp"

#include <experimental/optional> // NOLINT

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

#include "autoware_pid_longitudinal_controller/longitudinal_controller_utils.hpp"
#include "gtest/gtest.h"
#include "interpolation/spherical_linear_interpolation.hpp"
#include "motion_utils/trajectory/conversion.hpp"
#include "pid_longitudinal_controller/longitudinal_controller_utils.hpp"
#include "tf2/LinearMath/Quaternion.h"

#include "autoware_planning_msgs/msg/trajectory.hpp"
Expand Down
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.

#include "autoware_pid_longitudinal_controller/pid.hpp"
#include "gtest/gtest.h"
#include "pid_longitudinal_controller/pid.hpp"

#include <vector>

Expand Down
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.

#include "autoware_pid_longitudinal_controller/smooth_stop.hpp"
#include "gtest/gtest.h"
#include "pid_longitudinal_controller/smooth_stop.hpp"
#include "rclcpp/rclcpp.hpp"

#include <utility>
Expand Down
2 changes: 1 addition & 1 deletion control/trajectory_follower_node/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
<depend>autoware_adapi_v1_msgs</depend>
<depend>autoware_control_msgs</depend>
<depend>autoware_mpc_lateral_controller</depend>
<depend>autoware_pid_longitudinal_controller</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_vehicle_msgs</depend>
<depend>motion_utils</depend>
<depend>pid_longitudinal_controller</depend>
<depend>pure_pursuit</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@
max_jerk: 2.0
min_jerk: -5.0

# pitch
use_trajectory_for_pitch_calculation: false
# slope compensation
lpf_pitch_gain: 0.95
slope_source: "raw_pitch" # raw_pitch, trajectory_pitch or trajectory_adaptive
adaptive_trajectory_velocity_th: 1.0
max_pitch_rad: 0.1
min_pitch_rad: -0.1
2 changes: 1 addition & 1 deletion control/trajectory_follower_node/src/controller_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "trajectory_follower_node/controller_node.hpp"

#include "autoware_mpc_lateral_controller/mpc_lateral_controller.hpp"
#include "pid_longitudinal_controller/pid_longitudinal_controller.hpp"
#include "autoware_pid_longitudinal_controller/pid_longitudinal_controller.hpp"
#include "pure_pursuit/pure_pursuit_lateral_controller.hpp"
#include "tier4_autoware_utils/ros/marker_helper.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ rclcpp::NodeOptions makeNodeOptions(const bool enable_keep_stopped_until_steer_c
// Pass default parameter file to the node
const auto share_dir = ament_index_cpp::get_package_share_directory("trajectory_follower_node");
const auto longitudinal_share_dir =
ament_index_cpp::get_package_share_directory("pid_longitudinal_controller");
ament_index_cpp::get_package_share_directory("autoware_pid_longitudinal_controller");
const auto lateral_share_dir =
ament_index_cpp::get_package_share_directory("autoware_mpc_lateral_controller");
rclcpp::NodeOptions node_options;
Expand Down
Loading