0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

座標系

rerunで座標系を変更・可視化してチェックする方法について解説します

実装例は以下のリポジトリで公開しています

座標系の種類

ドキュメントのcomponents.ViewCoordinatesから対応している座標系とその命名を確認することが出来ます.

RIGHT_HAND_Z_UP: ViewCoordinates 
X=Right, Y=Forward, Z=Up

RUB: ViewCoordinates
X=Right, Y=Up, Z=Back

rerunの座標系は右手系にしか対応していないようです
issueや内部実装でも言及されており,将来的に対応はされるかもしれません.

変更・可視化方法

import rerun as rr

rr.init("view_coordinates", spawn=True)

rr.log("world", rr.ViewCoordinates.RIGHT_HAND_Z_UP, static=True)
rr.log(
    "world/xyz",
    rr.Arrows3D(
        vectors=[[1, 0, 0], [0, 1, 0], [0, 0, 1]],
        colors=[[255, 0, 0], [0, 255, 0], [0, 0, 255]],  # X: red, Y: green, Z: blue
    ),
)

image.png

またviewerからも座標軸を確認することが出来ます.viewer右側のShow origin axesにチェックを入れることで,rr.logでプロットすることなく現在の座標軸を確認することが出来ます.

image.png

参考

合わせて以下の記事も御覧ください.

公式GitHub

archetypes/view_coordinates.py
archetypes/view_coordinates_ext.py
components/view_coordinates.py

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?