Skip to content

Commit a21dff5

Browse files
authored
Fix some set_time calls in markdown/docs/readmes (#9347)
### Related * Part of #8635 * Closes #9122
1 parent 20cec41 commit a21dff5

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

design/blueprint_store.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Data that is a *query* from the recording store references an entity path used s
141141
```python
142142
# Log data
143143
for t in range(100):
144-
rr.set_time('step', t)
144+
rr.set_time('step', sequence=t)
145145
rr.log("world/points", rr.Points3D(points))
146146
147147
# Construct blueprint

docs/content/getting-started/data-in/cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Replace the section that logs the beads with a loop that logs the beads at diffe
291291
for (int t = 0; t < 400; t++) {
292292
auto time = std::chrono::duration<float>(t) * 0.01f;
293293

294-
rec.set_time("stable_time");
294+
rec.set_time_duration("stable_time", time);
295295

296296
for (size_t i = 0; i < lines.size(); ++i) {
297297
float time_offset = time.count() + offsets[i];

docs/content/getting-started/data-in/rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ Let's add our custom timeline:
241241
for i in 0..400 {
242242
let time = i as f32 * 0.01;
243243

244-
rec.set_time("stable_time", duration=time as f64);
244+
rec.set_duration_secs("stable_time", time);
245245

246246
let times = offsets.iter().map(|offset| time + offset).collect_vec();
247247
let (beads, colors): (Vec<_>, Vec<_>) = points_interleaved
@@ -280,7 +280,7 @@ That's because the Rerun Viewer has switched to displaying your custom timeline
280280
To fix this, add this at the beginning of the main function:
281281

282282
```rust
283-
rec.set_time("stable_time", duration=0f64);
283+
rec.set_duration_secs("stable_time", 0.0);
284284
```
285285

286286
<picture>

docs/content/howto/integrations/ros2-nav-turtlebot.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ received.
147147
```python
148148
def some_msg_callback(self, msg: Msg):
149149
time = Time.from_msg(msg.header.stamp)
150-
rr.set_time("ros_time", np.datetime64(time.nanoseconds, "ns"))
150+
rr.set_time("ros_time", timestamp=np.datetime64(time.nanoseconds, "ns"))
151151
```
152152

153153
This timestamp will apply to all subsequent log calls on in this callback (on this thread) until the time is updated
@@ -224,7 +224,7 @@ this as a cue to look up the corresponding transform and log it.
224224
def odom_callback(self, odom: Odometry) -> None:
225225
"""Update transforms when odom is updated."""
226226
time = Time.from_msg(odom.header.stamp)
227-
rr.set_time("ros_time", np.datetime64(time.nanoseconds, "ns"))
227+
rr.set_time("ros_time", timestamp=np.datetime64(time.nanoseconds, "ns"))
228228

229229
# Capture time-series data for the linear and angular velocities
230230
rr.log("odometry/vel", rr.Scalar(odom.twist.twist.linear.x))
@@ -250,7 +250,7 @@ def __init__(self) -> None:
250250
def cam_info_callback(self, info: CameraInfo) -> None:
251251
"""Log a `CameraInfo` with `log_pinhole`."""
252252
time = Time.from_msg(info.header.stamp)
253-
rr.set_time("ros_time", np.datetime64(time.nanoseconds, "ns"))
253+
rr.set_time("ros_time", timestamp=np.datetime64(time.nanoseconds, "ns"))
254254

255255
self.model.fromCameraInfo(info)
256256

@@ -276,7 +276,7 @@ def __init__(self) -> None:
276276
def image_callback(self, img: Image) -> None:
277277
"""Log an `Image` with `log_image` using `cv_bridge`."""
278278
time = Time.from_msg(img.header.stamp)
279-
rr.set_time("ros_time", np.datetime64(time.nanoseconds, "ns"))
279+
rr.set_time("ros_time", timestamp=np.datetime64(time.nanoseconds, "ns"))
280280

281281
rr.log("map/robot/camera/img", rr.Image(self.cv_bridge.imgmsg_to_cv2(img)))
282282
self.log_tf_as_transform3d("map/robot/camera", time)
@@ -301,7 +301,7 @@ After extracting the positions and colors as Numpy arrays, the entire cloud can
301301
def points_callback(self, points: PointCloud2) -> None:
302302
"""Log a `PointCloud2` with `log_points`."""
303303
time = Time.from_msg(points.header.stamp)
304-
rr.set_time("ros_time", np.datetime64(time.nanoseconds, "ns"))
304+
rr.set_time("ros_time", timestamp=np.datetime64(time.nanoseconds, "ns"))
305305

306306
pts = point_cloud2.read_points(points, field_names=["x", "y", "z"],
307307
skip_nans=True)
@@ -353,7 +353,7 @@ def __init__(self) -> None:
353353
def scan_callback(self, scan: LaserScan) -> None:
354354
"""Log a LaserScan after transforming it to line-segments."""
355355
time = Time.from_msg(scan.header.stamp)
356-
rr.set_time("ros_time", np.datetime64(time.nanoseconds, "ns"))
356+
rr.set_time("ros_time", timestamp=np.datetime64(time.nanoseconds, "ns"))
357357

358358
# Project the laser scan to a collection of points
359359
points = self.laser_proj.projectLaser(scan)

examples/cpp/stereo_vision_slam/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ rec.log(entity_name,
140140
void Viewer::Plot(std::string plot_name, double value, unsigned long maxkeyframe_id)
141141
{
142142
// …
143-
rec.set_time("max_keyframe_id", sequence=maxkeyframe_id);
143+
rec.set_time_sequence("max_keyframe_id", maxkeyframe_id);
144144
rec.log(plot_name, rerun::Scalar(value));
145145
}
146146
```

0 commit comments

Comments
 (0)