add combined sender+receiver class with single socket#65
Open
ottojo wants to merge 1 commit intoautowarefoundation:mainfrom
Open
add combined sender+receiver class with single socket#65ottojo wants to merge 1 commit intoautowarefoundation:mainfrom
ottojo wants to merge 1 commit intoautowarefoundation:mainfrom
Conversation
Signed-off-by: Jonas Otto <jonas.otto@ipa.fraunhofer.de>
86ebddc to
7b378f3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.