-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/remove interface #1204
base: development
Are you sure you want to change the base?
Feature/remove interface #1204
Conversation
#include "stp/plays/TimeOut.h" | ||
|
||
rtt::AI::AI() { | ||
plays = std::vector<std::unique_ptr<rtt::ai::stp::Play>>{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant line
src/ApplicationManager.cpp
Outdated
rtt::ai::Constants::init(); | ||
|
||
|
||
rtt::SETTINGS.setVisionIp("127.0.0.1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is still global?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still refactoring it.
src/roboteam_ai.cpp
Outdated
bool result = a.exec(); | ||
return result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool result = a.exec(); | |
return result; | |
return a.exec(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot of lines that were commented out cuz they're draw calls which is fine, but we'll have to replace those at some point, maybe turn them into TODO's.
Apart from that it seems fine, I haven't tested it but if it works then it works, spacing is off sometimes but I'll just clang-format the entire codebase after new UI.
* Pointer to GUI settings | ||
*/ | ||
Settings *settings; | ||
bool we_are_yellow; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this where this should be?
if(state.has_referee()){ | ||
auto referee = state.referee(); | ||
|
||
roboteam_utils::rotate(&referee); //this only rotates the ball placement marker. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this not rtt;;utils?
{ | ||
// Our name as specified by ssl-game-controller : https://github.com/RoboCup-SSL/ssl-game-controller/blob/master/config/engine.yaml | ||
//make sure this matches exactly! | ||
std::string ROBOTEAM_TWENTE = "RoboTeam Twente"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this not be in config.hpp or smth?
onSideOrColorChanged(); | ||
} | ||
} | ||
ai::GameStateManager::setRefereeData(referee, world.get(),settings); //TODO: fix world * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with world?
} | ||
|
||
std::string AISettings::name() const { | ||
return "ai"+std::to_string(id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return "ai"+std::to_string(id); | |
return "ai" + std::to_string(id); |
//first receive any setting changes | ||
bool received = true; | ||
int numReceivedMessages = 0; | ||
stx::Result<proto::UiValues, std::string> last_message = stx::Err(std::string("")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I really thought i was the only one using Result types, im so proud.
std::vector<Vector2> positions{}; | ||
positionControl.setRobotPositions(positions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::vector<Vector2> positions{}; | |
positionControl.setRobotPositions(positions); | |
positionControl.setRobotPositions({}); |
@@ -98,9 +98,15 @@ namespace rtt::world { | |||
} | |||
|
|||
void World::updatePositionControl() { | |||
if(!getWorld()->getRobotsNonOwning().empty()){ | |||
std::vector<Vector2> robotPositions(getWorld()->getRobotsNonOwning().size()); | |||
std::transform(getWorld()->getRobotsNonOwning().begin(), getWorld()->getRobotsNonOwning().end(), robotPositions.begin(), [](const auto& robot) -> Vector2 { return (robot->getPos()); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we uhhh, &Robot::getPos?
if (settings.isYellow()) { | ||
keeperID = refMsg.yellow().goalkeeper(); | ||
} else { | ||
keeperID = refMsg.blue().goalkeeper(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (settings.isYellow()) { | |
keeperID = refMsg.yellow().goalkeeper(); | |
} else { | |
keeperID = refMsg.blue().goalkeeper(); | |
} | |
keeperID = (settings.isYellow() ? refMsg.yellow() : refMsg.blue()).goalkeeper(); |
// if there is a ref we set the interface gamestate to these values as well | ||
// this makes sure that when we stop using the referee we don't return to an unknown state, | ||
// // so now we keep the same. | ||
interface::Output::setInterfaceGameState(newGameState); | ||
interface_gamestate=newGameState; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interface_gamestate=newGameState; | |
interface_gamestate = newGameState; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't find something majorly wrong STP-wise, so lets hope thats true
# Conflicts: # CMakeLists.txt # include/roboteam_ai/ApplicationManager.h # include/roboteam_ai/control/ControlModule.h # include/roboteam_ai/interface/widgets/MainControlsWidget.h # include/roboteam_ai/interface/widgets/ManualControlWidget.h # include/roboteam_ai/interface/widgets/PidBox.h # include/roboteam_ai/interface/widgets/PidsWidget.h # include/roboteam_ai/interface/widgets/RobotsWidget.h # include/roboteam_ai/interface/widgets/STPVisualizerWidget.h # include/roboteam_ai/interface/widgets/widget.h # include/roboteam_ai/stp/Play.hpp # include/roboteam_ai/world/WorldData.hpp # src/ApplicationManager.cpp # src/control/ControlModule.cpp # src/control/positionControl/PositionControl.cpp # src/interface/api/Output.cpp # src/interface/widgets/GraphWidget.cpp # src/interface/widgets/PlaysWidget.cpp # src/interface/widgets/STPVisualizerWidget.cpp # src/interface/widgets/SettingsWidget.cpp # src/interface/widgets/widget.cpp # src/manual/JoystickManager.cpp # src/roboteam_ai.cpp # src/stp/Play.cpp # src/utilities/GameStateManager.cpp # src/utilities/IOManager.cpp # src/utilities/Pause.cpp # src/utilities/Settings.cpp # src/world/Ball.cpp
…declaration parsing
…re the single source of truth anyways/don't need to react.
…f statement * Make sure declarations have state change status while values do not
No description provided.