Created
June 14, 2023 18:04
-
-
Save cmower/bb08a94775a67321b1d4945efb039459 to your computer and use it in GitHub Desktop.
Draw a frame in PyBullet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pybullet as p | |
import numpy as np | |
def draw_frame(T: np.ndarray) -> None: | |
""" Draw a frame represented by the 4-by-4 homogenous transformation matrix T.""" | |
for i in range(3): | |
color = [0, 0, 0] | |
color[i] = 1 | |
p.addUserDebugLine( | |
lineFromXYZ=T[:3, 3], | |
lineToXYZ=T[:3, 3] + T[:3, i], | |
lineColorRGB=color, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment