Skip to content

Commit

Permalink
refactor(controllers): use specific logger name (#5111)
Browse files Browse the repository at this point in the history
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
  • Loading branch information
TakaHoribe authored Sep 26, 2023
1 parent 46f871f commit d9ab02a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace autoware::motion::control::mpc_lateral_controller
{

MpcLateralController::MpcLateralController(rclcpp::Node & node)
: clock_(node.get_clock()), logger_(node.get_logger())
: clock_(node.get_clock()), logger_(node.get_logger().get_child("lateral_controller"))
{
const auto dp_int = [&](const std::string & s) { return node.declare_parameter<int>(s); };
const auto dp_bool = [&](const std::string & s) { return node.declare_parameter<bool>(s); };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace autoware::motion::control::pid_longitudinal_controller
PidLongitudinalController::PidLongitudinalController(rclcpp::Node & node)
: node_parameters_(node.get_node_parameters_interface()),
clock_(node.get_clock()),
logger_(node.get_logger()),
logger_(node.get_logger().get_child("longitudinal_controller")),
diagnostic_updater_(&node)
{
using std::placeholders::_1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ enum TYPE {
namespace pure_pursuit
{
PurePursuitLateralController::PurePursuitLateralController(rclcpp::Node & node)
: clock_(node.get_clock()), logger_(node.get_logger()), tf_buffer_(clock_), tf_listener_(tf_buffer_)
: clock_(node.get_clock()),
logger_(node.get_logger().get_child("lateral_controller")),
tf_buffer_(clock_),
tf_listener_(tf_buffer_)
{
pure_pursuit_ = std::make_unique<PurePursuit>();

Expand Down

0 comments on commit d9ab02a

Please sign in to comment.