Comments (6)
What you mention makes sense 👍. I hope that this issue's info can be useful for future travelers of the ROS1 code, or authors of ROS2.
Thank you for the feedback @MatthijsBurgh 💪
from roscpp_core.
When running at such a high frequency of 400Hz, I would think WallDuration/WallTime is better.
from roscpp_core.
Hi @MatthijsBurgh,
I have tried your suggestion. However, running in WallTime means that any high-rate module will not listen to the updates of ROS Time. Thus, if you slow down, speed up, or pause
- Replaying of a ROS bag,
- Simulation,
The nodes' notion of time will be different from that of the sensor and actuator clocks, leading to ambiguous results (e.g. if simulation is running slower, should a filter propagate as usual, or wait for the next clock tick?). Furthermore, if you have Time-based events, they will be triggered at the wrong instant. Thu, Breaking away into a different time domain can increase the number of issues, but not solve the problem at the root.
Practical example
Imagine that you have a swarm-drone system that relies on accurate, time-sensitive motion planning. If you want to test this system in simulation, with WallTime, you need to ensure that your simulator will run at exactly the same rate as your host PC Clock (1.0x, uniform, constant), otherwise your whole motion planning algorithm will have to 'fight' uncertain timing (which is a problem that you can solve in the real world with a GPS)
(Image source: https://gfycat.com/handmadecolossaldrongo-hotcoffee9520)
Hence, that's why my suggestion goes into the direction of making the minimum wait time an optional argument.
WDYT?
Best,
Yoshua
from roscpp_core.
I agree with you. The WallTime doesn't slow down. I expected your process to be time critical, because of the high frequency.
I think your case with such a high frequency, but want to sync with the ROS time, is very rare. And as ROS1 is going to the end of its life, I don't expect the maintainers to change it.
from roscpp_core.
I can imagine a PR along these lines could get merged: compare the intended sleep duration with the 1 ms
sleep, and if one tenth of the intended duration is shorter than the 1 ms
, shorten the wallsleep to this one tenth. This should not affect most normal use-cases, but should help your cause.
from roscpp_core.
@YoshuaNava #137 should help with this. Could you verify?
from roscpp_core.
Related Issues (20)
- ros::TimeBase: undefined behaviour for large doubles HOT 2
- Compiling ros/time.h in x64 Visual Studio project results in incorrect selection between sys/time.h and sys/timeb.h HOT 5
- command-line error:invalid macro definition: = HOT 4
- -Wconversion warnings in melodic HOT 9
- Helper for constructing time in mili/microseconds? HOT 6
- Integrating with OSS-Fuzz HOT 4
- ros::Time and ros::Duration don't respect TIME_MAX and DURATION_MAX in arethmetic operators HOT 3
- Compile errors with gcc-10 and -std=gnu++2a option HOT 2
- Conversion from size_t to uint32_t in vector serialization HOT 3
- ros::Rate::sleep is not working as expected when the rate is larger than the publish rate of /clock HOT 2
- LICENSE for v0.6.11 HOT 2
- serialization of service response message when response was failed HOT 6
- ros serialization get wrong message size when compile on arm64 with gcc -O3 HOT 4
- inclusion of unecessary boost from ros console and ros time HOT 2
- Buildroot: when building cpp_common: `CMake Error at FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find Boost (missing: thread) (found version "1.80.0")` HOT 2
- improper implementation of ros::Time::useSystemTime() HOT 3
- Durations not printing out properly HOT 5
- Misaligned address for type 'double', in serialization.h, causing runtime error. HOT 7
- Possible data races in the turtlesim node, detected by ThreadSanitizer HOT 1
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 roscpp_core.