Skip to content

Commit

Permalink
automated style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sid-parikh authored Apr 29, 2024
1 parent 3a78e1d commit a7ffc76
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 33 deletions.
2 changes: 1 addition & 1 deletion soccer/src/soccer/radio/network_radio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void NetworkRadio::receive_alive_robots(const boost::system::error_code& error,
return;
}

uint16_t alive = (((uint16_t) alive_robots_buffer_[1]) << 8) | (alive_robots_buffer_[0]);
uint16_t alive = (((uint16_t)alive_robots_buffer_[1]) << 8) | (alive_robots_buffer_[0]);
SPDLOG_INFO("Alive: {}", alive);

// uint16_t alive = (alive_robots_buffer_[0] << 8) | (alive_robots_buffer_[0]);
Expand Down
4 changes: 2 additions & 2 deletions soccer/src/soccer/strategy/agent/position/line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ std::optional<RobotIntent> Line::derived_get_task(RobotIntent intent) {
field_dimensions_.center_field_loc().x() - 1.0,
field_dimensions_.center_field_loc().y() - 1.0 + robot_id_ * 0.75},
rj_geometry::Point{0.0, 0.0}},
planning::FacePoint{rj_geometry::Point{0.0,0.0}}, true};
planning::FacePoint{rj_geometry::Point{0.0, 0.0}}, true};

intent.motion_command = motion_command;
} else {
Expand All @@ -25,7 +25,7 @@ std::optional<RobotIntent> Line::derived_get_task(RobotIntent intent) {
field_dimensions_.center_field_loc().x() + 1.0,
field_dimensions_.center_field_loc().y() - 1.0 + robot_id_ * 0.75},
rj_geometry::Point{0.0, 0.0}},
planning::FacePoint{rj_geometry::Point{0.0,0.0}}, true};
planning::FacePoint{rj_geometry::Point{0.0, 0.0}}, true};

intent.motion_command = motion_command;
}
Expand Down
48 changes: 20 additions & 28 deletions soccer/src/soccer/strategy/agent/position/line.hpp
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
#pragma once

#include "position.hpp"
#include <spdlog/spdlog.h>
#include "rclcpp/rclcpp.hpp"

#include "position.hpp"
#include "rclcpp/rclcpp.hpp"

namespace strategy {
class Line : public Position {

public:

Line(int r_id) : Position{r_id, "line"} {}
Line(const Position& other) : Position{other} {
position_name_ = "Line";
}
~Line() = default;
Line(const Line&) = default;
Line(Line&&) = default;
Line& operator=(const Line&) = default;
Line& operator=(Line&&) = default;


std::string get_current_state() override {
return "Line";
}

private:

std::optional<RobotIntent> derived_get_task(RobotIntent intent) override;

bool forward_ = true;
};
}
class Line : public Position {
public:
Line(int r_id) : Position{r_id, "line"} {}
Line(const Position& other) : Position{other} { position_name_ = "Line"; }
~Line() = default;
Line(const Line&) = default;
Line(Line&&) = default;
Line& operator=(const Line&) = default;
Line& operator=(Line&&) = default;

std::string get_current_state() override { return "Line"; }

private:
std::optional<RobotIntent> derived_get_task(RobotIntent intent) override;

bool forward_ = true;
};
} // namespace strategy
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ RobotFactoryPosition::RobotFactoryPosition(int r_id) : Position(r_id, "RobotFact
}
}

std::optional<RobotIntent> RobotFactoryPosition::derived_get_task(
[[maybe_unused]] RobotIntent intent) {
std::optional<RobotIntent> RobotFactoryPosition::derived_get_task([
[maybe_unused]] RobotIntent intent) {
if (robot_id_ == goalie_id_) {
set_current_position<Line>();
return current_position_->get_task(*last_world_state_, field_dimensions_,
Expand Down

0 comments on commit a7ffc76

Please sign in to comment.