Ask Your Question
2

Does ROS_INFO break realtime?

asked 2018-09-05 09:56:59 -0600

updated 2018-09-06 10:56:37 -0600

Is the realtime lost if I use ROS_INFO inside a ros_control controller update method or inside a ros_control hardware interface write/read method?

edit: this question may have different answers according with the real time environment you are using, for instance (Xenomai or RT-Preempt)

edit retag flag offensive close merge delete

Comments

Btw: this is not specific to ros_control. Any deterministic context in which `ROS_* log macros are used would be affected similarly.

gvdhoorn gravatar imagegvdhoorn ( 2018-09-05 10:21:32 -0600 )edit

Developing controllers or hardware nodes via ros_control is some kind of "standard approach" to interface hardware and develop your control algorithms.

I assumed here that in general for any controller is desirable to be real time.

Pablo Iñigo Blasco gravatar imagePablo Iñigo Blasco ( 2018-09-05 12:04:25 -0600 )edit

I meant to say with my comment that even without ros_control, but in a general situation where deterministic execution is desired, using ROS_INFO(..) or any of the other variants will probably have exactly the same effect.

ros_control is not special.

gvdhoorn gravatar imagegvdhoorn ( 2018-09-05 12:57:52 -0600 )edit

We are in agreement, ros_control is not special.

Pablo Iñigo Blasco gravatar imagePablo Iñigo Blasco ( 2018-09-09 05:52:33 -0600 )edit

1 Answer

Sort by » oldest newest most voted
4

answered 2018-09-05 10:01:01 -0600

gvdhoorn gravatar image

updated 2018-09-05 10:12:41 -0600

Is the realtime lost if I use ROS_INFO inside a ros_control controller update method or inside a ros_control hardware interface write/read method?

yes. It depends / probably.

In the end, ROS_INFO(..) gets expanded to ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER(filter, ...) which calls ::ros::console::print(..) which in the end makes use of either printf(..), fprintf(..) or a function in that group and/or calls upon one of the backends (glog, log4cxx) to do the work.

Unless a custom implementation of the printf(..) family is used, calling it typically results in loss of determinism. Xenomai wraps printf(..) and could work-around this. Not sure about RT-PREEMPT.

But apart from that there are multiple places where objects are instantiated and functions in various libraries are called. Those are also a bit suspect.

edit flag offensive delete link more

Comments

Thanks. I guess that the precise question would be. "Can be used ROS_INFO in a realtime controller?" Xenomai: yes RT-PREEMPT: ?? I can edit the question if you agree

Pablo Iñigo Blasco gravatar imagePablo Iñigo Blasco ( 2018-09-05 12:12:49 -0600 )edit

No, I don't think you can conclude: Xenomai, yes.

gvdhoorn gravatar imagegvdhoorn ( 2018-09-05 12:56:52 -0600 )edit

okok. Specifically what i was looking for is if that ROS_INFO would break the realtime. That is the question. I am going to rename the title of the cuestion to "does ROS_INFO break realtime?"

Pablo Iñigo Blasco gravatar imagePablo Iñigo Blasco ( 2018-09-06 10:54:41 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-09-05 09:56:59 -0600

Seen: 111 times

Last updated: Sep 06 '18