Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support new message types #12

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

tomoakiwakawaka
Copy link

@tomoakiwakawaka tomoakiwakawaka commented Sep 19, 2024

changes

  • src/common/format/message_type.h
  • src/logplayer/player.cpp 158-166
  • src/logplayer/player.h

The addition of MESSAGE_SSL_VISION_TRACKER_2020 and MESSAGE_SSL_INDEX_2021 is based on https://ssl.robocup.org/game-logs/

A new pointer called m_index was created with reference to the above web page and the player.h file. The log file has a message of type MESSAGE_SSL_INDEX_2021 at the end, so I created m_index to receive the last message.

Warnings that appeared before the modification are no longer present after the modification.
In the video of receiving the MESSAGE_SSL_VISION_TRACKER_2020, the
5 representing MESSAGE_SSL_VISION_TRACKER_2020 is displayed.

In the video showing the receipt of MESSAGE_SSL_INDEX_2021, the
6 representing MESSAGE_SSL_INDEX_2021 is displayed.
cf. https://ssl.robocup.org/game-logs/

Copy link
Member

@g3force g3force left a comment

Choose a reason for hiding this comment

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

Thx for the PR and the detailed explanation 👍 I've added some comments inline.

}

else
{
std::cout << "Error unsupported message type found in log file!" << std::endl;
Copy link
Member

Choose a reason for hiding this comment

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

Could you also improve this message?

  • It should print the unknown message type.
  • It would be good if this is only printed once per type.
  • I'd call it a warning, not an error.

m_vision->writeData(packet->data);
}
else if (packet->type == MESSAGE_SSL_VISION_TRACKER_2020)
{
m_vision->writeData(packet->data);
Copy link
Member

Choose a reason for hiding this comment

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

This is wrong. Those packages should go to a different port. See https://ssl.robocup.org/league-software/#standard-network-parameters

Copy link
Author

Choose a reason for hiding this comment

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

thank you! It was my lack of study ...

}
else if (packet->type == MESSAGE_SSL_INDEX_2021)
{
m_index->writeData(packet->data);
Copy link
Member

Choose a reason for hiding this comment

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

This is not useful. The index should not be send to the network. It is only useful for reading the file.

@@ -18,7 +18,9 @@ enum MessageType
MESSAGE_UNKNOWN = 1,
MESSAGE_SSL_VISION_2010 = 2,
MESSAGE_SSL_REFBOX_2013 = 3,
MESSAGE_SSL_VISION_2014 = 4
MESSAGE_SSL_VISION_2014 = 4,
MESSAGE_SSL_VISION_TRACKER_2020=5,
Copy link
Member

Choose a reason for hiding this comment

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

There are spaces missing ;)

@tomoakiwakawaka
Copy link
Author

Thank you very much for your patience. There might still be some areas that need improvement, but how does this look to you?

Copy link
Member

@g3force g3force left a comment

Choose a reason for hiding this comment

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

Could you undo all that formatting? Better keep the existing format style and change as few lines as possible to make the diff easier to review.

@@ -51,8 +51,10 @@ class Player : public QThread
Network* m_referee;
Network* m_vision;
Network* m_legacyVision;
Network* m_index;
Copy link
Member

Choose a reason for hiding this comment

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

index is not sent via network. Have you mixed things up? Shouldn't there be a Network instance for visionTracker? 🤔

}
else if (packet->type == MESSAGE_SSL_VISION_TRACKER_2020)
{
if (receive_VT)
Copy link
Member

Choose a reason for hiding this comment

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

this should be replaced with sth like m_visionTracker->writeData(packet->data), I'd say.

else
{
std::cout << packet->type <<std::endl;
std::cout << "Warning unsupported message type found in log file!" << std::endl;
Copy link
Member

Choose a reason for hiding this comment

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

Better move those two lines into one. Like "... in the log file: " << packet->type <<stdl::endl.

And it would nicer to print it on stderr (std::cerr).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants