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

To resolve the socketcan interface dying due to can errors and failing to recover #474

Open
wants to merge 2 commits into
base: melodic-devel
Choose a base branch
from

Conversation

akashmod
Copy link

@akashmod akashmod commented Oct 29, 2022

This is to solve issue #468. A ros timer is started to check the driver state after every specified duration and to reinitialize the driver for the node if the driver has recovered.

@@ -55,6 +55,7 @@ namespace socketcan_bridge
can_topic_ = nh->advertise<can_msgs::Frame>("received_messages",
nh_param->param("received_messages_queue_size", 10));
driver_ = driver;
timer = nh->createTimer(ros::Duration(0.1), std::bind(&SocketCANToTopic::timerCallback, this, std::placeholders::_1));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a polling approach. We should at least be able to configure the duration via for example a ROS parameter. Also there should be an option to disable this behaviour.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps by treating a zero duration as disabled. Zero is a common exception used for this and save a new parameter.

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.

3 participants