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(trajectory_follower): simplify namespace format #1792

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
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@

#include <array>

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
using autoware::common::types::float64_t;
/// Debug Values used for debugging or controller tuning
Expand Down Expand Up @@ -97,9 +91,6 @@ class TRAJECTORY_FOLLOWER_PUBLIC DebugValues
private:
std::array<float64_t, static_cast<size_t>(TYPE::SIZE)> m_values;
};
} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower

#endif // TRAJECTORY_FOLLOWER__DEBUG_VALUES_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,14 @@
#include "autoware_auto_vehicle_msgs/msg/steering_report.hpp"
#include "nav_msgs/msg/odometry.hpp"

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
struct InputData
{
autoware_auto_planning_msgs::msg::Trajectory::SharedPtr current_trajectory_ptr;
nav_msgs::msg::Odometry::SharedPtr current_odometry_ptr;
autoware_auto_vehicle_msgs::msg::SteeringReport::SharedPtr current_steering_ptr;
};
} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower

#endif // TRAJECTORY_FOLLOWER__INPUT_DATA_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@
#include <iostream>
#include <vector>

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
using autoware::common::types::bool8_t;
using autoware::common::types::float64_t;
Expand All @@ -52,8 +46,5 @@ TRAJECTORY_FOLLOWER_PUBLIC bool8_t linearInterpolate(
TRAJECTORY_FOLLOWER_PUBLIC bool8_t linearInterpolate(
const std::vector<float64_t> & base_index, const std::vector<float64_t> & base_value,
const float64_t & return_index, float64_t & return_value);
} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower
#endif // TRAJECTORY_FOLLOWER__INTERPOLATE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@

#include <boost/optional.hpp>

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
struct LateralOutput
{
Expand All @@ -51,9 +45,6 @@ class LateralControllerBase
LongitudinalSyncData longitudinal_sync_data_;
};

} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower

#endif // TRAJECTORY_FOLLOWER__LATERAL_CONTROLLER_BASE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@

#include <boost/optional.hpp>

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
struct LongitudinalOutput
{
Expand All @@ -47,9 +41,6 @@ class LongitudinalControllerBase
LateralSyncData lateral_sync_data_;
};

} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower

#endif // TRAJECTORY_FOLLOWER__LONGITUDINAL_CONTROLLER_BASE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@
#include <cmath>
#include <limits>

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
namespace longitudinal_utils
{
Expand Down Expand Up @@ -166,9 +160,6 @@ TRAJECTORY_FOLLOWER_PUBLIC float64_t applyDiffLimitFilter(
const float64_t input_val, const float64_t prev_val, const float64_t dt, const float64_t max_val,
const float64_t min_val);
} // namespace longitudinal_utils
} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower

#endif // TRAJECTORY_FOLLOWER__LONGITUDINAL_CONTROLLER_UTILS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@
#include <iostream>
#include <vector>

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
using autoware::common::types::bool8_t;
using autoware::common::types::float64_t;
Expand Down Expand Up @@ -154,8 +148,5 @@ namespace MoveAverageFilter
*/
TRAJECTORY_FOLLOWER_PUBLIC bool8_t filt_vector(const int64_t num, std::vector<float64_t> & u);
} // namespace MoveAverageFilter
} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower
#endif // TRAJECTORY_FOLLOWER__LOWPASS_FILTER_HPP_
13 changes: 2 additions & 11 deletions control/trajectory_follower/include/trajectory_follower/mpc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,7 @@
#include <string>
#include <vector>

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
using autoware::common::types::bool8_t;
using autoware::common::types::float64_t;
Expand Down Expand Up @@ -440,9 +434,6 @@ class TRAJECTORY_FOLLOWER_PUBLIC MPC
*/
inline void setClock(rclcpp::Clock::SharedPtr clock) { m_clock = clock; }
}; // class MPC
} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower

#endif // TRAJECTORY_FOLLOWER__MPC_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,7 @@
#include <string>
#include <vector>

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
using autoware::common::types::bool8_t;
using autoware::common::types::float64_t;
Expand Down Expand Up @@ -215,9 +209,6 @@ class TRAJECTORY_FOLLOWER_PUBLIC MpcLateralController : public LateralController
rcl_interfaces::msg::SetParametersResult paramCallback(
const std::vector<rclcpp::Parameter> & parameters);
};
} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower

#endif // TRAJECTORY_FOLLOWER__MPC_LATERAL_CONTROLLER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@
#include <iostream>
#include <vector>

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
using autoware::common::types::float64_t;
/**
Expand Down Expand Up @@ -98,8 +92,5 @@ class TRAJECTORY_FOLLOWER_PUBLIC MPCTrajectory
return points;
}
};
} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower
#endif // TRAJECTORY_FOLLOWER__MPC_TRAJECTORY_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,7 @@
#include <string>
#include <vector>

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
namespace MPCUtils
{
Expand Down Expand Up @@ -184,8 +178,5 @@ TRAJECTORY_FOLLOWER_PUBLIC bool8_t calcNearestPoseInterp(
TRAJECTORY_FOLLOWER_PUBLIC float64_t calcStopDistance(
const autoware_auto_planning_msgs::msg::Trajectory & current_trajectory, const int64_t origin);
} // namespace MPCUtils
} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower
#endif // TRAJECTORY_FOLLOWER__MPC_UTILS_HPP_
13 changes: 2 additions & 11 deletions control/trajectory_follower/include/trajectory_follower/pid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@

#include <vector>

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
using autoware::common::types::bool8_t;
using autoware::common::types::float64_t;
Expand Down Expand Up @@ -100,9 +94,6 @@ class TRAJECTORY_FOLLOWER_PUBLIC PIDController
bool8_t m_is_gains_set;
bool8_t m_is_limits_set;
};
} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower

#endif // TRAJECTORY_FOLLOWER__PID_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,7 @@
#include <utility>
#include <vector>

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
using autoware::common::types::bool8_t;
using autoware::common::types::float64_t;
Expand Down Expand Up @@ -369,9 +363,6 @@ class TRAJECTORY_FOLLOWER_PUBLIC PidLongitudinalController : public Longitudinal
const Motion & ctrl_cmd, const geometry_msgs::msg::Pose & current_pose,
const ControlData & control_data);
};
} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower

#endif // TRAJECTORY_FOLLOWER__PID_LONGITUDINAL_CONTROLLER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@
#include "eigen3/Eigen/LU"
#include "trajectory_follower/visibility_control.hpp"

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
using autoware::common::types::bool8_t;
/// Interface for solvers of Quadratic Programming (QP) problems
Expand Down Expand Up @@ -56,8 +50,5 @@ class TRAJECTORY_FOLLOWER_PUBLIC QPSolverInterface
const Eigen::VectorXd & lb, const Eigen::VectorXd & ub, const Eigen::VectorXd & lb_a,
const Eigen::VectorXd & ub_a, Eigen::VectorXd & u) = 0;
};
} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower
#endif // TRAJECTORY_FOLLOWER__QP_SOLVER__QP_SOLVER_INTERFACE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@
#include "trajectory_follower/qp_solver/qp_solver_interface.hpp"
#include "trajectory_follower/visibility_control.hpp"

namespace autoware
{
namespace motion
{
namespace control
{
namespace trajectory_follower
namespace autoware::motion::control::trajectory_follower
{
using autoware::common::types::bool8_t;
using autoware::common::types::float64_t;
Expand Down Expand Up @@ -67,8 +61,5 @@ class TRAJECTORY_FOLLOWER_PUBLIC QPSolverOSQP : public QPSolverInterface
autoware::common::osqp::OSQPInterface osqpsolver_;
rclcpp::Logger logger_;
};
} // namespace trajectory_follower
} // namespace control
} // namespace motion
} // namespace autoware
} // namespace autoware::motion::control::trajectory_follower
#endif // TRAJECTORY_FOLLOWER__QP_SOLVER__QP_SOLVER_OSQP_HPP_
Loading