Skip to content

Conversation

@ottojo
Copy link

@ottojo ottojo commented Oct 17, 2025

Hi! I find the socketcan wrapper classes very useful, the design of seperate receiver and sender however has one limitation: Since each has its own socket, it becomes difficult to ignore messages sent by the same ros node. #45 disables loopback by default, but that stops the use-case of running the same node twice and have it communicate (for testing purposes) via a (v)can interface.

Attached is an implementation to try it out, and it works as expected: The transceiver does not receive messages it has sent, but another instance of the same ros node receives its messages.

I wanted to ask if something like this would be considered for inclusion, before looking at implementing it properly (it's just the bare minimum sender and receiver copy-pasted together right now). I would imagine at least moving some implementation details to socket_can_common, or maybe it would be possible to just derive the Transceiver class from Sender and Receiver.

See also the linux kernel docs for CAN_RAW_LOOPBACK and CAN_RAW_RECV_OWN_MSGS.

@ottojo ottojo marked this pull request as draft October 17, 2025 15:04
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.

1 participant