Clustering related functions. More...
#include "clustering.h"
#include <vector>
#include <string>
#include <map>
#include <ostream>
#include "roscpp_serialization_macros.h"
#include <features.h>
#include <bits/wordsize.h>
#include <gnu/stubs-32.h>
#include <stddef.h>
#include <bits/types.h>
#include <time.h>
#include <iostream>
#include <cmath>
#include <stdexcept>
#include "duration.h"
#include <cstddef>
#include <utility>
#include <boost/config.hpp>
#include <limits>
#include <limits.h>
#include <algorithm>
#include <climits>
#include <iomanip>
#include <cerrno>
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/math/tools/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/mpl/aux_/config/gcc.hpp>
#include <boost/mpl/aux_/config/workaround.hpp>
#include <boost/mpl/aux_/adl_barrier.hpp>
#include <boost/mpl/aux_/config/static_constant.hpp>
#include <boost/mpl/aux_/config/msvc.hpp>
#include <boost/preprocessor/config/config.hpp>
#include <boost/mpl/aux_/config/ctps.hpp>
#include <boost/mpl/aux_/config/preprocessor.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/mpl/aux_/na.hpp>
#include <boost/mpl/aux_/config/ttp.hpp>
#include <boost/mpl/aux_/nttp_decl.hpp>
#include <boost/mpl/integral_c_tag.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/aux_/config/dtp.hpp>
#include <boost/mpl/aux_/template_arity_fwd.hpp>
#include <boost/preprocessor/logical/bool.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
#include <boost/mpl/aux_/lambda_arity_param.hpp>
#include <boost/mpl/aux_/config/lambda.hpp>
#include <boost/mpl/aux_/config/overload_resolution.hpp>
#include <boost/mpl/aux_/yes_no.hpp>
#include <boost/mpl/aux_/config/eti.hpp>
#include <boost/mpl/contains_fwd.hpp>
#include <boost/mpl/begin_end_fwd.hpp>
#include <boost/mpl/sequence_tag_fwd.hpp>
#include <boost/mpl/void_fwd.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/static_cast.hpp>
#include <boost/mpl/aux_/config/integral.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
#include <boost/mpl/aux_/has_begin.hpp>
#include <boost/mpl/void.hpp>
#include <boost/mpl/aux_/preprocessor/params.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
#include <boost/mpl/aux_/include_preprocessed.hpp>
#include <boost/mpl/aux_/arity.hpp>
#include <boost/mpl/aux_/config/has_xxx.hpp>
#include <boost/mpl/aux_/value_wknd.hpp>
#include <boost/mpl/aux_/nested_type_wknd.hpp>
#include <boost/mpl/aux_/config/nttp.hpp>
#include <boost/mpl/limits/arity.hpp>
#include <boost/mpl/lambda_fwd.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/mpl/aux_/arity_spec.hpp>
#include <boost/mpl/aux_/type_wrapper.hpp>
#include <boost/mpl/aux_/config/bind.hpp>
#include <boost/mpl/bind_fwd.hpp>
#include <boost/mpl/protect.hpp>
#include <boost/mpl/arg.hpp>
#include <boost/mpl/int_fwd.hpp>
#include <boost/mpl/aux_/is_msvc_eti_arg.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/aux_/preprocessor/def_params_tail.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/next.hpp>
#include <boost/mpl/aux_/integral_wrapper.hpp>
#include <boost/mpl/aux_/common_name_wknd.hpp>
#include <boost/mpl/aux_/config/forwarding.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/aux_/traits_lambda_spec.hpp>
#include <boost/mpl/find_if.hpp>
#include <boost/mpl/O1_size_fwd.hpp>
#include <boost/mpl/next_prior.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/O1_size.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/push_back_fwd.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/aux_/has_type.hpp>
#include <boost/mpl/push_front_fwd.hpp>
#include <boost/mpl/inserter.hpp>
#include <boost/mpl/push_back.hpp>
#include <boost/mpl/push_front.hpp>
#include <boost/mpl/back_inserter.hpp>
#include <boost/mpl/front_inserter.hpp>
#include <boost/mpl/clear_fwd.hpp>
#include <boost/preprocessor/inc.hpp>
#include <boost/mpl/aux_/has_tag.hpp>
#include <boost/mpl/numeric_cast.hpp>
#include <boost/mpl/aux_/msvc_eti_base.hpp>
#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/long.hpp>
#include <boost/mpl/tag.hpp>
#include <boost/mpl/size_fwd.hpp>
#include <boost/mpl/aux_/comparison_op.hpp>
#include <boost/mpl/less.hpp>
#include <stdlib.h>
#include <endian.h>
#include <bits/mathcalls.h>
#include <boost/limits.hpp>
#include <boost/assert.hpp>
#include <boost/static_assert.hpp>
#include <boost/math/policies/policy.hpp>
#include <math.h>
#include <boost/cstdint.hpp>
#include <locale>
#include <streambuf>
#include <iosfwd>
#include <boost/format/detail/compat_workarounds.hpp>
#include <boost/format/format_fwd.hpp>
#include <new>
#include <boost/type_traits/config.hpp>
#include <boost/type_traits/detail/template_arity_spec.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#include <boost/preprocessor/debug/error.hpp>
#include <boost/preprocessor/detail/auto_rec.hpp>
#include <boost/preprocessor/control/while.hpp>
#include <boost/preprocessor/control/expr_iif.hpp>
#include <boost/preprocessor/list/adt.hpp>
#include <boost/preprocessor/list/fold_right.hpp>
#include <boost/preprocessor/logical/bitand.hpp>
#include <boost/preprocessor/list/fold_left.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/tuple/rem.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/type_traits/detail/bool_trait_def.hpp>
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#include <boost/type_traits/intrinsics.hpp>
#include <boost/type_traits/is_arithmetic.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/type_traits/detail/type_trait_def.hpp>
#include <boost/type_traits/detail/type_trait_undef.hpp>
#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/type_traits/detail/ice_not.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_union.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/is_member_pointer.hpp>
#include <boost/type_traits/broken_compiler_spec.hpp>
#include <boost/type_traits/detail/cv_traits_impl.hpp>
#include <boost/type_traits/is_pod.hpp>
#include <functional>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/arithmetic/dec.hpp>
#include <memory>
#include <exception>
#include <boost/checked_delete.hpp>
#include <boost/throw_exception.hpp>
#include <typeinfo>
#include <boost/smart_ptr/detail/sp_counted_base.hpp>
#include <boost/config/no_tr1/memory.hpp>
#include <boost/smart_ptr/detail/sp_has_sync.hpp>
#include <boost/optional.hpp>
#include <boost/format/internals_fwd.hpp>
#include <boost/format/internals.hpp>
#include <boost/format/alt_sstream.hpp>
#include <boost/format/format_class.hpp>
#include <boost/format/group.hpp>
#include <boost/format/exceptions.hpp>
#include <boost/math/special_functions/detail/round_fwd.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/comparison.hpp>
#include <complex>
#include <cstring>
#include "rostime_decl.h"
#include <bits/time.h>
#include <sys/select.h>
#include "serialized_message.h"
#include "message_forward.h"
#include <ros/time.h>
#include <boost/type_traits/is_volatile.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include "message_traits.h"
#include "ros/exception.h"
#include <iterator>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/utility/enable_if.hpp>
#include "ros/builtin_message_traits.h"
#include <cstdio>
#include <sstream>
#include <cstdarg>
#include <ros/macros.h>
#include <log4cxx/logstring.h>
#include <log4cxx/log4cxx.h>
#include <log4cxx/helpers/objectptr.h>
#include <log4cxx/helpers/object.h>
#include <log4cxx/helpers/objectimpl.h>
#include <log4cxx/helpers/pool.h>
#include <log4cxx/helpers/mutex.h>
#include <log4cxx/appender.h>
#include <log4cxx/logger.h>
#include <log4cxx/level.h>
#include <ros/platform.h>
#include "ros/serialization.h"
#include "ros/message_operations.h"
#include "ros/assert.h"
#include "ros/console.h"
#include <stdint.h>
#include <assert.h>
#include <set>
#include <list>
#include <boost/shared_ptr.hpp>
#include <boost/smart_ptr/detail/shared_count.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/preprocessor/array/size.hpp>
#include <cassert>
#include <stdarg.h>
#include <bits/wchar.h>
#include <boost/type_traits/has_trivial_copy.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/type_traits/is_member_function_pointer.hpp>
#include <boost/type_traits/ice.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/smart_ptr/detail/operator_bool.hpp>
#include <boost/shared_array.hpp>
#include "ros/types.h"
#include "ros/forwards.h"
#include "ros/common.h"
#include <xlocale.h>
#include <boost/array.hpp>
#include <boost/ref.hpp>
#include <boost/mem_fn.hpp>
#include <boost/type.hpp>
#include <boost/is_placeholder.hpp>
#include <boost/bind/arg.hpp>
#include "common.h"
#include <ros/message_traits.h>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/function.hpp>
#include <boost/type_traits/type_with_alignment.hpp>
#include <ros/static_assert.h>
#include <boost/type_traits/add_const.hpp>
#include "ros/message_event.h"
#include <boost/type_traits/is_base_of.hpp>
#include <boost/make_shared.hpp>
#include "forwards.h"
#include "timer_options.h"
#include "ros/rate.h"
#include "wall_timer_options.h"
#include "ros/message.h"
#include "ros/service_traits.h"
#include <istream>
#include <boost/call_traits.hpp>
#include <ios>
#include <boost/integer_traits.hpp>
#include <boost/type_traits/is_abstract.hpp>
#include "subscription_callback_helper.h"
#include "ros/spinner.h"
#include <boost/bind.hpp>
#include "ros/publisher.h"
#include <boost/utility/addressof.hpp>
#include <boost/utility/base_from_member.hpp>
#include <boost/preprocessor/facilities/identity.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq/size.hpp>
#include <boost/preprocessor/seq/fold_left.hpp>
#include <boost/preprocessor/arithmetic/sub.hpp>
#include <boost/preprocessor/logical/compl.hpp>
#include "ros/service_server.h"
#include "ros/subscriber.h"
#include "ros/node_handle.h"
#include "ros/init.h"
#include "XmlRpcValue.h"
#include "node_handle.h"
#include "ros/names.h"
#include <stdio.h>
#include <bzlib.h>
#include "rosbag/exceptions.h"
#include "ros/ros.h"
#include "ros/subscription_callback_helper.h"
#include <queue>
#include <boost/format.hpp>
#include <boost/detail/iterator.hpp>
#include <boost/iterator/detail/config_def.hpp>
#include <boost/iterator/detail/config_undef.hpp>
#include <boost/mpl/always.hpp>
#include "rosbag/structures.h"
#include "rosbag/bag.h"
#include "std_msgs/Header.h"
#include "geometry_msgs/Point.h"
#include "std_msgs/ColorRGBA.h"
#include "visualization_msgs/Marker.h"
#include "geometry_msgs/Vector3.h"
#include "geometry_msgs/Quaternion.h"
#include "geometry_msgs/Pose.h"
#include "btMatrix3x3.h"
#include "tf/exceptions.h"
#include "LinearMath/btTransform.h"
#include <boost/thread/mutex.hpp>
#include <boost/functional/hash/hash_fwd.hpp>
#include <boost/functional/hash/detail/float_functions.hpp>
#include <boost/integer/static_log2.hpp>
#include <boost/functional/hash/detail/limits.hpp>
#include <boost/functional/hash/hash.hpp>
#include <boost/iterator.hpp>
#include <boost/iterator/iterator_categories.hpp>
#include <boost/utility/swap.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/unordered/detail/hash_table_impl.hpp>
#include <boost/unordered/detail/config.hpp>
#include <initializer_list>
#include <boost/type_traits/is_function.hpp>
#include <boost/type_traits/add_pointer.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/smart_ptr/detail/sp_convertible.hpp>
#include <boost/config/no_tr1/functional.hpp>
#include <boost/smart_ptr/weak_ptr.hpp>
#include <boost/utility.hpp>
#include <boost/signals/detail/signals_common.hpp>
#include <boost/signals/connection.hpp>
#include "boost/type_traits/add_volatile.hpp"
#include "boost/type_traits/has_nothrow_copy.hpp"
#include <boost/type_traits/has_trivial_destructor.hpp>
#include "boost/type_traits/has_trivial_assign.hpp"
#include "boost/type_traits/has_trivial_constructor.hpp"
#include "boost/type_traits/is_signed.hpp"
#include "boost/type_traits/is_unsigned.hpp"
#include "boost/type_traits/is_base_and_derived.hpp"
#include "boost/type_traits/is_float.hpp"
#include "boost/type_traits/is_fundamental.hpp"
#include "boost/type_traits/is_scalar.hpp"
#include <boost/type_traits/is_empty.hpp>
#include <boost/type_traits/detail/size_t_trait_def.hpp>
#include <boost/type_traits/detail/size_t_trait_undef.hpp>
#include "boost/type_traits/remove_pointer.hpp"
#include "boost/type_traits/function_traits.hpp"
#include "boost/type_traits/aligned_storage.hpp"
#include <boost/type_traits/integral_promotion.hpp>
#include <boost/type_traits/floating_point_promotion.hpp>
#include <boost/type_traits/make_unsigned.hpp>
#include <boost/type_traits/remove_bounds.hpp>
#include <boost/visit_each.hpp>
#include <boost/signals/detail/config.hpp>
#include <boost/function/detail/prologue.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/signals/trackable.hpp>
#include <boost/signals/slot.hpp>
#include <boost/smart_ptr.hpp>
#include <boost/function/function2.hpp>
#include <boost/signals/signal_template.hpp>
#include "geometry_msgs/TransformStamped.h"
#include "sensor_msgs/LaserScan.h"
#include <tf/transform_broadcaster.h>
#include <string.h>
#include <float.h>
#include <fstream>
#include "clustering.h"
Go to the source code of this file.
Functions | |
int | abdClustering (vector< PointPtr > &points, double lambda, vector< ClusterPtr > &clusters_ABD) |
Performs Segmentation operation with the Adaptative Breakpoint Detector. | |
geometry_msgs::Point | calculateClusterCentroid (vector< geometry_msgs::Point > support_points) |
PointPtr | calculateClusterCentroid (vector< PointPtr > support_points) |
Calculates the cluster's centroid. | |
geometry_msgs::Point | calculateClusterMedian (vector< geometry_msgs::Point > support_points) |
PointPtr | calculateClusterMedian (vector< PointPtr > support_points) |
Calculates the cluster's central point. | |
double | cosineDistance (vector< double > &vect1, vector< double > &vect2) |
Calculates the cosine distance between 2 vectors. | |
double | deg2rad (double angle) |
Converts degree values to radian values. | |
int | dietmayerClustering (vector< PointPtr > &points, double C0, vector< ClusterPtr > &clusters_Dietmayer) |
Performs Segmentation operation with the Dietmayer Segmentation Algorithm. | |
double | euclideanDistance (geometry_msgs::Point &point1, geometry_msgs::Point &point2) |
int | nnClustering (vector< PointPtr > &points, double threshold, vector< ClusterPtr > &clusters_nn) |
Performs Segmentation operation with the Spacial Nerarest Neighbor Algorithm. | |
int | premebidaClustering (vector< PointPtr > &points, double threshold_prem, vector< ClusterPtr > &clusters_Premebida) |
Performs Segmentation operation with the Multivariable Segmentation Algorithm. | |
vector< double > | rangeFeatures (double range1, double range2, PointPtr range1cart, PointPtr range2cart) |
A auxiliary function of the premebidaClustering function Calculates the a set of atributes of a pair of laser points. | |
void | recursiveClustering (vector< PointPtr > &points, vector< pair< ClusterPtr, bool > > &point_association, double threshold, uint idx) |
Auxiliary function to the nnClustering - Recursive function. | |
int | santosClustering (vector< PointPtr > &points, double C0, double beta, vector< ClusterPtr > &clusters_Santos) |
Performs Segmentation operation with the Santos Approach from the Dietmayer Segmentation Algorithm. | |
int | simpleClustering (vector< PointPtr > &points, double threshold, vector< ClusterPtr > &clusters) |
Performs a Simple Segmentation operation. |
Clustering related functions.
Definition in file clustering.cpp.
int abdClustering | ( | vector< PointPtr > & | points, | |
double | lambda, | |||
vector< ClusterPtr > & | clusters_ABD | |||
) |
Performs Segmentation operation with the Adaptative Breakpoint Detector.
points | incoming Laser Points | |
lamda | auxiliary parameter | |
clusters_ABD | clusters output vector of clusters, these clusters use the Cluster class |
Definition at line 384 of file clustering.cpp.
geometry_msgs::Point calculateClusterCentroid | ( | vector< geometry_msgs::Point > | support_points | ) |
Definition at line 723 of file clustering.cpp.
Calculates the cluster's centroid.
support_points | cluster's support points |
Definition at line 702 of file clustering.cpp.
geometry_msgs::Point calculateClusterMedian | ( | vector< geometry_msgs::Point > | support_points | ) |
Definition at line 782 of file clustering.cpp.
Calculates the cluster's central point.
support_points | cluster's support points |
Definition at line 747 of file clustering.cpp.
double cosineDistance | ( | vector< double > & | vect1, | |
vector< double > & | vect2 | |||
) |
Calculates the cosine distance between 2 vectors.
vect1 | input vector with the range atributes from the fist pair | |
vect2 | input vector with the range atributes from the second pair |
Definition at line 665 of file clustering.cpp.
double deg2rad | ( | double | angle | ) |
Converts degree values to radian values.
angle | angle value in degrees |
Definition at line 687 of file clustering.cpp.
int dietmayerClustering | ( | vector< PointPtr > & | points, | |
double | C0, | |||
vector< ClusterPtr > & | clusters_Dietmayer | |||
) |
Performs Segmentation operation with the Dietmayer Segmentation Algorithm.
points | incoming Laser Points | |
C0 | parameter used for noise reduction | |
clusters_Dietmayer | output vector of clusters, these clusters use the Cluster class |
Definition at line 144 of file clustering.cpp.
double euclideanDistance | ( | geometry_msgs::Point & | point1, | |
geometry_msgs::Point & | point2 | |||
) |
Definition at line 692 of file clustering.cpp.
int nnClustering | ( | vector< PointPtr > & | points, | |
double | threshold, | |||
vector< ClusterPtr > & | clusters_nn | |||
) |
Performs Segmentation operation with the Spacial Nerarest Neighbor Algorithm.
points | incoming Laser Points | |
threshold | distance value used to break clusters | |
clusters_nn | clusters output vector of clusters, these clusters use the Cluster class |
Definition at line 468 of file clustering.cpp.
int premebidaClustering | ( | vector< PointPtr > & | points, | |
double | threshold_prem, | |||
vector< ClusterPtr > & | clusters_Premebida | |||
) |
Performs Segmentation operation with the Multivariable Segmentation Algorithm.
points | incoming Laser Points | |
threshold_prem | cosine distance value used to break clusters | |
clusters_Premebida | clusters output vector of clusters, these clusters use the Cluster class |
Definition at line 239 of file clustering.cpp.
vector<double> rangeFeatures | ( | double | range1, | |
double | range2, | |||
PointPtr | range1cart, | |||
PointPtr | range2cart | |||
) |
A auxiliary function of the premebidaClustering function Calculates the a set of atributes of a pair of laser points.
range1 | range value of the the first point | |
range2 | range value of the the second point | |
range1cart | cartesian value of the first point | |
range2cart | cartesian value of the second point |
Definition at line 635 of file clustering.cpp.
void recursiveClustering | ( | vector< PointPtr > & | points, | |
vector< pair< ClusterPtr, bool > > & | point_association, | |||
double | threshold, | |||
uint | idx | |||
) |
Auxiliary function to the nnClustering - Recursive function.
points | incoming Laser Points | |
point_association | pair with the output vector of clusters and its state of association | |
threshold | distance value used to break clusters | |
idx | index of the scan point |
Definition at line 819 of file clustering.cpp.
int santosClustering | ( | vector< PointPtr > & | points, | |
double | C0, | |||
double | beta, | |||
vector< ClusterPtr > & | clusters_Santos | |||
) |
Performs Segmentation operation with the Santos Approach from the Dietmayer Segmentation Algorithm.
points | incoming Laser Points | |
C0 | parameter used for noise reduction | |
beta | parameter aiming to reduce the dependence of the segmentation with respect to the distance between the LRF and the objects | |
clusters_Santos | clusters output vector of clusters, these clusters use the Cluster class |
Definition at line 538 of file clustering.cpp.
int simpleClustering | ( | vector< PointPtr > & | points, | |
double | threshold, | |||
vector< ClusterPtr > & | clusters | |||
) |
Performs a Simple Segmentation operation.
points | incoming Laser Points | |
threshold | distance value used to break clusters | |
clusters | output vector of clusters, these clusters use the Cluster class |
Definition at line 49 of file clustering.cpp.