@@ -71,47 +71,151 @@ void cP3dNormWithUK::SetPNorm(const cPt3dr & aTr)
7171 Init ();
7272}
7373
74+ /* ******************************************************* */
75+ /* */
76+ /* cRotWithUK */
77+ /* */
78+ /* ******************************************************* */
79+ // cRotWithUK(const tRotR & aPose);
80+
81+
82+ cRotWithUK::cRotWithUK (const tRotR & aRot) :
83+ mRot (aRot),
84+ mOmega (0.0 ,0.0 ,0.0 )
85+ {
86+
87+ }
88+
89+ // cRotWithUK();
90+
91+ cRotWithUK::cRotWithUK () :
92+ cRotWithUK (tRotR())
93+ {
94+ }
95+
96+
97+ cRotWithUK::~cRotWithUK ()
98+ {
99+ OUK_Reset ();
100+ }
101+
102+ const tRotR & cRotWithUK::Rot () const {return mRot ;}
103+ void cRotWithUK::SetRot ( const tRotR & aRot)
104+ {
105+ mOmega = cPt3dr (0.0 ,0.0 ,0.0 );
106+ mRot = aRot;
107+ }
108+
109+ cPt3dr cRotWithUK::AxeI () const {return mRot .AxeI ();}
110+ cPt3dr cRotWithUK::AxeJ () const {return mRot .AxeJ ();}
111+ cPt3dr cRotWithUK::AxeK () const {return mRot .AxeK ();}
112+
113+
114+ const cPt3dr & cRotWithUK::Omega () const {return mOmega ;}
115+ cPt3dr & cRotWithUK::GetRefOmega () {return mOmega ;}
116+ void cRotWithUK::SetOmega (const cPt3dr & anOmega) {mOmega = anOmega;}
117+
118+ void cRotWithUK::PushObs (std::vector<double > & aVObs,bool TransposeMatr)
119+ {
120+ if (TransposeMatr)
121+ mRot .Mat ().PushByCol (aVObs);
122+ else
123+ mRot .Mat ().PushByLine (aVObs);
124+ }
125+
126+
127+ void cRotWithUK::OnUpdate ()
128+ {
129+ // used above formula to modify rotation
130+ mRot = mRot * cRotation3D<tREAL8>::RotFromAxiator (-mOmega );
131+ // now this have modify rotation, the "delta" is void :
132+ mOmega = cPt3dr (0 ,0 ,0 );
133+ }
134+
135+ void cRotWithUK::FillGetAdrInfoParam (cGetAdrInfoParam<tREAL8> & aGAIP)
136+ {
137+ aGAIP.TestParam (this , &( mOmega .x ()) ," Wx" );
138+ aGAIP.TestParam (this , &( mOmega .y ()) ," Wy" );
139+ aGAIP.TestParam (this , &( mOmega .z ()) ," Wz" );
140+
141+ SetNameTypeId (aGAIP);
142+ }
143+
144+ void cRotWithUK::PutUknowsInSpecifiedSetInterval (cSetInterUK_MultipeObj<tREAL8> * aSetInterv)
145+ {
146+ aSetInterv->AddOneInterv (mOmega );
147+
148+ }
149+ void cRotWithUK::PutUknowsInSetInterval ()
150+ {
151+ PutUknowsInSpecifiedSetInterval (mSetInterv );
152+ }
153+
154+
155+ cPt3dr cRotWithUK::ValAxiatorFixRot (const tRotR & aRotFix) const
156+ {
157+ cDenseMatrix<tREAL8> aM = mRot .Mat ().Transpose () * aRotFix.Mat ();
158+ tREAL8 aZ = ( aM (1 ,0 ) - aM (0 ,1 )) / 2.0 ;
159+ tREAL8 aY = (-aM (2 ,0 ) + aM (0 ,2 )) / 2.0 ;
160+ tREAL8 aX = ( aM (2 ,1 ) - aM (1 ,2 )) / 2.0 ;
161+
162+ return cPt3dr (aX,aY,aZ);
163+ }
164+
74165/* ******************************************************* */
75166/* */
76167/* cPoseWithUK */
77168/* */
78169/* ******************************************************* */
79170
80171cPoseWithUK::cPoseWithUK (const tPoseR & aPose) :
81- mPose (aPose),
82- mOmega ( 0.0 , 0.0 , 0.0 )
172+ mTr (aPose.Tr() ),
173+ mRUK (aPose.Rot() )
83174{
84175}
85176
177+
86178cPoseWithUK::cPoseWithUK () :
87179 cPoseWithUK (tPoseR())
88180{
89181}
90182
183+
184+
91185cPoseWithUK::~cPoseWithUK ()
92186{
93187 OUK_Reset ();
94188}
95189
96190void cPoseWithUK::SetPose (const tPoseR & aPose)
97191{
98- mPose = aPose;
192+ mRUK .SetRot (aPose.Rot ());
193+ mTr = aPose.Tr ();
194+ }
195+
196+
197+ tPoseR cPoseWithUK::Pose () const
198+ {
199+ return tPoseR (mTr ,mRUK .Rot ());
99200}
100201
101- const tPoseR & cPoseWithUK::Pose () const {return mPose ;}
102- tPoseR & cPoseWithUK::Pose () {return mPose ;}
103- const cPt3dr & cPoseWithUK::Center () const {return mPose .Tr ();}
104- cPt3dr & cPoseWithUK::Center () {return mPose .Tr ();}
105- cPt3dr cPoseWithUK::AxeI () const {return mPose .Rot ().AxeI ();}
106- cPt3dr cPoseWithUK::AxeJ () const {return mPose .Rot ().AxeJ ();}
107- cPt3dr cPoseWithUK::AxeK () const {return mPose .Rot ().AxeK ();}
108- const cPt3dr & cPoseWithUK::Tr () const {return mPose .Tr ();}
109- cPt3dr & cPoseWithUK::Tr () {return mPose .Tr ();}
202+ const tRotR & cPoseWithUK::Rot () const {return mRUK .Rot ();}
203+
204+
205+
206+ const cPt3dr & cPoseWithUK::Tr () const {return mTr ;}
207+ cPt3dr & cPoseWithUK::GetRefTr () {return mTr ;}
208+
209+ cPt3dr cPoseWithUK::AxeI () const {return mRUK .AxeI ();}
210+ cPt3dr cPoseWithUK::AxeJ () const {return mRUK .AxeJ ();}
211+ cPt3dr cPoseWithUK::AxeK () const {return mRUK .AxeK ();}
110212
111213
112214
113- cPt3dr & cPoseWithUK::Omega () {return mOmega ;}
114- const cPt3dr & cPoseWithUK::Omega () const {return mOmega ;}
215+ const cPt3dr & cPoseWithUK::Omega () const {return mRUK .Omega ();}
216+ cPt3dr & cPoseWithUK::GetRefOmega () {return mRUK .GetRefOmega ();}
217+
218+ void cPoseWithUK::SetOmega (const cPt3dr & anOmega) {mRUK .SetOmega (anOmega);}
115219
116220
117221/* Let R be the rotation of pose P=(C,R) = : Cam-> Word, what is optimized in colinearity for a ground point G
@@ -143,43 +247,42 @@ const cPt3dr & cPoseWithUK::Omega() const {return mOmega;}
143247* aMat(1,0) = -aW.z(); aMat(2,0) = aW.y(); aMat(2,1) = -aW.x();
144248*/
145249
146- cPt3dr cPoseWithUK::ValAxiatorFixRot (const cRotation3D<tREAL8> & aRotFix) const
250+
251+ cPt3dr cPoseWithUK::ValAxiatorFixRot (const tRotR & aRotFix) const
147252{
253+ return mRUK .ValAxiatorFixRot (aRotFix);
254+ /*
148255 cDenseMatrix<tREAL8> aM = mPose.Rot().Mat().Transpose() * aRotFix.Mat();
149256 tREAL8 aZ = ( aM(1,0) - aM(0,1)) / 2.0;
150257 tREAL8 aY = (-aM(2,0) + aM(0,2)) / 2.0;
151258 tREAL8 aX = ( aM(2,1) - aM(1,2)) / 2.0;
152259
153260 return cPt3dr(aX,aY,aZ);
261+ */
154262}
263+ #if (0)
264+
265+ #endif
155266
156267void cPoseWithUK::OnUpdate ()
157268{
158- // used above formula to modify rotation
159- mPose .SetRotation (mPose .Rot () * cRotation3D<tREAL8>::RotFromAxiator (-mOmega ));
160- // now this have modify rotation, the "delta" is void :
161- mOmega = cPt3dr (0 ,0 ,0 );
269+ mRUK .OnUpdate ();
162270}
163271
164272void cPoseWithUK::FillGetAdrInfoParam (cGetAdrInfoParam<tREAL8> & aGAIP)
165273{
166- aGAIP.TestParam (this , &( mPose .Tr ().x ())," Cx" );
167- aGAIP.TestParam (this , &( mPose .Tr ().y ())," Cy" );
168- aGAIP.TestParam (this , &( mPose .Tr ().z ())," Cz" );
169-
170- aGAIP.TestParam (this , &( mOmega .x ()) ," Wx" );
171- aGAIP.TestParam (this , &( mOmega .y ()) ," Wy" );
172- aGAIP.TestParam (this , &( mOmega .z ()) ," Wz" );
274+ aGAIP.TestParam (this , &( mTr .x ())," Cx" );
275+ aGAIP.TestParam (this , &( mTr .y ())," Cy" );
276+ aGAIP.TestParam (this , &( mTr .z ())," Cz" );
173277
278+ mRUK .FillGetAdrInfoParam (aGAIP);
174279 SetNameTypeId (aGAIP);
175280}
176281
177282void cPoseWithUK::PutUknowsInSpecifiedSetInterval (cSetInterUK_MultipeObj<tREAL8> * aSetInterv)
178283{
179- // StdOut() << " *PUK0 :PutUknowsInSetIntervalPutUknowsInSetInterval " << mIndUk0 << " " << mIndUk1 << "\n";
180- aSetInterv->AddOneInterv (mPose .Tr ());
181- aSetInterv->AddOneInterv (mOmega );
182- // StdOut() << " *PUK1 PutUknowsInSetIntervalPutUknowsInSetInterval " << mIndUk0 << " " << mIndUk1 << "\n";
284+ aSetInterv->AddOneInterv (mTr );
285+ mRUK .PutUknowsInSpecifiedSetInterval (aSetInterv);
183286}
184287
185288void cPoseWithUK::PutUknowsInSetInterval ()
@@ -189,11 +292,18 @@ void cPoseWithUK::PutUknowsInSetInterval()
189292
190293void AddData (const cAuxAr2007 & anAux,cPoseWithUK & aPUK)
191294{
192- MMVII::AddData (anAux,aPUK.Pose ());
295+ // StdOut() << "vv765vvVVvv void AddData(const cAuxAr2007 & anAux,cPoseWithUK & aPUK)\n";
296+
297+ tPoseR aPose = aPUK.Pose ();
298+ MMVII::AddData (anAux,aPose);
299+ if (anAux.Input ())
300+ aPUK.SetPose (aPose);
301+
302+ // MMVII::AddData(anAux,aPUK.Pose());
193303
194304 if (anAux.Input ())
195305 {
196- aPUK.Omega () = cPt3dr (0 ,0 ,0 );
306+ aPUK.SetOmega ( cPt3dr (0 ,0 ,0 ) );
197307 }
198308 else
199309 {
@@ -203,10 +313,13 @@ void AddData(const cAuxAr2007 & anAux,cPoseWithUK & aPUK)
203313
204314void cPoseWithUK::PushObs (std::vector<double > & aVObs,bool TransposeMatr)
205315{
316+ mRUK .PushObs (aVObs,TransposeMatr);
317+ /*
206318 if (TransposeMatr)
207319 mPose.Rot().Mat().PushByCol(aVObs);
208320 else
209321 mPose.Rot().Mat().PushByLine(aVObs);
322+ */
210323}
211324
212325/* ******************************************************* */
@@ -433,17 +546,17 @@ const cPixelDomain & cSensorCamPC::PixelDomain() const
433546cPerspCamIntrCalib * cSensorCamPC::InternalCalib () const {return mInternalCalib ;}
434547
435548const cPt3dr & cSensorCamPC::Center () const {return mPose_WU .Tr ();}
436- const tRotR & cSensorCamPC::Orient () const {return mPose_WU .Pose (). Rot ();}
549+ const tRotR & cSensorCamPC::Orient () const {return mPose_WU .Rot ();}
437550
438551const cPt3dr & cSensorCamPC::Omega () const {return mPose_WU .Omega ();}
439- cPt3dr & cSensorCamPC::Center () {return mPose_WU .Tr ();}
440- cPt3dr & cSensorCamPC::Omega () {return mPose_WU .Omega ();}
552+ cPt3dr & cSensorCamPC::Center () {return mPose_WU .GetRefTr ();}
553+ cPt3dr & cSensorCamPC::Omega () {return mPose_WU .GetRefOmega ();}
441554cPt3dr cSensorCamPC::PseudoCenterOfProj () const {return Center ();}
442555
443556cPt3dr cSensorCamPC::AxeI () const {return mPose_WU .AxeI ();}
444557cPt3dr cSensorCamPC::AxeJ () const {return mPose_WU .AxeJ ();}
445558cPt3dr cSensorCamPC::AxeK () const {return mPose_WU .AxeK ();}
446- const cIsometry3D<tREAL8> & cSensorCamPC::Pose () const {return mPose_WU .Pose ();}
559+ tPoseR cSensorCamPC::Pose () const {return mPose_WU .Pose ();}
447560
448561cPoseWithUK & cSensorCamPC::Pose_WU () {return mPose_WU ;}
449562
0 commit comments