Skip to content

log_rigid3 does not support pytorch Tensor objects #1583

@roym899

Description

@roym899

Describe the bug
It seems like log_rigid3 does not support tensor objects.

WARNING:root:Ignoring rerun log call: Traceback (most recent call last):
  File "/home/leo/.pyenv/versions/rerun_playground/lib/python3.8/site-packages/rerun_sdk/rerun/log/log_decorator.py", line 35, in wrapper
    return func(*args, **kwargs)
  File "/home/leo/.pyenv/versions/rerun_playground/lib/python3.8/site-packages/rerun_sdk/rerun/log/transform.py", line 157, in log_rigid3
    bindings.log_rigid3(
TypeError: argument 'translation': 'Tensor' object cannot be converted to 'Sequence'

To Reproduce

import torch
import numpy as np
import rerun as rr

translation = torch.from_numpy(np.array([0,0,0]))
rotation = torch.from_numpy(np.array([0,0,0,1]))
rr.log_rigid3("camera", parent_from_child=(translation, rotation))

Same code works fine without the torch.from_numpy(...).

Expected behavior
Ideally it would work, or the docs should represent the fact that different types are expected from other functions that support PyTorch tensors (like log_tensor or log_line_segments). Currently all of these are annotated as npt.ArrayLike.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04

Additional context

  • Python 3.8, rerun-sdk 0.3.1, numpy 1.23.0, torch 1.13.1

Metadata

Metadata

Assignees

Labels

sdk-pythonPython logging API🪳 bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions