Implementação do ball placement simplificado#6
Conversation
lucaasleal
left a comment
There was a problem hiding this comment.
Ótima implementação. A lógica foi bem planejada e a aplicação em código bem organizada.
MatheusStepple
left a comment
There was a problem hiding this comment.
Ótimo código, apenas visualizar a possibilidade de: voltar a posição na formação original e ponto de "lateral" dinâmico.
giovanna-bardi
left a comment
There was a problem hiding this comment.
Estrutura muito boa e lógica bem estruturada. O código poderia ter um gatilho para começar o ball placement.
|
Ótima implementação!! A lógica está correta. |
MatheusPaixaoG
left a comment
There was a problem hiding this comment.
Boa galera! Vi no lab e tava funcionando, deixei mais uns comentários sobre organização e padronização de código.
| QPointF targetPosition(1000, 4000); | ||
| QPointF initialPosition(2000, 0); | ||
| int tolerance = 150; |
There was a problem hiding this comment.
Como essas variáveis são constantes, podem ir pro arquivo CustomPlayer.h.
| return; | ||
| if (!frame->has_ball()) | ||
| return; | ||
| auto&& pos_ball = frame->ball(); |
There was a problem hiding this comment.
Usar um mesmo padrão pra nomes de variáveis. Nesse caso, a variável passaria a ser posBall
| QPointF initialPosition(2000, 0); | ||
| int tolerance = 150; | ||
| maxdis = 9000000; | ||
| if ((pos_ball.distTo(targetPosition)) > tolerance) { |
There was a problem hiding this comment.
Colocar nomes descritivos para as condicionais facilita entender o que tá acontecendo:
| if ((pos_ball.distTo(targetPosition)) > tolerance) { | |
| bool isBallOnTargetPosition = (pos_ball.distTo(targetPosition)) <= tolerance; | |
| if (!isBallOnTargetPosition) { |
There was a problem hiding this comment.
Esse comentário também se aplica às outras condicionais
| return; | ||
|
|
||
| if ((pos_ball - targetPosition).manhattanLength() > tolerance) { | ||
| if (robot->distTo(pos_ball) > 150) { |
There was a problem hiding this comment.
Substituir o 150 por uma constante
| class CustomPlayer : public Processing { | ||
| int maxdis = 9000000; | ||
| int idrobot = -1; | ||
| bool ball_placement = true; |
There was a problem hiding this comment.
Essa variável não é usada, então pode ser removida
| int maxdis = 9000000; | ||
| int idrobot = -1; |
There was a problem hiding this comment.
| int maxdis = 9000000; | |
| int idrobot = -1; | |
| int maxDis = 9000000; | |
| int idRobot = -1; |
No description provided.