Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jun 27, 2024
1 parent 61dcfad commit 3bf52e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
15 changes: 9 additions & 6 deletions planning/trajectory_repeater/src/trajectory_repeater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,29 @@ TrajectoryRepeater::TrajectoryRepeater(const rclcpp::NodeOptions & node_options)

// Subscriber
sub_trajectory_ = create_subscription<autoware_auto_planning_msgs::msg::Trajectory>(
"~/input/trajectory", 10, std::bind(&TrajectoryRepeater::onTrajectory, this, std::placeholders::_1));
"~/input/trajectory", 10,
std::bind(&TrajectoryRepeater::onTrajectory, this, std::placeholders::_1));

// Publisher
pub_trajectory_ = create_publisher<autoware_auto_planning_msgs::msg::Trajectory>("~/output/trajectory", 10);
pub_trajectory_ =
create_publisher<autoware_auto_planning_msgs::msg::Trajectory>("~/output/trajectory", 10);

// Service

// Client

// Timer
using namespace std::literals::chrono_literals;
timer_ = rclcpp::create_timer(this, get_clock(), 100ms, std::bind(&TrajectoryRepeater::onTimer, this));
timer_ =
rclcpp::create_timer(this, get_clock(), 100ms, std::bind(&TrajectoryRepeater::onTimer, this));

// State

// Diagnostics

}

void TrajectoryRepeater::onTrajectory(const autoware_auto_planning_msgs::msg::Trajectory::ConstSharedPtr msg)
void TrajectoryRepeater::onTrajectory(
const autoware_auto_planning_msgs::msg::Trajectory::ConstSharedPtr msg)
{
last_trajectory_ = msg;
}
Expand All @@ -54,7 +57,7 @@ void TrajectoryRepeater::onTimer()
RCLCPP_DEBUG(get_logger(), "No trajectory received");
return;
}

pub_trajectory_->publish(*last_trajectory_);
}

Expand Down
9 changes: 4 additions & 5 deletions planning/trajectory_repeater/src/trajectory_repeater.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 TRAJECTORY_REPEATER__TRAJECTORY_REPEATER_HPP_
#define TRAJECTORY_REPEATER__TRAJECTORY_REPEATER_HPP_
#ifndef TRAJECTORY_REPEATER_HPP_
#define TRAJECTORY_REPEATER_HPP_

// include
#include <rclcpp/rclcpp.hpp>
Expand Down Expand Up @@ -46,15 +46,14 @@ class TrajectoryRepeater : public rclcpp::Node

// Timer
rclcpp::TimerBase::SharedPtr timer_;

void onTimer();

// State
autoware_auto_planning_msgs::msg::Trajectory::ConstSharedPtr last_trajectory_;

// Diagnostics

};
} // namespace trajectory_repeater

#endif // TRAJECTORY_REPEATER__TRAJECTORY_REPEATER_HPP_
#endif // TRAJECTORY_REPEATER_HPP_

0 comments on commit 3bf52e3

Please sign in to comment.