Applying a quaternion rotation to a vector
Hello,
I want to apply a quaternion rotation on a vector e.g. on v_orig = [0,0,1] a q = [0.5,0.5,0.5,0.5] rotation that the rotated vector v_new = [1,0,0]. How is this possible with ROS? Are there any functions to archive this? In the tf2 library I can define quaternions and poses but that doesn't do the thing, as far as I have seen.
The background is, that I have an approach vector in a defined orientation and I want to calculate a point which is e.g. 0.5 m away from the origin in this direction.
Are you using C++ or Python?
I'm using C++
How would one do it in python with ROS2?