Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
Merge branch 'development' into fix/defendShotIssues
Browse files Browse the repository at this point in the history
  • Loading branch information
Florisheinen1 authored Jan 20, 2022
2 parents 2b525d9 + 03a75a9 commit 71d0128
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
22 changes: 11 additions & 11 deletions src/ApplicationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void ApplicationManager::start() {
/// This play is only used for testing purposes, when needed uncomment this play!
// plays.emplace_back(std::make_unique<rtt::ai::stp::TestPlay>());

//plays.emplace_back(std::make_unique<rtt::ai::stp::play::AttackingPass>());
// plays.emplace_back(std::make_unique<rtt::ai::stp::play::AttackingPass>());
plays.emplace_back(std::make_unique<rtt::ai::stp::play::Attack>());
plays.emplace_back(std::make_unique<rtt::ai::stp::play::Halt>());
plays.emplace_back(std::make_unique<rtt::ai::stp::play::DefendShot>());
Expand All @@ -64,20 +64,20 @@ void ApplicationManager::start() {
plays.emplace_back(std::make_unique<rtt::ai::stp::play::AggressiveStopFormation>());
plays.emplace_back(std::make_unique<rtt::ai::stp::play::BallPlacementUs>());
plays.emplace_back(std::make_unique<rtt::ai::stp::play::BallPlacementThem>());
//plays.emplace_back(std::make_unique<rtt::ai::stp::play::TimeOut>());
//plays.emplace_back(std::make_unique<rtt::ai::stp::play::PenaltyThemPrepare>());
//plays.emplace_back(std::make_unique<rtt::ai::stp::play::PenaltyUsPrepare>());
//plays.emplace_back(std::make_unique<rtt::ai::stp::play::PenaltyThem>());
//plays.emplace_back(std::make_unique<rtt::ai::stp::play::PenaltyUs>());
// plays.emplace_back(std::make_unique<rtt::ai::stp::play::TimeOut>());
// plays.emplace_back(std::make_unique<rtt::ai::stp::play::PenaltyThemPrepare>());
// plays.emplace_back(std::make_unique<rtt::ai::stp::play::PenaltyUsPrepare>());
// plays.emplace_back(std::make_unique<rtt::ai::stp::play::PenaltyThem>());
// plays.emplace_back(std::make_unique<rtt::ai::stp::play::PenaltyUs>());
plays.emplace_back(std::make_unique<rtt::ai::stp::play::KickOffUsPrepare>());
plays.emplace_back(std::make_unique<rtt::ai::stp::play::KickOffThemPrepare>());
//plays.emplace_back(std::make_unique<rtt::ai::stp::play::FreeKickThem>());
// plays.emplace_back(std::make_unique<rtt::ai::stp::play::FreeKickThem>());
plays.emplace_back(std::make_unique<rtt::ai::stp::play::KickOffUs>());
plays.emplace_back(std::make_unique<rtt::ai::stp::play::KickOffThem>());
//plays.emplace_back(std::make_unique<rtt::ai::stp::play::GetBallPossession>());
//plays.emplace_back(std::make_unique<rtt::ai::stp::play::GetBallRisky>());
//plays.emplace_back(std::make_unique<rtt::ai::stp::play::ReflectKick>());
//plays.emplace_back(std::make_unique<rtt::ai::stp::play::GenericPass>());
// plays.emplace_back(std::make_unique<rtt::ai::stp::play::GetBallPossession>());
// plays.emplace_back(std::make_unique<rtt::ai::stp::play::GetBallRisky>());
// plays.emplace_back(std::make_unique<rtt::ai::stp::play::ReflectKick>());
// plays.emplace_back(std::make_unique<rtt::ai::stp::play::GenericPass>());
playChecker.setPlays(plays);

int amountOfCycles = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/control/positionControl/BBTrajectories/Trajectory2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
//

#include "control/positionControl/BBTrajectories/Trajectory2D.h"
#include "control/positionControl/BBTrajectories/BBTrajectory2D.h"

#include <cmath>

#include "control/positionControl/BBTrajectories/BBTrajectory2D.h"

namespace rtt {

Trajectory2D::Trajectory2D(const Vector2 &initialPos, const Vector2 &initialVel, const Vector2 &finalPos, double maxVel, double maxAcc) {
Expand Down
2 changes: 1 addition & 1 deletion src/stp/plays/offensive/Attack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void Attack::calculateInfoForRoles() noexcept {
}

bool Attack::shouldEndPlay() noexcept {
return std::any_of(roles.begin(), roles.end(), [](const std::unique_ptr<Role>& role) {return role != nullptr && role->getName() == "attacker" && role->finished();});
return std::any_of(roles.begin(), roles.end(), [](const std::unique_ptr<Role>& role) { return role != nullptr && role->getName() == "attacker" && role->finished(); });
}

const char* Attack::getName() { return "Attack"; }
Expand Down
3 changes: 2 additions & 1 deletion src/stp/plays/referee_specific/BallPlacementUs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ void BallPlacementUs::calculateInfoForRoles() noexcept {
auto ballTarget = rtt::ai::GameStateManager::getRefereeDesignatedPosition();

// Adjust placement position to be one robot radius away in the distance of movement
if (stpInfos["ball_placer"].getRobot()) ballTarget -= (world->getWorld()->get()->getBall()->get()->getPos() - stpInfos["ball_placer"].getRobot()->get()->getPos()).stretchToLength(control_constants::ROBOT_RADIUS);
if (stpInfos["ball_placer"].getRobot())
ballTarget -= (world->getWorld()->get()->getBall()->get()->getPos() - stpInfos["ball_placer"].getRobot()->get()->getPos()).stretchToLength(control_constants::ROBOT_RADIUS);

stpInfos["ball_placer"].setPositionToMoveTo(ballTarget);

Expand Down
1 change: 0 additions & 1 deletion src/stp/tactics/passive/BlockBall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ Vector2 BlockBall::calculateTargetPosition(const world::view::BallView &ball, Ve
default:
distance = targetToBall.length() / 2;
break;

}

// Do not get closer than 4 robot radii (to avoid collisions)
Expand Down
2 changes: 1 addition & 1 deletion src/world/Robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Robot::Robot(std::unordered_map<uint8_t, proto::RobotFeedback> &feedback, const
workingBallSensor = ai::Constants::ROBOT_HAS_WORKING_BALL_SENSOR(id);
}

if (team == Team::us){
if (team == Team::us) {
if (feedback.find(id) != feedback.end()) {
updateFromFeedback(feedback[id]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/world/views/RobotView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ robot::Robot const *RobotView::operator->() const noexcept { return get(); }
bool RobotView::hasBall(double maxDist, double maxAngle) const noexcept {
// In the sim, we only use the ball sensor to determine if the robot has the ball
// On the field, and for the enemies in the sim, we also use the camera to do so
return ((this->robotPtr->getTeam()==Team::them || SETTINGS.isSerialMode()) && hasBallAccordingToVision(maxDist, maxAngle)) || get()->ballSensorSeesBall();
return ((this->robotPtr->getTeam() == Team::them || SETTINGS.isSerialMode()) && hasBallAccordingToVision(maxDist, maxAngle)) || get()->ballSensorSeesBall();
}

Vector2 RobotView::getKicker() const noexcept {
Expand Down

0 comments on commit 71d0128

Please sign in to comment.