Skip to content

DTSW-7564-Add-Duckietown-Shell-billboards-to-the-Duckiematrix#126

Merged
liammcalpineduckietown merged 1 commit intomainfrom
DTSW-7564-Add-Duckietown-Shell-billboards-to-the-Duckiematrix
Jan 28, 2026
Merged

DTSW-7564-Add-Duckietown-Shell-billboards-to-the-Duckiematrix#126
liammcalpineduckietown merged 1 commit intomainfrom
DTSW-7564-Add-Duckietown-Shell-billboards-to-the-Duckiematrix

Conversation

@liammcalpineduckietown
Copy link
Contributor

@liammcalpineduckietown liammcalpineduckietown commented Jan 15, 2026

This pull request refactors the way billboards are selected and displayed in the dt_shell shell. The main improvement is separating the logic for retrieving billboard names from the logic for selecting and displaying a billboard, making the code more modular and easier to maintain. Additionally, the process of selecting a billboard is now more explicit and relies on a weighted random selection based on priority.

Billboard selection and display refactor:

  • Split the billboard retrieval logic into two static methods: get_billboard_names, which returns a weighted list of billboard names based on priority, and get_billboard, which selects a random billboard from this list and returns its content. [1] [2]
  • Updated the __init__ method to use the new methods for fetching billboard names and selecting a billboard, improving clarity and separation of concerns.
  • Changed the return value for get_billboard_names to return an empty list when no billboards are available, instead of None, standardizing the output type.

@Tuxliri
Copy link
Contributor

Tuxliri commented Jan 26, 2026

@liammcalpineduckietown how are the additional keys handled for existing databases?

@liammcalpineduckietown liammcalpineduckietown force-pushed the DTSW-7564-Add-Duckietown-Shell-billboards-to-the-Duckiematrix branch from 3fa75e7 to 7f1dc08 Compare January 26, 2026 07:31
@liammcalpineduckietown
Copy link
Contributor Author

@liammcalpineduckietown how are the additional keys handled for existing databases?

They are handled by the Duckiematrix Renderer using the string.IsNullOrEmpty method: https://github.com/duckietown/duckiematrix/pull/12/changes/8c2c53fdef4eed4ce2113364af3c78627a65a91b

@Tuxliri
Copy link
Contributor

Tuxliri commented Jan 26, 2026

@liammcalpineduckietown how are the additional keys handled for existing databases?

They are handled by the Duckiematrix Renderer using the string.IsNullOrEmpty method: https://github.com/duckietown/duckiematrix/pull/12/changes/8c2c53fdef4eed4ce2113364af3c78627a65a91b

Yeah I would implement a earning to avoid it failing silently

@liammcalpineduckietown
Copy link
Contributor Author

@liammcalpineduckietown how are the additional keys handled for existing databases?

They are handled by the Duckiematrix Renderer using the string.IsNullOrEmpty method: duckietown/duckiematrix@8c2c53f

Yeah I would implement a earning to avoid it failing silently

Not every billboard needs graphics or an end time.

@Tuxliri
Copy link
Contributor

Tuxliri commented Jan 27, 2026

@liammcalpineduckietown how are the additional keys handled for existing databases?

They are handled by the Duckiematrix Renderer using the string.IsNullOrEmpty method: duckietown/duckiematrix@8c2c53f

Yeah I would implement a earning to avoid it failing silently

Not every billboard needs graphics or an end time.

Yeah good point, I'm approving then.

@liammcalpineduckietown liammcalpineduckietown merged commit e18d55b into main Jan 28, 2026
2 of 3 checks passed
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

Comments