CommonplaceRobotics / iRC_ROS

ROS2 packages for the igus Robot Control
Apache License 2.0
15 stars 7 forks source link

Can the CAN input queues grow too large? #8

Closed cpr-fer closed 1 year ago

cpr-fer commented 1 year ago

The CanInterface contains a message buffer map, which provides a queue of incoming messages for each CAN id. If the ROS host lags behind in processing the queue the messages will take longer to be processed then might be acceptable. Should this throw an error, e.g. limit the size for each queue and throw on an overflow? Just discarding messages without processing them could potentially result in missing crucial status information.

cpr-fer commented 1 year ago

I think for now it should be sufficient to print a warning if too many messages are already stored in a can id's buffer, with the possibility of throwing an error if it gets way too many. I am unsure how to resolve this for CAN ids that dont belong to any modules, maybe then it would be okay to discard old messages for an overflowing buffer or limit the handled CAN IDs to those with an active listener attached to them.