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

Fix Code Style On tutorial-solution #2306

Merged
merged 1 commit into from
Nov 4, 2024
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
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