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

Feature/remove interface #1204

Draft
wants to merge 41 commits into
base: development
Choose a base branch
from
Draft

Conversation

rolfvdhulst
Copy link
Contributor

No description provided.

#include "stp/plays/TimeOut.h"

rtt::AI::AI() {
plays = std::vector<std::unique_ptr<rtt::ai::stp::Play>>{};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant line

rtt::ai::Constants::init();


rtt::SETTINGS.setVisionIp("127.0.0.1");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is still global?

Copy link
Contributor Author

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.

Comment on lines 68 to 69
bool result = a.exec();
return result;
Copy link
Contributor

@Yuhanun Yuhanun Mar 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool result = a.exec();
return result;
return a.exec();

Copy link
Contributor

@Yuhanun Yuhanun left a 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;
Copy link
Contributor

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.
Copy link
Contributor

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";
Copy link
Contributor

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 *
Copy link
Contributor

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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(""));
Copy link
Contributor

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.

Comment on lines +106 to +107
std::vector<Vector2> positions{};
positionControl.setRobotPositions(positions);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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()); });
Copy link
Contributor

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?

Comment on lines +23 to +27
if (settings.isYellow()) {
keeperID = refMsg.yellow().goalkeeper();
} else {
keeperID = refMsg.blue().goalkeeper();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
interface_gamestate=newGameState;
interface_gamestate = newGameState;

Copy link
Member

@JaroKuiken JaroKuiken left a 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
…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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants