-
Notifications
You must be signed in to change notification settings - Fork 409
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
Reading has_realtime fails sometimes #306
Comments
Using the stream's Initializing the variable and checking the ifstream might be a good first start to address the issue you mentioned. Something like std::ifstream realtime_file("/sys/kernel/realtime", std::ios::in);
bool has_realtime = false;
if (realtime_file.good())
{
realtime_file >> has_realtime;
} @axelschroth could you maybe test whether this works for you? |
Following works for me using
|
Reading this from system may end up in undefined behavior. (UniversalRobots#306)
Reading this from system may end up in undefined behavior. (UniversalRobots#306)
Sorry for the confusion above. I created a PR. |
Reading this from system may end up in undefined behavior. (#306)
This should have been fixed with #311 -> closing this issue. |
I think this line should be changed from
Universal_Robots_ROS_Driver/ur_robot_driver/src/hardware_interface_node.cpp
Line 60 in 783b1d1
to
bool has_realtime = false;
I noticed that if I modify some unrelated code without initializing
has_realtime
, printinghas_realtime
sometimes outputs a number like e.g. 168 or 66. I suspect the ifstream to do nothing if/sys/kernel/realtime
does not exist.Any thoughts on that strange behavior?
The text was updated successfully, but these errors were encountered: