Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iri_adc_landmarks_slam_solver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
ADC
ADC_2021
iri_adc_landmarks_slam_solver
Commits
f0846c78
Commit
f0846c78
authored
4 years ago
by
Alejandro Lopez Gestoso
Browse files
Options
Downloads
Patches
Plain Diff
[WORK IN PROGRESS] Added landmark_residual_froms_base. Some minor changes
parent
9a8fe039
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/adc_landmarks_slam_solver_alg.h
+1
-0
1 addition, 0 deletions
include/adc_landmarks_slam_solver_alg.h
include/landmark_residual_2D.h
+2
-2
2 additions, 2 deletions
include/landmark_residual_2D.h
include/landmark_residual_from_base_2D.h
+77
-0
77 additions, 0 deletions
include/landmark_residual_from_base_2D.h
with
80 additions
and
2 deletions
include/adc_landmarks_slam_solver_alg.h
+
1
−
0
View file @
f0846c78
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
typedef
struct
{
typedef
struct
{
double
r
;
///< Range at detection
double
r
;
///< Range at detection
double
theta
;
///< Angle at detection
double
theta
;
///< Angle at detection
double
landmark_key
;
///< Detected landmark's ID.
}
LandmarkResidualData
;
}
LandmarkResidualData
;
/**
/**
...
...
This diff is collapsed.
Click to expand it.
include/landmark_residual_2D.h
+
2
−
2
View file @
f0846c78
...
@@ -76,8 +76,8 @@ class LandmarkResidual2D {
...
@@ -76,8 +76,8 @@ class LandmarkResidual2D {
return
true
;
return
true
;
}
}
private
:
private
:
double
r_
;
///< The measured distance to the
reflector
center.
double
r_
;
///< The measured distance to the
landmark
center.
double
theta_
;
///< The measured angle to the
reflector
.
double
theta_
;
///< The measured angle to the
landmark
.
double
sensor_sigma_r_
;
///< Sensor radial sigma.
double
sensor_sigma_r_
;
///< Sensor radial sigma.
double
sensor_sigma_th_
;
///< Sensor angular sigma.
double
sensor_sigma_th_
;
///< Sensor angular sigma.
bool
sensor_inverted_
;
///<If the sensor is inverted
bool
sensor_inverted_
;
///<If the sensor is inverted
...
...
This diff is collapsed.
Click to expand it.
include/landmark_residual_from_base_2D.h
0 → 100644
+
77
−
0
View file @
f0846c78
#include
"ceres/ceres.h"
#include
<math.h>
#include
<Eigen/Eigen>
#define MAX_ROLL 0.2
/**
* \brief Class to define the residuals between a robot pose and a landmark detected.
*
*/
class
LandmarkResidualFromBase2D
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
/**
* \brief The constructor.
*
* \param _r Detection range from base link.
*
* \param _theta Detection angle from base link.
*
* \param _sigma_r Sensor radial standard deviation.
*
* \param _sigma_th Sensor angular standard deviation.
*
* \param _sensor_roll Sensor roll to know if it is inverted.
*
*/
LandmarkResidualFromBase2D
(
const
double
&
_r
,
const
double
&
_theta
,
const
double
&
_sigma_r
,
const
double
&
_sigma_th
,
const
double
&
_sensor_roll
)
{
r_
=
_r
;
theta_
=
_theta
;
sensor_sigma_r_
=
_sigma_r
;
sensor_sigma_th_
=
_sigma_th
;
sensor_inverted_
=
(
std
::
fabs
(
_sensor_roll
)
>
MAX_ROLL
);
}
template
<
typename
T
>
/**
* \brief Function to calculate the error for Ceres optimization.
*
* \return True if all is ok.
*/
bool
operator
()(
const
T
*
const
_robot_pose
,
const
T
*
const
_landmark_pos
,
T
*
residual
)
const
{
Eigen
::
Matrix
<
T
,
2
,
1
>
dist
;
Eigen
::
Matrix
<
T
,
3
,
1
>
landmark_global
,
landmark_local
;
Eigen
::
Matrix
<
T
,
3
,
1
>
trans
;
Eigen
::
Matrix
<
T
,
3
,
3
>
rot
;
landmark_global
<<
_landmark_pos
[
0
],
_landmark_pos
[
1
],
T
(
0.0
);
trans
<<
_robot_pose
[
0
],
_robot_pose
[
1
],
_robot_pose
[
2
];
rot
<<
cos
(
_robot_pose
[
2
]),
sin
(
_robot_pose
[
2
]),
T
(
0.0
),
-
sin
(
_robot_pose
[
2
]),
cos
(
_robot_pose
[
2
]),
T
(
0.0
),
T
(
0.0
),
T
(
0.0
),
T
(
1.0
);
landmark_local
=
rot
*
(
landmark_global
-
trans
);
dist
<<
landmark_local
(
0
),
landmark_local
(
1
)
*
(
sensor_inverted_
?
T
(
-
1
)
:
T
(
1
));
T
angle_res
=
T
(
theta_
)
-
T
(
atan2
(
dist
(
1
),
dist
(
0
)));
while
(
angle_res
>=
M_PI
)
angle_res
-=
2
*
M_PI
;
while
(
angle_res
<
-
M_PI
)
angle_res
+=
2
*
M_PI
;
residual
[
0
]
=
(
T
(
r_
)
-
dist
.
norm
())
/
T
(
sensor_sigma_r_
);
residual
[
1
]
=
angle_res
/
T
(
sensor_sigma_th_
);
return
true
;
}
private
:
double
r_
;
///< The measured distance to the landmark center from base link.
double
theta_
;
///< The measured angle to the landmark from base link.
double
sensor_sigma_r_
;
///< Sensor radial sigma.
double
sensor_sigma_th_
;
///< Sensor angular sigma.
bool
sensor_inverted_
;
///<If the sensor is inverted
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment