-
Notifications
You must be signed in to change notification settings - Fork 10
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
base: master
Are you sure you want to change the base?
Conversation
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.
Thx for the PR and the detailed explanation 👍 I've added some comments inline.
src/logplayer/player.cpp
Outdated
} | ||
|
||
else | ||
{ | ||
std::cout << "Error unsupported message type found in log file!" << std::endl; |
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.
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.
src/logplayer/player.cpp
Outdated
m_vision->writeData(packet->data); | ||
} | ||
else if (packet->type == MESSAGE_SSL_VISION_TRACKER_2020) | ||
{ | ||
m_vision->writeData(packet->data); |
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 wrong. Those packages should go to a different port. See https://ssl.robocup.org/league-software/#standard-network-parameters
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.
thank you! It was my lack of study ...
src/logplayer/player.cpp
Outdated
} | ||
else if (packet->type == MESSAGE_SSL_INDEX_2021) | ||
{ | ||
m_index->writeData(packet->data); |
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 not useful. The index should not be send to the network. It is only useful for reading the file.
src/common/format/message_type.h
Outdated
@@ -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, |
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 are spaces missing ;)
Thank you very much for your patience. There might still be some areas that need improvement, but how does this look to you? |
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.
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; |
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.
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) |
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 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; |
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.
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).
changes
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/
Before modification (https://github.com/user-attachments/assets/69831c6d-bad6-402b-b125-c289bc98c82c)
After modification (https://github.com/user-attachments/assets/63ff7d60-add9-4c29-ae72-33de3fb9184b)
Video of receiving MESSAGE_SSL_VISION_TRACKER_2020
https://github.com/user-attachments/assets/a55ecf6c-cd85-4218-9226-317a84fb1d7c
Video of receiving MESSAGE_SSL_INDEX_2021
https://github.com/user-attachments/assets/9a590e88-814e-45a4-80e9-918b801a5968