I have the following information:
- A position point (x,y,z)
- An quaternion orientation (w, i, j, k)
I want to plot this as a vector in 3D in Matplotlib. I have seen many questions (example question) on plotting a 3D vector in Matplotlib. For example, I know I can plot a vector in Matplotlib given two points, a start (x, y, z) and an end (x, y, z) as shown below.
start = [2 3 5];
end = [4 5 5];
quiver3(start(1), start(2), start(3), end(1), end(2), end(3));
My question is: how can I either convert my position and quaternion into a start and end point so that I can plot it as a vector, or how can I directly plot my position and quaternion?
Note: I have the code which plots my position in 3D, I just am unsure how to get the orientation:
ax.set_title("Pos: (" + str(x) + ", " + str(y) + ", " + str(z) + ")")
ax.set_xlim([-5, 5])
ax.set_ylim([-5, 5])
ax.set_zlim([0, 5])
ax.set_xlabel("X Axis")
ax.set_ylabel("Y Axis")
ax.set_zlabel("Z Axis")
ax.scatter(x, y, z)
