Hi everyone! My program uses a Kinect to extract cylinders using PCL and draws them in rviz, or at least its supposed to! The problem is that the model from PCL provides me with a Vector3 that represents the axis of the cylinder and to draw it as a Marker on rviz I need to convert this into a quaternion. I also have access to a random point along the axis of the cylinder so I made the following function to extract the top and bottom points of the axis of the cylinder: void getMinMax3DalongAxis(const PointCloud::ConstPtr& cloud, PointT * max_pt, PointT * min_pt, PointT * axis_point, tf::Vector3 * normal) { PointT max_p = *axis_point; double max_t = 0.0; PointT min_p = *axis_point; double min_t = 0.0; BOOST_FOREACH(const PointT& pt, cloud->points) { // First we convert pt into a point p along the axis on the same plane perpendicular to the axis double t = (normal->x()*(pt.x-axis_point->x) + normal->y()*(pt.y-axis_point->y) + normal->z()*(pt.z-axis_point->z))/(pow(normal->x(),2) + pow(normal->y(),2) + pow(normal->z(),2)); PointT p; p.x = axis_point->x + normal->x() * t; p.y = axis_point->y + normal->y() * t; p.z = axis_point->z + normal->z() * t; // Now we check if the point is min or max using the result of the parametric equations if(t>max_t) { max_t = t; max_p = p; } if(t