<jupyter_start><jupyter_text>Plot Scanner Positions Relative to VehiclePlot the vehicle co-ords, original scanner co-ords and final scanner co-ords.<jupyter_code>print(__doc__)


import numpy as np
import matplotlib.pyplot as plt
from pytransform3d.plot_utils import make_3d_axis
from pytransform3d.transform_manager import TransformManager
from pytransform3d.transformations import transform_from_pq

# Vehicle frame, x forward, z down

# new laser frame relative to original
# Position and orientation quaternion: (x, y, z, qw, qx, qy, qz)
T_final_scan = transform_from_pq ((0.0, 0.0, -1.5336, 1.23290445e-06, -1.23290445e-06, 5.59194185e-01, 8.29036032e-01))

random_state = np.random.RandomState(0)
A2world = random_transform(random_state)
B2world = random_transform(random_state)
A2C = random_transform(random_state)
D2B = random_transform(random_state)

tm = TransformManager()
tm.add_transform("A", "world", A2world)
tm.add_transform("B", "world", B2world)
tm.add_transform("A", "C", A2C)
tm.add_transform("D", "B", D2B)

plt.figure(figsize=(10, 5))

ax = make_3d_axis(3, 121)
ax = tm.plot_frames_in("world", ax=ax, alpha=0.6)
ax.view_init(30, 20)

ax = make_3d_axis(3, 122)
ax = tm.plot_frames_in("A", ax=ax, alpha=0.6)
ax.view_init(30, 20)

plt.show()<jupyter_output>Automatically created module for IPython interactive environment
{'fraction_non_alphanumeric': 0.12014925373134329, 'fraction_numerical': 0.06791044776119402, 'mean_word_length': 6.533707865168539, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '468952', 'license': 'MIT', 'n_tokens_mistral': 558, 'n_tokens_neox': 504, 'n_words': 119, 'path': 'python_version/plot_transforms.ipynb', 'repo_name': 'ryancwicks/Visualizing_Transformations', 'size': '1340'}