ros / rosconsole

17 stars 61 forks source link

Bug: First few messages not shown when in simulation #18

Closed bochen87 closed 4 years ago

bochen87 commented 6 years ago

I noticed a bug that the first few messages are not shown when throttling messages and running in simulation mode (i.e. Gazebo).

Problem is here: https://github.com/ros/rosconsole/blob/melodic-devel/include/ros/console.h#L446

It will never show the time is less than last_hit + period , which can happen when in simulation and time starts at 0

dirk-thomas commented 6 years ago

This probably required a different initialization value which also needs to be checked for explicitly. Please consider to provide a pull request to support this case.

bochen87 commented 6 years ago

What if last_hit is initialized with -inf instead of 0?

dirk-thomas commented 6 years ago

-inf sounds "problematic" to me since the math operations like + won't do anything "reasonable" and you would need to check for -inf explicitly everywhere. Maybe initializing it with the minimum double value is easier and requires less changes / checks?

bochen87 commented 6 years ago

Makes sense, so maybe then std::numeric_limits<double>::min()

dirk-thomas commented 4 years ago

Closing due to inactivity.