-
Notifications
You must be signed in to change notification settings - Fork 245
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
Sort info output by topic name #1804
base: rolling
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.
it would be nice if format_service_with_type
has the same sorting interface aligned with topics.
this PR is failing to build with the following error and DCO is missing. could you address them?
07:59:08 /tmp/ws/src/rosbag2/rosbag2_py/src/rosbag2_py/format_bag_metadata.cpp:144:8: error: ‘iota’ is not a member of ‘std’
07:59:08 144 | std::iota(sorted_idx.begin(), sorted_idx.end(), 0);
07:59:08 | ^~~~
07:59:08 gmake[2]: *** [CMakeFiles/_storage.dir/build.make:90: CMakeFiles/_storage.dir/src/rosbag2_py/format_bag_metadata.cpp.o] Error 1
07:59:08 gmake[1]: *** [CMakeFiles/Makefile2:284: CMakeFiles/_storage.dir/all] Error 2
07:59:08 gmake: *** [Makefile:146: all] Error 2
@@ -115,7 +115,8 @@ void format_topics_with_type( | |||
const std::unordered_map<std::string, uint64_t> & messages_size, | |||
bool verbose, | |||
std::stringstream & info_stream, | |||
int indentation_spaces) | |||
int indentation_spaces, | |||
std::string sort_method = "name") |
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.
as you suggested, this option would be nice to configure via CLI so that user can choose the sorting method as they like. and test would be ideal
{ | ||
return topics[i1].message_count < topics[i2].message_count; | ||
} | ||
if (sort_method == "serialization_format") |
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.
I am not sure about this use case. most likely the serialization format could be the same in the single bag file which is cdr
?
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.
I was also not sure, if there even is the possibility to have different serialization formats in a bag file. As it was available for output I included it here as option, but can drop it if it is not neccessary
Signed-off-by: Soenke Prophet <[email protected]>
657745f
to
8645046
Compare
Signed-off-by: Soenke Prophet <[email protected]>
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.
@Sanoronas Thank you for your contribution.
I agree with @fujitatomoya that sorting by the serialization format is unlikely to be useful. Because we are not supporting different serialization formats during recording by design.
I can only envision a possibility to have a different serilization formats if someone will convert the already recorded bag or record with modifyied rosbag2 recorder or using some different tool for recording.
Therefore I think it makes sense to have options for sorting:
- By topic or service name.
- By topic or service type
- By topic or service messages count
Could you please use C++ enum values for the sorting method?
Also, It will be appreciated if you would add the same sorting algorithm for the services in the format_service_with_type(..)
function located in the same file.
Closes #1797