Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
laser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
wolf_projects
wolf_lib
plugins
laser
Commits
87a1b8d8
Commit
87a1b8d8
authored
6 years ago
by
Pep Martí Saumell
Browse files
Options
Downloads
Patches
Plain Diff
WIP
parent
4e13cf99
No related branches found
No related tags found
3 merge requests
!30
Release after RAL
,
!29
After 2nd RAL submission
,
!2
Resolve "autoconf: add create function"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/laser/sensor/sensor_laser_2D.h
+12
-11
12 additions, 11 deletions
include/laser/sensor/sensor_laser_2D.h
src/sensor/sensor_laser_2D.cpp
+21
-0
21 additions, 0 deletions
src/sensor/sensor_laser_2D.cpp
with
33 additions
and
11 deletions
include/laser/sensor/sensor_laser_2D.h
+
12
−
11
View file @
87a1b8d8
...
...
@@ -31,11 +31,11 @@ class SensorLaser2D : public SensorBase
public:
/** \brief Constructor with extrinsics
*
*
* \param _p_ptr StateBlock pointer to the sensor position
* \param _o_ptr StateBlock pointer to the sensor orientation
*
**/
*
**/
SensorLaser2D
(
StateBlockPtr
_p_ptr
,
StateBlockPtr
_o_ptr
);
/** \brief Constructor with extrinsics and scan parameters
...
...
@@ -58,25 +58,26 @@ class SensorLaser2D : public SensorBase
SensorLaser2D
(
StateBlockPtr
_p_ptr
,
StateBlockPtr
_o_ptr
,
IntrinsicsLaser2DPtr
_params
);
virtual
~
SensorLaser2D
();
void
setDefaultScanParams
();
/** \brief Set scanner intrinsic parameters
*
*
* \param _params struct with scanner intrinsic parameters. See laser_scan_utils library API for reference.
*
**/
*
**/
void
setScanParams
(
const
laserscanutils
::
LaserScanParams
&
_params
);
/** \brief Get scanner intrinsic parameters
*
*
* Get scanner intrinsic parameters
*
**/
*
**/
const
laserscanutils
::
LaserScanParams
&
getScanParams
()
const
;
public:
static
SensorBasePtr
create
(
const
std
::
string
&
_unique_name
,
const
Eigen
::
VectorXs
&
_extrinsics_po
,
const
IntrinsicsBasePtr
_intrinsics
);
static
SensorBasePtr
createAutoConf
(
const
std
::
string
&
_unique_name
,
const
paramsServer
&
_server
);
static
IntrinsicsBasePtr
createParams
(
const
std
::
string
&
_filename_dot_yaml
);
};
...
...
This diff is collapsed.
Click to expand it.
src/sensor/sensor_laser_2D.cpp
+
21
−
0
View file @
87a1b8d8
...
...
@@ -79,6 +79,23 @@ SensorBasePtr SensorLaser2D::create(const std::string& _unique_name, const Eigen
return
sen
;
}
SensorBasePtr
SensorLaser2D
::
createAutoConf
(
const
std
::
string
&
_unique_name
,
const
paramsServer
&
_server
)
{
// decode extrinsics vector
Eigen
::
VectorXs
_extrinsics_po
=
_server
.
getParam
<
Eigen
::
VectorXs
>
(
_unique_name
+
"/extrinsic/pos"
,
"[0,0,0]"
);
assert
(
_extrinsics_po
.
size
()
==
3
&&
"Bad extrinsics vector length. Should be 3 for 2D."
);
StateBlockPtr
pos_ptr
=
std
::
make_shared
<
StateBlock
>
(
_extrinsics_po
.
head
(
2
),
true
);
StateBlockPtr
ori_ptr
=
std
::
make_shared
<
StateBlock
>
(
_extrinsics_po
.
tail
(
1
),
true
);
SensorLaser2DPtr
sen
;
IntrinsicsLaser2D
params
;
sen
=
std
::
make_shared
<
SensorLaser2D
>
(
pos_ptr
,
ori_ptr
,
params
.
scan_params
);
sen
->
setName
(
_unique_name
);
return
sen
;
}
}
// namespace wolf
// Register in the SensorFactory and the ParameterFactory
...
...
@@ -88,3 +105,7 @@ namespace wolf {
WOLF_REGISTER_SENSOR
(
"LASER 2D"
,
SensorLaser2D
)
//const bool registered_laser_params = IntrinsicsFactory::get().registerCreator("LASER 2D", createIntrinsicsLaser2D);
}
// namespace wolf
#include
"core/sensor/autoconf_sensor_factory.h"
namespace
wolf
{
WOLF_REGISTER_SENSOR_AUTO
(
"LASER 2D"
,
SensorLaser2D
)
}
// namespace wolf
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