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

go/cli: mcap info show channels count #1051

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

go/cli: mcap info show channels count #1051

wants to merge 1 commit into from

Conversation

pezy
Copy link
Contributor

@pezy pezy commented Jan 11, 2024

Public-Facing Changes

show channels count like channels(45): in mcap info print.

Description

The channels list printed by mcap info might have discontinuous sequence numbers due to certain reasons (for example, if one of the topics in the original recorded data has zero messages, then the mcap generated after using mcap filter will exhibit this). Therefore, it's important to visually see the number of channels.

@wkalt
Copy link
Contributor

wkalt commented Apr 22, 2024

this seems nice to me but the count formatting is inconsistent with the way other counts are displayed. Here is the existing info:

library:   mcap go v0.4.0                                              
profile:   ros1                                                        
messages:  1606                                                        
duration:  7.780758504s                                                
start:     2017-03-21T19:26:20.103843113-07:00 (1490149580.103843113)  
end:       2017-03-21T19:26:27.884601617-07:00 (1490149587.884601617)  
compression:
        zstd: [314/314 chunks] [119.10 MiB/58.57 MiB (50.82%)] [7.53 MiB/sec] 
channels:
        (0) /diagnostics              52 msgs (6.68 Hz)    : diagnostic_msgs/DiagnosticArray [ros1msg]  
        (1) /image_color/compressed  234 msgs (30.07 Hz)   : sensor_msgs/CompressedImage [ros1msg]      
        (2) /tf                      774 msgs (99.48 Hz)   : tf2_msgs/TFMessage [ros1msg]               
        (3) /radar/points            156 msgs (20.05 Hz)   : sensor_msgs/PointCloud2 [ros1msg]          
        (4) /radar/range             156 msgs (20.05 Hz)   : sensor_msgs/Range [ros1msg]                
        (5) /radar/tracks            156 msgs (20.05 Hz)   : radar_driver/RadarTracks [ros1msg]         
        (6) /velodyne_points          78 msgs (10.02 Hz)   : sensor_msgs/PointCloud2 [ros1msg]          
attachments: 0
metadata: 0

what about instead adding a "channels: 7" above where "attachments: 0" is printed?

@defunctzombie
Copy link
Contributor

@james-rms please take a look

@@ -167,6 +167,7 @@ func printInfo(w io.Writer, info *mcap.Info) error {
rows = append(rows, row)
}
utils.FormatTable(buf, rows)
fmt.Fprintf("channels: %d\n", len(chanIDs))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
fmt.Fprintf("channels: %d\n", len(chanIDs))
fmt.Fprintf(buf, "channels: %d\n", len(chanIDs))

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

Successfully merging this pull request may close these issues.

None yet

4 participants