We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a86b63 commit dfd25f6Copy full SHA for dfd25f6
1 file changed
docs/10-prerequisities/25-ros2/50-ros1-ros2-patterns/cpp_working_with_time.md
@@ -10,15 +10,31 @@ description: Working with ROS Time in ROS2
10
11
## Comparing times
12
13
-## Rate
+## rclcpp::Rate
14
15
-## Duration
+## rclcpp::Duration
16
17
Duration object storing an interal of `1 second`:
18
```cpp
19
rclcpp::Duration(std::chrono::duration<double>(1.0))
20
```
21
22
+## rclcpp::Time
23
+
24
+* creating the Time object out of a floating point time:
25
+```cpp
26
+rclcpp::Duration(std::chrono::duration<double>(1.0))
27
+```
28
29
## Sleeping
30
31
+What was in ROS1 done as:
32
33
+ros::Duration(duration).sleep();
34
35
+is in ROS2 done as:
36
37
+clock_->sleep_for(std::chrono::duration<double>(duration));
38
39
40
## Simulation time
0 commit comments