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

Split network wrapper logic from CAN broker device #266

Open
PeterBowman opened this issue Aug 27, 2023 · 0 comments
Open

Split network wrapper logic from CAN broker device #266

PeterBowman opened this issue Aug 27, 2023 · 0 comments

Comments

@PeterBowman
Copy link
Member

Currently, CanBusControlBoard (which will be renamed to CanBusBroker in #263) plays the role of the YARP-CAN broker that maps a list of physical CAN nodes to motor joints, and also opens several ports exposing CAN-related channels, namely /sdo:s, /send:i, /dump:o and /load:o (#160). Also, there is /sync:o for the synchronization signal. This double role might violate the SRP. Besides, it has forced us to combine configuration options related to two different entities (CAN bus device and CAN thread broker) into a single bus config file.

Idea: split the port logic part into a separate device (or devices) wrapping the main one (CanBusControlBoard/CanBusBroker). This is somewhat contrary to my original intentions at #226. As I stated then, it is possible to map several brokers (OneCanBusOneWrapper at that time) locally via ControlBoardRemapper instances into separate limbs (example using only one mapper, but could be trivially extended to many: teo-self-presentation). The current solution was implemented since it was quite easy to combine all channels in only one, omnibus device, and it probably spared some configuration efforts. Today, however, I am more prone to using as many simpler devices (including mappers) as needed and splitting responsibilities.

Main caveat: I really want to preserve the synchronization feature across CAN channels, and this is the strongest selling point of the current broker device. Maybe an intermediate "mapper" device could be arranged to govern the main synchronization thread. Then, another newly introduced, NWS-like device, say CanBusServer, would expose the aforementioned four CAN-related ports, perhaps even the sync one, too.

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

No branches or pull requests

1 participant