Skip to content

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

Open
akashmod wants to merge 2 commits intoros-industrial:melodic-develfrom
akashmod:melodic-devel
Open

To resolve the socketcan interface dying due to can errors and failing to recover#474
akashmod wants to merge 2 commits intoros-industrial:melodic-develfrom
akashmod:melodic-devel

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.

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