svm_one_class.h
Go to the documentation of this file.
00001 #ifndef PR2_OVERHEAD_GRASPING_RANDOM_FOREST_H
00002 #define PR2_OVERHEAD_GRASPING_RANDOM_FOREST_H
00003 #include <ros/ros.h>
00004 #include "sensor_msgs/JointState.h"
00005 #include "std_msgs/UInt16MultiArray.h"
00006 #include "std_msgs/UInt32MultiArray.h"
00007 #include "std_msgs/Float32MultiArray.h"
00008 #include "std_msgs/Float32.h"
00009 #include "std_msgs/MultiArrayLayout.h"
00010 #include "std_msgs/MultiArrayDimension.h"
00011 #include "std_msgs/UInt16.h"
00012 #include "std_msgs/Bool.h"
00013 #include "pr2_msgs/AccelerometerState.h"
00014 #include "pr2_msgs/PressureState.h"
00015 #include "pr2_controllers_msgs/JointTrajectoryControllerState.h"
00016 #include "boost/thread/thread.hpp"
00017 #include "boost/format.hpp"
00018 #include "boost/foreach.hpp"
00019 #include "rosbag/bag.h"
00020 #include "rosbag/view.h"
00021 //#include "sensor_msgs/Float32MultiArray.h"
00022 //#include "sensor_msgs/MultiArrayDimension.h"
00023 #include "pr2_overhead_grasping/SensorPoint.h"
00024 #include "pr2_overhead_grasping/ClassVotes.h"
00025 #include "pr2_overhead_grasping/CollisionDescription.h"
00026 #include "pr2_overhead_grasping/RandomTreeMsg.h"
00027 #include "pr2_overhead_grasping/CovarianceMatrix.h"
00028 #include "roslib/Header.h"
00029 #include <ros/package.h>
00030 #include <std_srvs/Empty.h>
00031 #include <math.h>
00032 #include <nodelet/nodelet.h>
00033 #include <algorithm>
00034 #include <vector>
00035 #include <Eigen/Eigen>
00036 #include <Eigen/Dense>
00037 #include <Eigen/QR>
00038 #include <Eigen/Cholesky>
00039 #include "svm.h"
00040 //USING_PART_OF_NAMESPACE_EIGEN
00041 using namespace Eigen;
00042 
00043 using namespace std;
00044 using namespace pr2_overhead_grasping;
00045 
00046 namespace collision_detection {
00047 
00048   class SVMOneClass  {
00049     public:
00050       SVMOneClass() {}
00051       ~SVMOneClass();
00052       void loadDataset();
00053       void loadDataBag(string& data_bag, int label);
00054       void onInit();
00055 
00056       void generateModel();
00057 
00058     protected:
00059 
00060       ros::NodeHandle* nh;
00061       ros::NodeHandle* nh_priv;
00062 
00063       int num_classes;
00064       string classifier_name;
00065       int classifier_id;
00066       vector< SensorPoint::ConstPtr >* dataset;
00067       ros::Subscriber classify_sub;
00068       ros::Publisher results_pub;
00069       ros::Publisher loaded_pub;
00070       boost::thread setup_thread;
00071       bool classifier_loaded;
00072   };
00073 }
00074 
00075 
00076 #endif // PR2_OVERHEAD_GRASPING_RANDOM_FOREST_H


kelsey_sandbox
Author(s): kelsey
autogenerated on Wed Nov 27 2013 11:52:04