Comments (8)
In ROS 2, @tfoote and I talked about this issue and we came up with a more flexible option of a "custom time source" which could drive ROS Time. The default would basically implement ROS Time as it works in ROS 1, which is to subscribe to /clock
and return time based on the values received on that topic. The reason I bring this up is this "custom time source" provides for pre and post update callbacks which can be called each time the custom time source updates the time, see:
https://github.com/ros2/rcl/blob/master/rcl/include/rcl/time.h#L59-L60
For the ROS Time implementation in ROS 1 these callbacks would be called after receiving a message on /clock
but before and after setting ros::Time::now()
to the value received. These callbacks could be used to detect backward jumps in time at the instance that it occurs and then provide a callback to the user when it does happen. This is only possible because ROS Time based on the /clock
topic is quantized rather than continuous. So this wouldn't help with jumps in system time, unless you could get a callback from the system when this occurs (not sure if you can).
It would be a more intrusive change to ROS, but if you were to implement a method like ros::Time::register_callback_on_sim_time_jump(callback)
which, after being set up, would call the given callback when time goes backward because of data from /clock
. This might help bond out on this issue, because option 1 becomes more viable (at least imo) as it eliminates (or at least mitigates) the con about sim time.
from bond_core.
Regarding Option 1:
I don't quite understand why it would not work with sim time....
If I see it correctly then bond always uses WallDurations and so even when running with sim time the bond timeouts are tied to WallTime (which makes total sense to me, as I don't see a reason to also pause the bond heartbeats when pausing sim time).
So it looks like we could replace WallDuration with a new "MonotonicDuration" which would work in the same way, except of not being susceptible to time jumps.
from bond_core.
I quickly added a MonotonicTime class and used that in bond, which IMHO should fix the issue...
See #17 and ros/roscpp_core#55
Let me know what you think about such an approach...
from bond_core.
I didn't look into the details too much, so not exactly sure what the bond message is actually used for and if we would need to also add a MonotonicTimer for publishing those...
from bond_core.
added a MonotonicTimer in ros/ros_comm#1003
from bond_core.
That's true, I don't guess the bond messages need to stop or slow down with ROS time. Using a monotonic clock sounds fine to me, especially if bond is already using wall time (system time).
from bond_core.
@mikaelarguedas maybe you can test #18 as well, works nicely here...
from bond_core.
this has been fixed for lunar in #18, if the underlying stedy timer feature is backported to other distributions I will backport #18
from bond_core.
Related Issues (20)
- build error HOT 1
- bondcpp: UUID_INCLUDE_DIRS missing HOT 4
- Creation of new banch as ros2-devel HOT 5
- Static linking to uuid which might be GPL? HOT 2
- Bond::setCallbackQueue only sets the callback queue for Bond::bondStatusCB thread
- 'BondSM' defined as a struct here but previously declared as a class HOT 2
- bondcpp compiling problems on macOS Catalina and c-lang 11 HOT 3
- Noetic release HOT 4
- Release Bond for ROS2 Dashing / Foxy HOT 10
- [ROS2] Failing heartbeat timeouts HOT 9
- [Both ROS1 and ROS2] Bond Async Bringup Exception HOT 2
- Buiding the pakcage "ros2" branch fails with "‘from_nanoseconds’ is not a member of ‘rclcpp::Duration’" HOT 1
- Colcon Build Branch ROS 2 Not working HOT 1
- [ROS2] bondcpp does not export symbols on Windows
- [ROS2] Bondcpp statemap::TransitionUndefinedException HOT 3
- "AwaitSisterDeath"? HOT 1
- [Feature] Use DDS Liveliness Qos instead of periodic messages
- Fails to build with VS2019 - HOT 1
- bond::Bond constructs TimerBase in its destructor, making it difficult to destruct after rclcpp::shutdown HOT 2
- Fail to process all bond callbacks in bondpy HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bond_core.