Skip to content

Commit

Permalink
Fix Code Style On tutorial-solution (#2306)
Browse files Browse the repository at this point in the history
automated style fixes

Co-authored-by: jacksherling <[email protected]>
  • Loading branch information
github-actions[bot] and jacksherling authored Nov 4, 2024
1 parent 1044e75 commit f02da99
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 21 deletions.
3 changes: 1 addition & 2 deletions soccer/src/soccer/soccer_mom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ SoccerMom::SoccerMom() : rclcpp::Node{"SoccerMom"} {
message.data = "bananas";
}
soccer_mom_pub_->publish(message);
}
);
});
}
14 changes: 7 additions & 7 deletions soccer/src/soccer/soccer_mom.hpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#pragma once

#include <rclcpp/rclcpp.hpp>

#include <rj_constants/topic_names.hpp>

#include "std_msgs/msg/string.hpp"
#include "rj_msgs/msg/team_color.hpp"
#include "std_msgs/msg/string.hpp"

class SoccerMom : public rclcpp::Node {
public:
SoccerMom();

private:
rclcpp::Subscription<rj_msgs::msg::TeamColor>::SharedPtr team_color_sub_;
rclcpp::Publisher<std_msgs::msg::String>::SharedPtr soccer_mom_pub_;
public:
SoccerMom();

private:
rclcpp::Subscription<rj_msgs::msg::TeamColor>::SharedPtr team_color_sub_;
rclcpp::Publisher<std_msgs::msg::String>::SharedPtr soccer_mom_pub_;
};
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
#include "strategy/agent/position/penalty_player.hpp"
#include "strategy/agent/position/pivot_test.hpp"
#include "strategy/agent/position/position.hpp"
#include "strategy/agent/position/runner.hpp"
#include "strategy/agent/position/smartidling.hpp"
#include "strategy/agent/position/solo_offense.hpp"
#include "strategy/agent/position/zoner.hpp"
#include "strategy/agent/position/runner.hpp"

namespace strategy {

Expand Down
4 changes: 1 addition & 3 deletions soccer/src/soccer/strategy/agent/position/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Runner::State Runner::next_state() {
if (!check_is_done()) {
return current_state_;
}
switch(current_state_) {
switch (current_state_) {
case TOP_LEFT:
return TOP_RIGHT;
case TOP_RIGHT:
Expand Down Expand Up @@ -52,7 +52,6 @@ std::optional<RobotIntent> Runner::derived_get_task(RobotIntent intent) {
return state_to_task(intent);
};


std::optional<RobotIntent> Runner::state_to_task(RobotIntent intent) {
planning::LinearMotionInstant target;
switch (current_state_) {
Expand All @@ -73,7 +72,6 @@ std::optional<RobotIntent> Runner::state_to_task(RobotIntent intent) {
planning::MotionCommand prep_command{"path_target", target, planning::FaceTarget{}};
intent.motion_command = prep_command;
return intent;

}

} // namespace strategy
9 changes: 1 addition & 8 deletions soccer/src/soccer/strategy/agent/position/runner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ class Runner : public Position {
private:
std::optional<RobotIntent> derived_get_task(RobotIntent intent) override;


enum State {
TOP_LEFT,
TOP_RIGHT,
BOTTOM_LEFT,
BOTTOM_RIGHT
};
enum State { TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT };

State current_state_ = State::TOP_LEFT;

Expand All @@ -43,6 +37,5 @@ class Runner : public Position {
State next_state();

std::optional<RobotIntent> state_to_task(RobotIntent intent);

};
} // namespace strategy

0 comments on commit f02da99

Please sign in to comment.