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_GRASP_H_
00038 #define _DATABASE_GRASP_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
00052
00053
00054
00055
00056
00057
00058
00060 class DatabaseGrasp : public database_interface::DBClass
00061 {
00062 private:
00063
00064 public:
00066 database_interface::DBField<int> id_;
00068 database_interface::DBField<int> scaled_model_id_;
00069
00071 database_interface::DBField<DatabasePose> pre_grasp_pose_;
00073 database_interface::DBField<DatabaseHandPosture> pre_grasp_posture_;
00074
00076 database_interface::DBField<DatabasePose> final_grasp_pose_;
00078 database_interface::DBField<DatabaseHandPosture> final_grasp_posture_;
00079
00081 database_interface::DBField<double> quality_;
00083 database_interface::DBField<double> pre_grasp_clearance_;
00085 database_interface::DBField<bool> cluster_rep_;
00087 database_interface::DBField<double> table_clearance_;
00088
00090 database_interface::DBField<std::string> hand_name_;
00091
00093 database_interface::DBField<bool> compliant_copy_;
00095 database_interface::DBField<int> compliant_original_id_;
00096
00098 database_interface::DBField<double> scaled_quality_;
00099
00100 database_interface::DBField<bool> fingertip_object_collision_;
00101
00103 DatabaseGrasp() :
00104 id_(database_interface::DBFieldBase::TEXT, this, "grasp_id", "grasp", true),
00105 scaled_model_id_(database_interface::DBFieldBase::TEXT, this, "scaled_model_id", "grasp", true),
00106 pre_grasp_pose_(database_interface::DBFieldBase::TEXT, this, "grasp_pregrasp_position", "grasp", true),
00107 pre_grasp_posture_(database_interface::DBFieldBase::TEXT, this, "grasp_pregrasp_joints", "grasp", true),
00108 final_grasp_pose_(database_interface::DBFieldBase::TEXT, this, "grasp_grasp_position", "grasp", true),
00109 final_grasp_posture_(database_interface::DBFieldBase::TEXT, this, "grasp_grasp_joints", "grasp", true),
00110 quality_(database_interface::DBFieldBase::TEXT, this, "grasp_energy", "grasp", true),
00111 pre_grasp_clearance_(database_interface::DBFieldBase::TEXT, this, "grasp_pregrasp_clearance", "grasp", true),
00112 cluster_rep_(database_interface::DBFieldBase::TEXT, this, "grasp_cluster_rep", "grasp", true),
00113 table_clearance_(database_interface::DBFieldBase::TEXT, this, "grasp_table_clearance", "grasp", true),
00114 hand_name_(database_interface::DBFieldBase::TEXT, this, "hand_name", "grasp", true),
00115 compliant_copy_(database_interface::DBFieldBase::TEXT, this, "grasp_compliant_copy", "grasp", true),
00116 compliant_original_id_(database_interface::DBFieldBase::TEXT, this, "grasp_compliant_original_id", "grasp", true),
00117 scaled_quality_(database_interface::DBFieldBase::TEXT, this, "grasp_scaled_quality", "grasp", true),
00118 fingertip_object_collision_(database_interface::DBFieldBase::TEXT, this, "fingertip_object_collision", "grasp", true)
00119 {
00120
00121 primary_key_field_ = &id_;
00122
00123 fields_.push_back(&scaled_model_id_);
00124 fields_.push_back(&pre_grasp_pose_);
00125 fields_.push_back(&pre_grasp_posture_);
00126 fields_.push_back(&final_grasp_pose_);
00127 fields_.push_back(&final_grasp_posture_);
00128 fields_.push_back(&quality_);
00129 fields_.push_back(&pre_grasp_clearance_);
00130 fields_.push_back(&cluster_rep_);
00131 fields_.push_back(&table_clearance_);
00132 fields_.push_back(&hand_name_);
00133 fields_.push_back(&compliant_copy_);
00134 fields_.push_back(&compliant_original_id_);
00135 fields_.push_back(&scaled_quality_);
00136 fields_.push_back(&fingertip_object_collision_);
00137
00138
00139 id_.setSequenceName("grasp_grasp_id_seq");
00140
00141
00142 setAllFieldsReadFromDatabase(true);
00143 setAllFieldsWriteToDatabase(true);
00144
00145 id_.setWriteToDatabase(false);
00146 }
00147
00149 ~DatabaseGrasp(){}
00150 };
00151
00152
00153 typedef boost::shared_ptr<DatabaseGrasp> DatabaseGraspPtr;
00154
00155 }
00156
00157 #endif