File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed
jsk_pcl_ros/include/jsk_pcl_ros/pcl Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -302,15 +302,26 @@ namespace pcl
302302 }
303303
304304 inline jsk_pcl_ros::Cube::Ptr toCube () const
305- {
306- Eigen::Affine3f pose = toEigenMatrix ();
307- Eigen::Vector3f dimensions (dx, dy, dz);
308- jsk_pcl_ros::Cube::Ptr cube (new jsk_pcl_ros::Cube (Eigen::Vector3f (pose.translation ()),
309- Eigen::Quaternionf (pose.rotation ()),
310- dimensions));
311- return cube;
312- }
305+ {
306+ Eigen::Affine3f pose = toEigenMatrix ();
307+ Eigen::Vector3f dimensions (dx, dy, dz);
308+ jsk_pcl_ros::Cube::Ptr cube (new jsk_pcl_ros::Cube (Eigen::Vector3f (pose.translation ()),
309+ Eigen::Quaternionf (pose.rotation ()),
310+ dimensions));
311+ return cube;
312+ }
313313
314+ // As of https://github.com/PointCloudLibrary/pcl/pull/5538,
315+ // trackers must implements averaging method
316+ template <class InputIterator >
317+ static ParticleCuboid weightedAverage (InputIterator first, InputIterator last)
318+ {
319+ ParticleCuboid wa;
320+ for (auto cuboid = first; cuboid != last; ++cuboid) {
321+ wa = wa + *(cuboid) * cuboid->weight ;
322+ }
323+ return wa;
324+ }
314325
315326 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
316327 };
You can’t perform that action at this time.
0 commit comments