00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef _DATABASE_CAPTURE_REGION_H_
00038 #define _DATABASE_CAPTURE_REGION_H_
00039
00040 #include <iostream>
00041
00042 #include <geometry_msgs/Pose.h>
00043
00044 #include <database_interface/db_class.h>
00045
00046 #include <boost/shared_ptr.hpp>
00047
00048 #include "household_objects_database/database_helper_classes.h"
00049
00050 namespace household_objects_database {
00051
00053 class DatabaseCaptureRegion : public database_interface::DBClass
00054 {
00055 private:
00056
00057 public:
00059 database_interface::DBField<int> id_;
00060
00062 database_interface::DBField<int> scaled_model_id_;
00063
00065 database_interface::DBField<std::string> object_description_;
00067 database_interface::DBField<std::string> object_geometry_hash_;
00069 database_interface::DBField<std::string> robot_geometry_hash_;
00070
00072 database_interface::DBField<double> hand_object_coefficient_of_friction_;
00074 database_interface::DBField<double> pushing_distance_;
00076 database_interface::DBField<double> in_hand_distance_;
00077
00079 database_interface::DBField<double> y_resolution_;
00081 database_interface::DBField<double> start_y_offset_;
00083 database_interface::DBField<int> n_y_steps_;
00084
00086 database_interface::DBField<double> rotation_resolution_;
00088 database_interface::DBField<int> n_rotations_;
00089
00091 database_interface::DBField< std::vector< std::vector< double > > > left_pushing_distances_;
00093 database_interface::DBField< std::vector< std::vector< double > > > right_pushing_distances_;
00094
00096 database_interface::DBField< std::vector< std::vector< int > > > left_pushing_roll_sides_;
00098 database_interface::DBField< std::vector< std::vector< int > > > right_pushing_roll_sides_;
00099
00101 database_interface::DBField<double> radius_of_cylinder_bounding_the_object_;
00103 database_interface::DBField<DatabasePose> capture_region_computation_frame_in_object_frame_;
00104
00106 database_interface::DBField<double> fingertip_frame_to_pushing_surface_distance_;
00108 database_interface::DBField<double> finger_padding_;
00109
00110
00112 DatabaseCaptureRegion() :
00113 id_(database_interface::DBFieldBase::TEXT, this, "capture_region_id", "capture_region", true),
00114 scaled_model_id_(database_interface::DBFieldBase::TEXT, this, "scaled_model_id", "capture_region", true),
00115 object_description_(database_interface::DBFieldBase::TEXT, this, "object_description", "capture_region", true),
00116 object_geometry_hash_(database_interface::DBFieldBase::TEXT, this, "object_geometry_hash", "capture_region", true),
00117 robot_geometry_hash_(database_interface::DBFieldBase::TEXT, this, "robot_geometry_hash", "capture_region", true),
00118 hand_object_coefficient_of_friction_(database_interface::DBFieldBase::TEXT, this, "hand_object_coefficient_of_friction", "capture_region", true),
00119 pushing_distance_(database_interface::DBFieldBase::TEXT, this, "pushing_distance", "capture_region", true),
00120 in_hand_distance_(database_interface::DBFieldBase::TEXT, this, "in_hand_distance", "capture_region", true),
00121 y_resolution_(database_interface::DBFieldBase::TEXT, this, "y_resolution", "capture_region", true),
00122 start_y_offset_(database_interface::DBFieldBase::TEXT, this, "start_y_offset", "capture_region", true),
00123 n_y_steps_(database_interface::DBFieldBase::TEXT, this, "n_y_steps", "capture_region", true),
00124 rotation_resolution_(database_interface::DBFieldBase::TEXT, this, "rotation_resolution", "capture_region", true),
00125 n_rotations_(database_interface::DBFieldBase::TEXT, this, "n_rotations", "capture_region", true),
00126 left_pushing_distances_(database_interface::DBFieldBase::TEXT, this, "left_pushing_distances", "capture_region", true),
00127 right_pushing_distances_(database_interface::DBFieldBase::TEXT, this, "right_pushing_distances", "capture_region", true),
00128 left_pushing_roll_sides_(database_interface::DBFieldBase::TEXT, this, "left_pushing_roll_sides", "capture_region", true),
00129 right_pushing_roll_sides_(database_interface::DBFieldBase::TEXT, this, "right_pushing_roll_sides", "capture_region", true),
00130 radius_of_cylinder_bounding_the_object_(database_interface::DBFieldBase::TEXT, this, "radius_of_cylinder_bounding_the_object", "capture_region", true),
00131 capture_region_computation_frame_in_object_frame_(database_interface::DBFieldBase::TEXT, this, "capture_region_computation_frame_in_object_frame", "capture_region", true),
00132 fingertip_frame_to_pushing_surface_distance_(database_interface::DBFieldBase::TEXT, this, "fingertip_frame_to_pushing_surface_distance", "capture_region", true),
00133 finger_padding_(database_interface::DBFieldBase::TEXT, this, "finger_padding", "capture_region", true)
00134 {
00135
00136 primary_key_field_ = &id_;
00137
00138 fields_.push_back(&scaled_model_id_);
00139 fields_.push_back(&object_description_);
00140 fields_.push_back(&object_geometry_hash_);
00141 fields_.push_back(&robot_geometry_hash_);
00142 fields_.push_back(&hand_object_coefficient_of_friction_);
00143 fields_.push_back(&pushing_distance_);
00144 fields_.push_back(&in_hand_distance_);
00145 fields_.push_back(&y_resolution_);
00146 fields_.push_back(&start_y_offset_);
00147 fields_.push_back(&n_y_steps_);
00148 fields_.push_back(&rotation_resolution_);
00149 fields_.push_back(&n_rotations_);
00150 fields_.push_back(&left_pushing_distances_);
00151 fields_.push_back(&right_pushing_distances_);
00152 fields_.push_back(&left_pushing_roll_sides_);
00153 fields_.push_back(&right_pushing_roll_sides_);
00154 fields_.push_back(&radius_of_cylinder_bounding_the_object_);
00155 fields_.push_back(&capture_region_computation_frame_in_object_frame_);
00156 fields_.push_back(&fingertip_frame_to_pushing_surface_distance_);
00157 fields_.push_back(&finger_padding_);
00158
00159
00160 id_.setSequenceName("capture_region_id_seq");
00161
00162
00163 setAllFieldsReadFromDatabase(true);
00164 setAllFieldsWriteToDatabase(true);
00165
00166 id_.setWriteToDatabase(false);
00167 }
00168
00170 ~DatabaseCaptureRegion(){}
00171 };
00172
00173
00174 typedef boost::shared_ptr<DatabaseCaptureRegion> DatabaseCaptureRegionPtr;
00175
00176 }
00177
00178 #endif