Go to the documentation of this file.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 #ifndef JOINT_TRACKER_H_
00033 #define JOINT_TRACKER_H_
00034
00035 #include "joint_tracker/JointCombinedFilter.h"
00036
00037 #include "omip_msgs/RigidBodyPosesAndVelsMsg.h"
00038 #include "omip_msgs/RigidBodyPoseAndVelMsg.h"
00039
00040 #include "omip_msgs/RigidBodyTwistsWithCovMsg.h"
00041
00042 #include "omip_common/OMIPTypeDefs.h"
00043
00044 #include "omip_common/RecursiveEstimatorFilterInterface.h"
00045
00046 namespace omip
00047 {
00048
00049 enum ks_analysis_t
00050 {
00051 MOVING_BODIES_TO_STATIC_ENV = 1,
00052 BETWEEN_MOVING_BODIES = 2,
00053 FULL_ANALYSIS = 3
00054 };
00055
00056 typedef std::map<std::pair<int, int>, JointCombinedFilterPtr> joint_combined_filters_map;
00057
00061 class MultiJointTracker : public RecursiveEstimatorFilterInterface<ks_state_t, ks_measurement_t>
00062 {
00063 public:
00064 MultiJointTracker(double loop_period_ns, ks_analysis_t ks_analysis_type, double dj_ne);
00065
00066 virtual ~MultiJointTracker();
00067
00072 virtual void predictState(double time_interval_ns);
00073
00078 virtual void predictMeasurement();
00079
00083 virtual void setMeasurement(const ks_measurement_t & poses_and_vels, const double& measurement_timestamp_ns);
00084
00090 virtual void correctState();
00091
00092 virtual void addPredictedState(const ks_state_t &predicted_state , const double& predicted_state_timestamp_ns)
00093 {
00094 std::cout << "Not implemented" << std::endl;
00095 }
00096
00097 virtual void setNumSamplesLikelihoodEstimation(int likelihood_sample_num)
00098 {
00099 this->_likelihood_sample_num = likelihood_sample_num;
00100 }
00101
00102 virtual void setSigmaDeltaMeasurementUncertaintyLinear(double sigma_delta_meas_uncertainty_linear)
00103 {
00104 this->_sigma_delta_meas_uncertainty_linear = sigma_delta_meas_uncertainty_linear;
00105 }
00106
00107 virtual void setSigmaDeltaMeasurementUncertaintyAngular(double sigma_delta_meas_uncertainty_angular)
00108 {
00109 this->_sigma_delta_meas_uncertainty_angular = sigma_delta_meas_uncertainty_angular;
00110 }
00111
00112 virtual void setPrismaticPriorCovarianceVelocity(const double& value)
00113 {
00114 this->_prism_prior_cov_vel = value;
00115 }
00116
00117 virtual void setPrismaticSigmaSystemNoisePhi(const double& value)
00118 {
00119 this->_prism_sigma_sys_noise_phi = value;
00120 }
00121
00122 virtual void setPrismaticSigmaSystemNoiseTheta(const double& value)
00123 {
00124 this->_prism_sigma_sys_noise_theta = value;
00125 }
00126
00127 virtual void setPrismaticSigmaSystemNoisePV(const double& value)
00128 {
00129 this->_prism_sigma_sys_noise_pv = value;
00130 }
00131
00132 virtual void setPrismaticSigmaSystemNoisePVd(const double& value)
00133 {
00134 this->_prism_sigma_sys_noise_pvd = value;
00135 }
00136
00137 virtual void setPrismaticSigmaMeasurementNoise(const double& value)
00138 {
00139 this->_prism_sigma_meas_noise = value;
00140 }
00141
00142 virtual void setRevolutePriorCovarianceVelocity(const double& value)
00143 {
00144 this->_rev_prior_cov_vel = value;
00145 }
00146
00147 virtual void setRevoluteSigmaSystemNoisePhi(const double& value)
00148 {
00149 this->_rev_sigma_sys_noise_phi = value;
00150 }
00151
00152 virtual void setRevoluteSigmaSystemNoiseTheta(const double& value)
00153 {
00154 this->_rev_sigma_sys_noise_theta = value;
00155 }
00156
00157 virtual void setRevoluteSigmaSystemNoisePx(const double& value)
00158 {
00159 this->_rev_sigma_sys_noise_px = value;
00160 }
00161
00162 virtual void setRevoluteSigmaSystemNoisePy(const double& value)
00163 {
00164 this->_rev_sigma_sys_noise_py = value;
00165 }
00166
00167 virtual void setRevoluteSigmaSystemNoisePz(const double& value)
00168 {
00169 this->_rev_sigma_sys_noise_pz = value;
00170 }
00171
00172 virtual void setRevoluteSigmaSystemNoiseRV(const double& value)
00173 {
00174 this->_rev_sigma_sys_noise_rv = value;
00175 }
00176
00177 virtual void setRevoluteSigmaSystemNoiseRVd(const double& value)
00178 {
00179 this->_rev_sigma_sys_noise_rvd = value;
00180 }
00181
00182 virtual void setRevoluteSigmaMeasurementNoise(const double& value)
00183 {
00184 this->_rev_sigma_meas_noise = value;
00185 }
00186
00187 virtual void setRevoluteMinimumRotForEstimation(const double& value)
00188 {
00189 this->_rev_min_rot_for_ee = value;
00190 }
00191
00192 virtual void setRevoluteMaximumJointDistanceForEstimation(const double& value)
00193 {
00194 this->_rev_max_joint_distance_for_ee = value;
00195 }
00196
00197 virtual void setMinimumJointAgeForEE(const int& value)
00198 {
00199 this->_min_joint_age_for_ee = value;
00200 }
00201
00202 virtual void setRigidMaxTranslation(const double& value)
00203 {
00204 this->_rig_max_translation = value;
00205 }
00206
00207 virtual void setRigidMaxRotation(const double& value)
00208 {
00209 this->_rig_max_rotation = value;
00210 }
00211
00212 virtual void setMinimumNumFramesForNewRB(const int& value)
00213 {
00214 this->_min_num_frames_for_new_rb = value;
00215 }
00216
00217 virtual JointCombinedFilterPtr getCombinedFilter(int n);
00218
00219 virtual void estimateJointFiltersProbabilities();
00220
00221 protected:
00222
00229 virtual void _reflectState();
00230
00231 ks_analysis_t _ks_analysis_type;
00232 double _disconnected_j_ne;
00233
00234
00235 joint_combined_filters_map _joint_combined_filters;
00236
00237
00238 std::map<std::pair<int, int>, int> _precomputing_counter;
00239
00240
00241 std::map<std::pair<int, int>, Eigen::Twistd > _rrb_pose_at_srb_birthday_in_sf;
00242
00243
00244 std::map<std::pair<int, int>, Eigen::Twistd > _srb_pose_at_srb_birthday_in_sf;
00245
00246 omip_msgs::RigidBodyPosesAndVelsMsgPtr _last_rcvd_poses_and_vels;
00247
00248
00249 omip_msgs::RigidBodyPosesAndVelsMsgPtr _previous_rcvd_poses_and_vels;
00250
00251
00252
00253
00254 std::list<omip_msgs::RigidBodyPosesAndVelsMsgPtr> _n_previous_rcvd_poses_and_vels;
00255
00256 int _likelihood_sample_num;
00257 double _sigma_delta_meas_uncertainty_linear;
00258 double _sigma_delta_meas_uncertainty_angular;
00259
00260 double _prism_prior_cov_vel;
00261 double _prism_sigma_sys_noise_phi;
00262 double _prism_sigma_sys_noise_theta;
00263 double _prism_sigma_sys_noise_pv;
00264 double _prism_sigma_sys_noise_pvd;
00265 double _prism_sigma_meas_noise;
00266
00267 double _rev_prior_cov_vel;
00268 double _rev_sigma_sys_noise_phi;
00269 double _rev_sigma_sys_noise_theta;
00270 double _rev_sigma_sys_noise_px;
00271 double _rev_sigma_sys_noise_py;
00272 double _rev_sigma_sys_noise_pz;
00273 double _rev_sigma_sys_noise_rv;
00274 double _rev_sigma_sys_noise_rvd;
00275 double _rev_sigma_meas_noise;
00276
00277 double _rev_min_rot_for_ee;
00278 double _rev_max_joint_distance_for_ee;
00279
00280 double _rig_max_translation;
00281 double _rig_max_rotation;
00282
00283 int _min_joint_age_for_ee;
00284
00285 int _min_num_frames_for_new_rb;
00286 };
00287 }
00288
00289 #endif