Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lennard Hofmann
RobotAPI
Commits
400b2cfb
Commit
400b2cfb
authored
3 years ago
by
Fabian Reister
Browse files
Options
Downloads
Patches
Plain Diff
occupancy grid conversion
parent
c0f41f49
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/libraries/armem_vision/aron_conversions.cpp
+17
-18
17 additions, 18 deletions
source/RobotAPI/libraries/armem_vision/aron_conversions.cpp
source/RobotAPI/libraries/armem_vision/aron_conversions.h
+4
-3
4 additions, 3 deletions
source/RobotAPI/libraries/armem_vision/aron_conversions.h
with
21 additions
and
21 deletions
source/RobotAPI/libraries/armem_vision/aron_conversions.cpp
+
17
−
18
View file @
400b2cfb
...
@@ -6,14 +6,12 @@
...
@@ -6,14 +6,12 @@
#include
<RobotAPI/interface/units/LaserScannerUnit.h>
#include
<RobotAPI/interface/units/LaserScannerUnit.h>
#include
<RobotAPI/libraries/armem_vision/aron/LaserScan.aron.generated.h>
#include
<RobotAPI/libraries/armem_vision/aron/LaserScan.aron.generated.h>
#include
<RobotAPI/libraries/aron/common/aron_conversions.h>
#include
<RobotAPI/libraries/aron/converter/common/Converter.h>
#include
<RobotAPI/libraries/aron/converter/common/Converter.h>
#include
<RobotAPI/libraries/aron/core/navigator/data/complex/NDArray.h>
#include
<RobotAPI/libraries/aron/core/navigator/data/complex/NDArray.h>
#include
<RobotAPI/libraries/aron/common/aron_conversions.h>
#include
"types.h"
#include
"types.h"
namespace
armarx
::
armem
namespace
armarx
::
armem
{
{
...
@@ -27,8 +25,8 @@ namespace armarx::armem
...
@@ -27,8 +25,8 @@ namespace armarx::armem
SensorHeader
fromAron
(
const
arondto
::
SensorHeader
&
aronSensorHeader
)
SensorHeader
fromAron
(
const
arondto
::
SensorHeader
&
aronSensorHeader
)
{
{
return
{.
agent
=
aronSensorHeader
.
agent
,
return
{.
agent
=
aronSensorHeader
.
agent
,
.
frame
=
aronSensorHeader
.
frame
,
.
frame
=
aronSensorHeader
.
frame
,
.
timestamp
=
timeFromAron
(
aronSensorHeader
.
timestamp
)};
.
timestamp
=
timeFromAron
(
aronSensorHeader
.
timestamp
)};
}
}
...
@@ -39,8 +37,10 @@ namespace armarx::armem
...
@@ -39,8 +37,10 @@ namespace armarx::armem
// laserScan.data = fromAron(aronLaserScan.data);
// laserScan.data = fromAron(aronLaserScan.data);
}
}
void
fromAron
(
const
arondto
::
LaserScanStamped
&
aronLaserScan
,
LaserScan
&
laserScan
,
void
fromAron
(
const
arondto
::
LaserScanStamped
&
aronLaserScan
,
std
::
int64_t
&
timestamp
,
std
::
string
&
frame
,
LaserScan
&
laserScan
,
std
::
int64_t
&
timestamp
,
std
::
string
&
frame
,
std
::
string
&
agentName
)
std
::
string
&
agentName
)
{
{
const
auto
header
=
fromAron
(
aronLaserScan
.
header
);
const
auto
header
=
fromAron
(
aronLaserScan
.
header
);
...
@@ -48,14 +48,12 @@ namespace armarx::armem
...
@@ -48,14 +48,12 @@ namespace armarx::armem
// laserScan = fromAron(aronLaserScan.data);
// laserScan = fromAron(aronLaserScan.data);
timestamp
=
header
.
timestamp
.
toMicroSeconds
();
timestamp
=
header
.
timestamp
.
toMicroSeconds
();
frame
=
header
.
frame
;
frame
=
header
.
frame
;
agentName
=
header
.
agent
;
agentName
=
header
.
agent
;
}
}
/************ toAron ************/
/************ toAron ************/
// auto toAron(const LaserScan& laserScan, aron::LaserScan& aronLaserScan)
// auto toAron(const LaserScan& laserScan, aron::LaserScan& aronLaserScan)
// {
// {
// aronLaserScan.scan = toAron(laserScan);
// aronLaserScan.scan = toAron(laserScan);
...
@@ -70,8 +68,8 @@ namespace armarx::armem
...
@@ -70,8 +68,8 @@ namespace armarx::armem
{
{
arondto
::
SensorHeader
aronSensorHeader
;
arondto
::
SensorHeader
aronSensorHeader
;
aronSensorHeader
.
agent
=
sensorHeader
.
agent
;
aronSensorHeader
.
agent
=
sensorHeader
.
agent
;
aronSensorHeader
.
frame
=
sensorHeader
.
frame
;
aronSensorHeader
.
frame
=
sensorHeader
.
frame
;
aronSensorHeader
.
timestamp
=
toAron
(
sensorHeader
.
timestamp
);
aronSensorHeader
.
timestamp
=
toAron
(
sensorHeader
.
timestamp
);
return
aronSensorHeader
;
return
aronSensorHeader
;
...
@@ -94,20 +92,21 @@ namespace armarx::armem
...
@@ -94,20 +92,21 @@ namespace armarx::armem
{
{
.
agent
=
agentName
,
.
frame
=
frame
,
.
timestamp
=
timestamp
};
.
agent
=
agentName
,
.
frame
=
frame
,
.
timestamp
=
timestamp
};
const
LaserScanStamped
laserScanStamped
{.
header
=
header
,
.
data
=
laserScan
};
const
LaserScanStamped
laserScanStamped
{.
header
=
header
,
.
data
=
laserScan
};
toAron
(
laserScanStamped
,
aronLaserScanStamped
);
toAron
(
laserScanStamped
,
aronLaserScanStamped
);
}
}
void
toAron
(
arondto
::
OccupancyGrid
&
dto
,
const
OccupancyGrid
&
bo
)
void
toAron
(
arondto
::
OccupancyGrid
&
dto
,
const
OccupancyGrid
&
bo
)
{
{
aron
::
toAron
(
dto
.
frame
,
bo
.
frame
);
aron
::
toAron
(
dto
.
frame
,
bo
.
frame
);
aron
::
toAron
(
dto
.
pose
,
bo
.
pose
);
aron
::
toAron
(
dto
.
pose
,
bo
.
pose
);
aron
::
toAron
(
dto
.
resolution
,
bo
.
resolution
);
aron
::
toAron
(
dto
.
resolution
,
bo
.
resolution
);
// bo.grid is NdArray -> need special handling.
// bo.grid is NdArray -> need special handling.
}
}
void
fromAron
(
arondto
::
OccupancyGrid
&
dto
,
OccupancyGrid
&
bo
)
void
fromAron
(
const
arondto
::
OccupancyGrid
&
dto
,
OccupancyGrid
&
bo
)
{
{
aron
::
fromAron
(
dto
.
frame
,
bo
.
frame
);
aron
::
fromAron
(
dto
.
frame
,
bo
.
frame
);
aron
::
fromAron
(
dto
.
pose
,
bo
.
pose
);
aron
::
fromAron
(
dto
.
pose
,
bo
.
pose
);
...
@@ -115,4 +114,4 @@ namespace armarx::armem
...
@@ -115,4 +114,4 @@ namespace armarx::armem
// bo.grid is NdArray -> need special handling.
// bo.grid is NdArray -> need special handling.
}
}
}
// namespace armarx::armem
}
// namespace armarx::armem
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
source/RobotAPI/libraries/armem_vision/aron_conversions.h
+
4
−
3
View file @
400b2cfb
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include
<RobotAPI/libraries/armem/core/Time.h>
#include
<RobotAPI/libraries/armem/core/Time.h>
#include
<RobotAPI/libraries/armem_vision/aron/OccupancyGrid.aron.generated.h>
#include
<RobotAPI/libraries/armem_vision/aron/OccupancyGrid.aron.generated.h>
#include
<RobotAPI/libraries/aron/converter/common/VectorConverter.h>
#include
<RobotAPI/libraries/aron/converter/common/VectorConverter.h>
#include
<RobotAPI/libraries/aron/converter/eigen/EigenConverter.h>
#include
<RobotAPI/libraries/aron/core/navigator/data/complex/NDArray.h>
#include
<RobotAPI/libraries/aron/core/navigator/data/complex/NDArray.h>
namespace
armarx
::
armem
namespace
armarx
::
armem
...
@@ -49,7 +50,7 @@ namespace armarx::armem
...
@@ -49,7 +50,7 @@ namespace armarx::armem
auto
fromAron
(
const
aron
::
datanavigator
::
NDArrayNavigatorPtr
&
navigator
)
auto
fromAron
(
const
aron
::
datanavigator
::
NDArrayNavigatorPtr
&
navigator
)
{
{
return
aron
::
converter
::
AronVectorConverter
::
ConvertToVector
<
T
>
(
return
aron
::
converter
::
AronVectorConverter
::
ConvertToVector
<
T
>
(
navigator
);
navigator
);
}
}
void
fromAron
(
const
arondto
::
LaserScanStamped
&
aronLaserScan
,
void
fromAron
(
const
arondto
::
LaserScanStamped
&
aronLaserScan
,
...
@@ -70,12 +71,12 @@ namespace armarx::armem
...
@@ -70,12 +71,12 @@ namespace armarx::armem
// OccupancyGrid
// OccupancyGrid
void
toAron
(
arondto
::
OccupancyGrid
&
dto
,
const
OccupancyGrid
&
bo
);
void
toAron
(
arondto
::
OccupancyGrid
&
dto
,
const
OccupancyGrid
&
bo
);
void
fromAron
(
arondto
::
OccupancyGrid
&
dto
,
OccupancyGrid
&
bo
);
void
fromAron
(
const
arondto
::
OccupancyGrid
&
dto
,
OccupancyGrid
&
bo
);
inline
aron
::
datanavigator
::
NDArrayNavigatorPtr
inline
aron
::
datanavigator
::
NDArrayNavigatorPtr
toAron
(
const
OccupancyGrid
::
Grid
&
grid
)
toAron
(
const
OccupancyGrid
::
Grid
&
grid
)
{
{
return
aron
::
converter
::
Aron
Vector
Converter
::
ConvertFrom
Vector
(
grid
);
return
aron
::
converter
::
Aron
Eigen
Converter
::
ConvertFrom
Array
(
grid
);
}
}
}
// namespace armarx::armem
}
// namespace armarx::armem
\ 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