ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Tue, 09 Sep 2014 00:46:35 -0500quaternion problemhttps://answers.ros.org/question/192206/quaternion-problem/Hey guys,
I'm detecting cylindrical objects in a point cloud and want to use a service to save all the data of the cylinders and make them accessible to other nodes.
What i'm having trouble with is that i want to visualize the cylinders in rviz and therefor i need the center point and the quaternion, but the segmentation function of pcl gives me two vectors, bottom point and a direction vector. I already managed to compensate the offset from the bottom point to center point by simple vector calculations and to get the quaternion from the two vectors but i need the bottom point and don't want to save all of this information.
Is there a way to save just the bottom point and the quaternion and "slide" the bottom point along the quaternion up for half the cylinder hight, whenever i want to visualize it in rviz?
Or do you think that the data size wouldn't be problematic if i have to save up to 1000 cylinder datasets containing two 3Dvectors and quaternion?
cheers
Alex
Edit: To sum it up: Is it possible to calculate the center point with just the bottom point and the quaternion? Mon, 08 Sep 2014 18:12:03 -0500https://answers.ros.org/question/192206/quaternion-problem/Answer by tfoote for <p>Hey guys,</p>
<p>I'm detecting cylindrical objects in a point cloud and want to use a service to save all the data of the cylinders and make them accessible to other nodes.
What i'm having trouble with is that i want to visualize the cylinders in rviz and therefor i need the center point and the quaternion, but the segmentation function of pcl gives me two vectors, bottom point and a direction vector. I already managed to compensate the offset from the bottom point to center point by simple vector calculations and to get the quaternion from the two vectors but i need the bottom point and don't want to save all of this information.</p>
<p>Is there a way to save just the bottom point and the quaternion and "slide" the bottom point along the quaternion up for half the cylinder hight, whenever i want to visualize it in rviz?
Or do you think that the data size wouldn't be problematic if i have to save up to 1000 cylinder datasets containing two 3Dvectors and quaternion? </p>
<p>cheers</p>
<p>Alex</p>
<p>Edit: To sum it up: Is it possible to calculate the center point with just the bottom point and the quaternion? </p>
https://answers.ros.org/question/192206/quaternion-problem/?answer=192229#post-id-192229If you have one point and the quaternion, that's about as compact a data representation as you can get for free space position. The second vector is redundant with the quaternion, you don't need to keep both.
On modern computers storing thousands of poses is not particularly large enough to worry about most of the time.
Edit:
If the cylinder is of known size, yes the lowest point and orientation is enough to compute any position on the cylinder. Otherwise no. Tue, 09 Sep 2014 00:23:15 -0500https://answers.ros.org/question/192206/quaternion-problem/?answer=192229#post-id-192229Comment by AlexKolb for <p>If you have one point and the quaternion, that's about as compact a data representation as you can get for free space position. The second vector is redundant with the quaternion, you don't need to keep both. </p>
<p>On modern computers storing thousands of poses is not particularly large enough to worry about most of the time.</p>
<p>Edit: </p>
<p>If the cylinder is of known size, yes the lowest point and orientation is enough to compute any position on the cylinder. Otherwise no. </p>
https://answers.ros.org/question/192206/quaternion-problem/?comment=192233#post-id-192233thanks, but whats the math behind it? How can i calculate the center point for the cylinder with the bottom point and the quaternion?Tue, 09 Sep 2014 00:46:35 -0500https://answers.ros.org/question/192206/quaternion-problem/?comment=192233#post-id-192233