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

Feature request: disable loopback #45

Open
Timple opened this issue Apr 11, 2024 · 3 comments · May be fixed by #57
Open

Feature request: disable loopback #45

Timple opened this issue Apr 11, 2024 · 3 comments · May be fixed by #57

Comments

@Timple
Copy link
Contributor

Timple commented Apr 11, 2024

In ros1 we used to use the socketcan bridge to convert the canbusses to can_msgs/Frame ros messages. All messages we put on /to_canbus were never on the /from_canbus topic.

However, for ROS2 this package is recommended it seems.

Now we do see all messages we send on the /to_canbus back on the /from_canbus topic. Not only led this to (solvable) issues, but this actually almost doubles the frequency of the /from_canbus topic. And (thus) doubles the handling effort on the subscribing nodes as these messages need to be discarded.

Is there a way to get the 'old' behavior back?

@Timple
Copy link
Contributor Author

Timple commented Apr 15, 2024

This could be implemented by adding

// Check if it's a TX frame
if (frame.can_id & (CAN_ERR_TX_TIMEOUT | CAN_ERR_CRTL_TX_WARNING | CAN_ERR_CRTL_TX_PASSIVE))
{
  // This is a TX frame, ignore it
  continue;
}

After the read here: https://github.com/autowarefoundation/ros2_socketcan/blob/d25a55528eb7b27ab3c22c1b888a7276ae4af6f9/ros2_socketcan/src/socket_can_receiver.cpp#L140C48-L140C53

Would such a PR be accepted if not made optional? As I can't think of a usecase where anyone wants this. As they also could subscribe to the /to_can_bus_topic topic.

@tonynajjar
Copy link

I'm also interested by this!

@JWhitleyWork
Copy link
Collaborator

I'm working on a more detailed implementation of this feature.

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 a pull request may close this issue.

3 participants