-
Notifications
You must be signed in to change notification settings - Fork 47
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
Recording of robotics nodes #517
Conversation
7864390
to
e9f160f
Compare
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.
Looks good so far. I have left some comments.
From what I can see, the main things left to implement are:
- serializing node state
- writing frames to a file
Did I miss something? I can't find the |
There is no |
As you are implementing |
Not without further changes, no. |
Sorry, my previous statement was phrased in a confusing manner. I was expecting further necessary changes. The question was meant in general. We introduce a new (very strong) requirement to nodes: implementing To realize such a thing, I imagine the generated framework to expose not only databases containing the main and additional outputs, but also the list of nodes to communication. I think they do not necessarily need to exist in a separate crate for that, do they? Maybe we should discuss further details after the upcoming dev meeting or at another occasion. |
Yes, introducing this trait bound certainly opens up the possibility of exposing all nodes state via communication. |
Sorry, please ignore outdated the description... 😅 |
In theory yes but out-of-scope for this PR. |
If I would implement it, I would build a separate Communication infrastructure and don't rely on e.g. additional outputs. But this needs more design work. |
Exactly 100% what Schmiddy wrote above. But I think we don't need a trait, Code generation should be enough. But it needs more thinking. |
The current approach has been tested on a real NAO. Here are the findings and conclusions: Size of recorded data1 - 3 GiB data is written per minute. 10 minutes of one half time would be 10 - 30 GiB. The NAO has 32 GiB internal memory. USB sticks can be used for external storage, our usual sticks have 32 GiB storage. That means we might run into storage size problems during games. One possibility is to optimize the amount of data further but it is unlikely that this will reduce data usage by orders of magnitude. Only some cyclers accumulate a lot of data (vision) and the serialization only has 30 % overhead compared to the raw data. Compression is unlikely to help because this is mostly image data which has high entropy and is hard to compress losslessy. Another possibility is to reduce the frequency of recorded frames, maybe even for some cyclers while recording other cyclers at full frequency. Execution time impactThe biggest impact has vision recording with 20 ms Bincode serialization and writing to |
Some ideas to support different frequencies and dynamic recording: Dynamic recording may be triggered by different parties. For example a trigger might be the current game state (robotics domain) or someone requesting a recording from Twix (debug tooling, framework domain via communication) or it has been requested from the deployed configuration (framework domain via communication). Communication and the hardware interface will both provide a quadruple state: Force to not record, force to record, intend to record, intend to not record. This is also the order of descending precendence. Communication will provide a state for each cycler enabling fine-grained control of the recording. The hardware interface may just provide a single state for the moment, but this can be extended later to one for each cycler. If the cycler derives from all states that a recording of the current frame should happen, it records everything and sends the data to its instance of a channel to communication. Communication will receive the data and store it in the file system. We might think about, reducing computation overhead in the cyclers even more by moving the serialization into communication. Communication will also provide recording frequency information, for example whether every frame should be recorded, none at all or at which frequency. One approach is to have this fixed over the whole process runtime by storing this information in e.g. the Communication will serve an additional API endpoint for recording s.t. clients are able to control the recording state and maybe also the frequency. |
4f7a719
to
2b3d884
Compare
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.
only minor remarks. This looks good to me in general. Let's see a test game before merging this?
Introduced Changes
PersistentState
is renamed toCyclerState
because it stores state in a cyclerhardware.json
is split intoframework.json
andhardware.json
framework.json
ToDo / Known Issues
Ideas for Next Iterations (Not This PR)
launchHULK
log files and recording file namesHow to Test
Deploy to a NAO, check that the cyclers are enabled for recording. When the NAO is in playing primary state, the NAO records to
logs
directory in Bincode format.