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(mpc_lateral_controller, trajectory_follower_node)!: prefix package and namespace with autoware #7306

Merged
merged 12 commits into from
Jun 7, 2024
Merged
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(mpc_lateral_controller)
project(autoware_mpc_lateral_controller)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand Down
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 MPC_LATERAL_CONTROLLER__LOWPASS_FILTER_HPP_
#define MPC_LATERAL_CONTROLLER__LOWPASS_FILTER_HPP_
#ifndef AUTOWARE_MPC_LATERAL_CONTROLLER__LOWPASS_FILTER_HPP_
#define AUTOWARE_MPC_LATERAL_CONTROLLER__LOWPASS_FILTER_HPP_

#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>

namespace autoware::motion::control::mpc_lateral_controller
namespace autoware::motion::control::autoware_mpc_lateral_controller
satoshi-ota marked this conversation as resolved.
Show resolved Hide resolved
{
/**
* @brief 2nd-order Butterworth Filter
Expand Down Expand Up @@ -101,5 +101,5 @@ namespace MoveAverageFilter
*/
bool filt_vector(const int num, std::vector<double> & u);
} // namespace MoveAverageFilter
} // namespace autoware::motion::control::mpc_lateral_controller
#endif // MPC_LATERAL_CONTROLLER__LOWPASS_FILTER_HPP_
} // namespace autoware::motion::control::autoware_mpc_lateral_controller
#endif // AUTOWARE_MPC_LATERAL_CONTROLLER__LOWPASS_FILTER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef MPC_LATERAL_CONTROLLER__MPC_HPP_
#define MPC_LATERAL_CONTROLLER__MPC_HPP_

#include "mpc_lateral_controller/lowpass_filter.hpp"
#include "mpc_lateral_controller/mpc_trajectory.hpp"
#include "mpc_lateral_controller/qp_solver/qp_solver_interface.hpp"
#include "mpc_lateral_controller/steering_predictor.hpp"
#include "mpc_lateral_controller/vehicle_model/vehicle_model_interface.hpp"
#ifndef AUTOWARE_MPC_LATERAL_CONTROLLER__MPC_HPP_
#define AUTOWARE_MPC_LATERAL_CONTROLLER__MPC_HPP_

#include "autoware_mpc_lateral_controller/lowpass_filter.hpp"
#include "autoware_mpc_lateral_controller/mpc_trajectory.hpp"
#include "autoware_mpc_lateral_controller/qp_solver/qp_solver_interface.hpp"
#include "autoware_mpc_lateral_controller/steering_predictor.hpp"
#include "autoware_mpc_lateral_controller/vehicle_model/vehicle_model_interface.hpp"
#include "rclcpp/rclcpp.hpp"

#include "autoware_control_msgs/msg/lateral.hpp"
Expand All @@ -35,7 +35,7 @@
#include <utility>
#include <vector>

namespace autoware::motion::control::mpc_lateral_controller
namespace autoware::motion::control::autoware_mpc_lateral_controller
{

using autoware_control_msgs::msg::Lateral;
Expand Down Expand Up @@ -523,6 +523,6 @@ class MPC
*/
inline void setClock(rclcpp::Clock::SharedPtr clock) { m_clock = clock; }
}; // class MPC
} // namespace autoware::motion::control::mpc_lateral_controller
} // namespace autoware::motion::control::autoware_mpc_lateral_controller

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

#ifndef MPC_LATERAL_CONTROLLER__MPC_LATERAL_CONTROLLER_HPP_
#define MPC_LATERAL_CONTROLLER__MPC_LATERAL_CONTROLLER_HPP_
#ifndef AUTOWARE_MPC_LATERAL_CONTROLLER__MPC_LATERAL_CONTROLLER_HPP_
#define AUTOWARE_MPC_LATERAL_CONTROLLER__MPC_LATERAL_CONTROLLER_HPP_

#include "mpc_lateral_controller/mpc.hpp"
#include "mpc_lateral_controller/mpc_trajectory.hpp"
#include "mpc_lateral_controller/mpc_utils.hpp"
#include "mpc_lateral_controller/steering_offset/steering_offset.hpp"
#include "autoware_mpc_lateral_controller/mpc.hpp"
#include "autoware_mpc_lateral_controller/mpc_trajectory.hpp"
#include "autoware_mpc_lateral_controller/mpc_utils.hpp"
#include "autoware_mpc_lateral_controller/steering_offset/steering_offset.hpp"
#include "rclcpp/rclcpp.hpp"
#include "trajectory_follower_base/lateral_controller_base.hpp"

Expand All @@ -37,7 +37,7 @@
#include <utility>
#include <vector>

namespace autoware::motion::control::mpc_lateral_controller
namespace autoware::motion::control::autoware_mpc_lateral_controller
{

namespace trajectory_follower = ::autoware::motion::control::trajectory_follower;
Expand Down Expand Up @@ -279,6 +279,6 @@ class MpcLateralController : public trajectory_follower::LateralControllerBase
RCLCPP_WARN_THROTTLE(logger_, *clock_, 5000, args...);
}
};
} // namespace autoware::motion::control::mpc_lateral_controller
} // namespace autoware::motion::control::autoware_mpc_lateral_controller

#endif // MPC_LATERAL_CONTROLLER__MPC_LATERAL_CONTROLLER_HPP_
#endif // AUTOWARE_MPC_LATERAL_CONTROLLER__MPC_LATERAL_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 MPC_LATERAL_CONTROLLER__MPC_TRAJECTORY_HPP_
#define MPC_LATERAL_CONTROLLER__MPC_TRAJECTORY_HPP_
#ifndef AUTOWARE_MPC_LATERAL_CONTROLLER__MPC_TRAJECTORY_HPP_
#define AUTOWARE_MPC_LATERAL_CONTROLLER__MPC_TRAJECTORY_HPP_

#include "tier4_autoware_utils/geometry/geometry.hpp"

Expand All @@ -22,7 +22,7 @@
#include <iostream>
#include <vector>

