File tree 2 files changed +24
-11
lines changed
2 files changed +24
-11
lines changed Original file line number Diff line number Diff line change @@ -4284,7 +4284,9 @@ void marg_factor_free(marg_factor_t *marg) {
4284
4284
4285
4285
// Jacobians
4286
4286
free (marg -> param_types );
4287
- free (marg -> param_ptrs );
4287
+ if (marg -> param_ptrs ) {
4288
+ free (marg -> param_ptrs );
4289
+ }
4288
4290
free (marg -> params );
4289
4291
free (marg -> r );
4290
4292
for (int i = 0 ; i < marg -> num_params ; i ++ ) {
@@ -4647,14 +4649,12 @@ static void marg_factor_hessian_decomp(marg_factor_t *marg) {
4647
4649
for (int i = 0 ; i < (r * r ); i ++ ) {
4648
4650
diff += pow (H_ [i ] - marg -> H_marg [i ], 2 );
4649
4651
}
4650
- diff = sqrt (diff );
4651
4652
4652
4653
if (diff > 1e-2 ) {
4653
4654
marg -> eigen_decomp_ok = 0 ;
4654
4655
LOG_WARN ("J' * J != H_marg. Diff is %.2e\n" , diff );
4655
4656
LOG_WARN ("This is bad ... Usually means marginalization is bad!\n" );
4656
4657
}
4657
- printf ("J' * J != H_marg. Diff is %.2e\n" , diff );
4658
4658
4659
4659
free (Jt );
4660
4660
free (H_ );
Original file line number Diff line number Diff line change @@ -318,6 +318,16 @@ void time_delay_setup(time_delay_t *time_delay, const real_t param);
318
318
void time_delay_copy (const time_delay_t * src , time_delay_t * dst );
319
319
void time_delay_print (const char * prefix , const time_delay_t * exts );
320
320
321
+ ///////////
322
+ // POINT //
323
+ ///////////
324
+
325
+ typedef struct point_t {
326
+ real_t x ;
327
+ real_t y ;
328
+ real_t z ;
329
+ } point_t ;
330
+
321
331
///////////
322
332
// JOINT //
323
333
///////////
@@ -495,12 +505,13 @@ typedef struct pose_factor_t {
495
505
real_t covar [6 * 6 ];
496
506
real_t sqrt_info [6 * 6 ];
497
507
508
+ real_t r [6 ];
498
509
int r_size ;
499
- int num_params ;
500
- int param_types [1 ];
501
510
511
+ int param_types [1 ];
502
512
real_t * params [1 ];
503
- real_t r [6 ];
513
+ int num_params ;
514
+
504
515
real_t * jacs [1 ];
505
516
real_t J_pose [6 * 6 ];
506
517
} pose_factor_t ;
@@ -523,12 +534,13 @@ typedef struct ba_factor_t {
523
534
real_t sqrt_info [2 * 2 ];
524
535
real_t z [2 ];
525
536
537
+ real_t r [2 ];
526
538
int r_size ;
527
- int num_params ;
528
- int param_types [3 ];
529
539
540
+ int param_types [3 ];
530
541
real_t * params [3 ];
531
- real_t r [2 ];
542
+ int num_params ;
543
+
532
544
real_t * jacs [3 ];
533
545
real_t J_pose [2 * 6 ];
534
546
real_t J_feature [2 * 3 ];
@@ -557,12 +569,13 @@ typedef struct camera_factor_t {
557
569
real_t sqrt_info [2 * 2 ];
558
570
real_t z [2 ];
559
571
572
+ real_t r [2 ];
560
573
int r_size ;
574
+
561
575
int num_params ;
562
576
int param_types [4 ];
563
-
564
577
real_t * params [4 ];
565
- real_t r [ 2 ];
578
+
566
579
real_t * jacs [4 ];
567
580
real_t J_pose [2 * 6 ];
568
581
real_t J_extrinsic [2 * 6 ];
You can’t perform that action at this time.
0 commit comments