namespace autoware::motion::control::mpc_lateral_controller
namespace autoware::motion::control::autoware_mpc_lateral_controller
{

/**
Expand Down Expand Up @@ -124,5 +124,5 @@ class MPCTrajectory
return points;
}
};
} // namespace autoware::motion::control::mpc_lateral_controller
#endif // MPC_LATERAL_CONTROLLER__MPC_TRAJECTORY_HPP_
} // namespace autoware::motion::control::autoware_mpc_lateral_controller
#endif // AUTOWARE_MPC_LATERAL_CONTROLLER__MPC_TRAJECTORY_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 MPC_LATERAL_CONTROLLER__MPC_UTILS_HPP_
#define MPC_LATERAL_CONTROLLER__MPC_UTILS_HPP_
#ifndef AUTOWARE_MPC_LATERAL_CONTROLLER__MPC_UTILS_HPP_
#define AUTOWARE_MPC_LATERAL_CONTROLLER__MPC_UTILS_HPP_

#include "rclcpp/rclcpp.hpp"
#include "tf2/utils.h"
Expand All @@ -26,7 +26,7 @@
#include "tf2_geometry_msgs/tf2_geometry_msgs.hpp"
#endif

#include "mpc_lateral_controller/mpc_trajectory.hpp"
#include "autoware_mpc_lateral_controller/mpc_trajectory.hpp"

#include "autoware_planning_msgs/msg/trajectory.hpp"
#include "autoware_planning_msgs/msg/trajectory_point.hpp"
Expand All @@ -38,7 +38,7 @@
#include <utility>
#include <vector>

namespace autoware::motion::control::mpc_lateral_controller
namespace autoware::motion::control::autoware_mpc_lateral_controller
{
namespace MPCUtils
{
Expand Down Expand Up @@ -229,5 +229,5 @@ void update_param(
}

} // namespace MPCUtils
} // namespace autoware::motion::control::mpc_lateral_controller
#endif // MPC_LATERAL_CONTROLLER__MPC_UTILS_HPP_
} // namespace autoware::motion::control::autoware_mpc_lateral_controller
#endif // AUTOWARE_MPC_LATERAL_CONTROLLER__MPC_UTILS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_INTERFACE_HPP_
#define MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_INTERFACE_HPP_
#ifndef AUTOWARE_MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_INTERFACE_HPP_
#define AUTOWARE_MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_INTERFACE_HPP_

#include <Eigen/Core>

namespace autoware::motion::control::mpc_lateral_controller
namespace autoware::motion::control::autoware_mpc_lateral_controller
{

/// Interface for solvers of Quadratic Programming (QP) problems
Expand Down Expand Up @@ -50,5 +50,5 @@ class QPSolverInterface
virtual double getRunTime() const { return 0.0; }
virtual double getObjVal() const { return 0.0; }
};
} // namespace autoware::motion::control::mpc_lateral_controller
#endif // MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_INTERFACE_HPP_
} // namespace autoware::motion::control::autoware_mpc_lateral_controller
#endif // AUTOWARE_MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_INTERFACE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_OSQP_HPP_
#define MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_OSQP_HPP_
#ifndef AUTOWARE_MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_OSQP_HPP_
#define AUTOWARE_MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_OSQP_HPP_

#include "mpc_lateral_controller/qp_solver/qp_solver_interface.hpp"
#include "autoware_mpc_lateral_controller/qp_solver/qp_solver_interface.hpp"
#include "osqp_interface/osqp_interface.hpp"
#include "rclcpp/rclcpp.hpp"

namespace autoware::motion::control::mpc_lateral_controller
namespace autoware::motion::control::autoware_mpc_lateral_controller
{

/// Solver for QP problems using the OSQP library
Expand Down Expand Up @@ -61,5 +61,5 @@ class QPSolverOSQP : public QPSolverInterface
autoware::common::osqp::OSQPInterface osqpsolver_;
rclcpp::Logger logger_;
};
} // namespace autoware::motion::control::mpc_lateral_controller
#endif // MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_OSQP_HPP_
} // namespace autoware::motion::control::autoware_mpc_lateral_controller
#endif // AUTOWARE_MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_OSQP_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_UNCONSTRAINT_FAST_HPP_
#define MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_UNCONSTRAINT_FAST_HPP_
#ifndef AUTOWARE_MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_UNCONSTRAINT_FAST_HPP_
#define AUTOWARE_MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_UNCONSTRAINT_FAST_HPP_

#include "mpc_lateral_controller/qp_solver/qp_solver_interface.hpp"
#include "autoware_mpc_lateral_controller/qp_solver/qp_solver_interface.hpp"

namespace autoware::motion::control::mpc_lateral_controller
namespace autoware::motion::control::autoware_mpc_lateral_controller
{

/**
Expand Down Expand Up @@ -61,5 +61,5 @@ class QPSolverEigenLeastSquareLLT : public QPSolverInterface

private:
};
} // namespace autoware::motion::control::mpc_lateral_controller
#endif // MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_UNCONSTRAINT_FAST_HPP_
} // namespace autoware::motion::control::autoware_mpc_lateral_controller
#endif // AUTOWARE_MPC_LATERAL_CONTROLLER__QP_SOLVER__QP_SOLVER_UNCONSTRAINT_FAST_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 MPC_LATERAL_CONTROLLER__STEERING_OFFSET__STEERING_OFFSET_HPP_
#define MPC_LATERAL_CONTROLLER__STEERING_OFFSET__STEERING_OFFSET_HPP_
#ifndef AUTOWARE_MPC_LATERAL_CONTROLLER__STEERING_OFFSET__STEERING_OFFSET_HPP_
#define AUTOWARE_MPC_LATERAL_CONTROLLER__STEERING_OFFSET__STEERING_OFFSET_HPP_

#include <geometry_msgs/msg/twist.hpp>

Expand Down Expand Up @@ -45,4 +45,4 @@ class SteeringOffsetEstimator
double steering_offset_ = 0.0;
};

#endif // MPC_LATERAL_CONTROLLER__STEERING_OFFSET__STEERING_OFFSET_HPP_
#endif // AUTOWARE_MPC_LATERAL_CONTROLLER__STEERING_OFFSET__STEERING_OFFSET_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 MPC_LATERAL_CONTROLLER__STEERING_PREDICTOR_HPP_
#define MPC_LATERAL_CONTROLLER__STEERING_PREDICTOR_HPP_
#ifndef AUTOWARE_MPC_LATERAL_CONTROLLER__STEERING_PREDICTOR_HPP_
#define AUTOWARE_MPC_LATERAL_CONTROLLER__STEERING_PREDICTOR_HPP_

#include "rclcpp/rclcpp.hpp"

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

namespace autoware::motion::control::mpc_lateral_controller
namespace autoware::motion::control::autoware_mpc_lateral_controller
{
using autoware_control_msgs::msg::Lateral;

Expand Down Expand Up @@ -79,6 +79,6 @@ class SteeringPredictor
void setPrevResult(const double & steering);
};

} // namespace autoware::motion::control::mpc_lateral_controller
} // namespace autoware::motion::control::autoware_mpc_lateral_controller

#endif // MPC_LATERAL_CONTROLLER__STEERING_PREDICTOR_HPP_
#endif // AUTOWARE_MPC_LATERAL_CONTROLLER__STEERING_PREDICTOR_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@
* Tracking", Robotics Institute, Carnegie Mellon University, February 2009.
*/

#ifndef MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_DYNAMICS_HPP_
#define MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_DYNAMICS_HPP_
#ifndef AUTOWARE_MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_DYNAMICS_HPP_
#define AUTOWARE_MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_DYNAMICS_HPP_

#include "mpc_lateral_controller/vehicle_model/vehicle_model_interface.hpp"
#include "autoware_mpc_lateral_controller/vehicle_model/vehicle_model_interface.hpp"

#include <Eigen/Core>
#include <Eigen/LU>

#include <string>

namespace autoware::motion::control::mpc_lateral_controller
namespace autoware::motion::control::autoware_mpc_lateral_controller
{

/**
Expand Down Expand Up @@ -121,5 +121,5 @@ class DynamicsBicycleModel : public VehicleModelInterface
double m_cf; //!< @brief front cornering power [N/rad]
double m_cr; //!< @brief rear cornering power [N/rad]
};
} // namespace autoware::motion::control::mpc_lateral_controller
#endif // MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_DYNAMICS_HPP_
} // namespace autoware::motion::control::autoware_mpc_lateral_controller
#endif // AUTOWARE_MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_DYNAMICS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@
*
*/

#ifndef MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_KINEMATICS_HPP_
#define MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_KINEMATICS_HPP_
#ifndef AUTOWARE_MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_KINEMATICS_HPP_
#define AUTOWARE_MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_KINEMATICS_HPP_

#include "mpc_lateral_controller/vehicle_model/vehicle_model_interface.hpp"
#include "autoware_mpc_lateral_controller/vehicle_model/vehicle_model_interface.hpp"

#include <Eigen/Core>
#include <Eigen/LU>

#include <string>

namespace autoware::motion::control::mpc_lateral_controller
namespace autoware::motion::control::autoware_mpc_lateral_controller
{

/**
Expand Down Expand Up @@ -105,5 +105,5 @@ class KinematicsBicycleModel : public VehicleModelInterface
double m_steer_lim; //!< @brief steering angle limit [rad]
double m_steer_tau; //!< @brief steering time constant for 1d-model [s]
};
} // namespace autoware::motion::control::mpc_lateral_controller
#endif // MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_KINEMATICS_HPP_
} // namespace autoware::motion::control::autoware_mpc_lateral_controller
#endif // AUTOWARE_MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_KINEMATICS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@
*
*/

#ifndef MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_KINEMATICS_NO_DELAY_HPP_
#define MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_KINEMATICS_NO_DELAY_HPP_
#ifndef AUTOWARE_MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_KINEMATICS_NO_DELAY_HPP_
#define AUTOWARE_MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_KINEMATICS_NO_DELAY_HPP_

#include "mpc_lateral_controller/vehicle_model/vehicle_model_interface.hpp"
#include "autoware_mpc_lateral_controller/vehicle_model/vehicle_model_interface.hpp"

#include <Eigen/Core>
#include <Eigen/LU>

#include <string>

namespace autoware::motion::control::mpc_lateral_controller
namespace autoware::motion::control::autoware_mpc_lateral_controller
{

/**
Expand Down Expand Up @@ -100,5 +100,5 @@ class KinematicsBicycleModelNoDelay : public VehicleModelInterface
private:
double m_steer_lim; //!< @brief steering angle limit [rad]
};
} // namespace autoware::motion::control::mpc_lateral_controller
#endif // MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_KINEMATICS_NO_DELAY_HPP_
} // namespace autoware::motion::control::autoware_mpc_lateral_controller
#endif // AUTOWARE_MPC_LATERAL_CONTROLLER__VEHICLE_MODEL__VEHICLE_MODEL_BICYCLE_KINEMATICS_NO_DELAY_HPP_
Loading
Loading