Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Navigation
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Software
ArmarX
Skills
Navigation
Merge requests
!34
Resolve "Follow-up from "Add TEB to CMake config""
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Follow-up from "Add TEB to CMake config""
14-follow-up-from-add-teb-to-cmake-config
into
dev
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Fabian Reister
requested to merge
14-follow-up-from-add-teb-to-cmake-config
into
dev
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Closes
#14 (closed)
Edited
2 years ago
by
Fabian Reister
0
0
Merge request reports
Compare
dev
dev (base)
and
latest version
latest version
fd4655a2
1 commit,
2 years ago
1 file
+
18
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
source/armarx/navigation/local_planning/ros_conversions.cpp
+
18
−
4
Options
@@ -7,6 +7,7 @@
#include
"armarx/navigation/core/basic_types.h"
#include
<armarx/navigation/conversions/eigen.h>
#include
<range/v3/view/drop.hpp>
#include
<range/v3/view/zip.hpp>
namespace
armarx
::
navigation
::
conv
@@ -82,23 +83,36 @@ namespace armarx::navigation::conv
core
::
LocalTrajectory
fromRos
(
const
teb_local_planner
::
TimedElasticBand
&
teb
)
{
const
auto
&
tebPoses
=
teb
.
poses
();
if
(
tebPoses
.
empty
())
{
return
{};
}
core
::
LocalTrajectory
trajectory
;
trajectory
.
reserve
(
teb
.
p
oses
()
.
size
());
trajectory
.
reserve
(
teb
P
oses
.
size
());
// TODO this timestamp should be given via the argument list
DateTime
timestamp
=
Clock
::
Now
();
ARMARX_CHECK_EQUAL
(
teb
.
poses
().
size
(),
teb
.
timediffs
().
size
());
ARMARX_CHECK_EQUAL
(
tebPoses
.
size
(),
teb
.
timediffs
().
size
()
-
1
);
// add the first pose at this timestamp
trajectory
.
push_back
(
core
::
LocalTrajectoryPoint
{.
timestamp
=
timestamp
,
.
pose
=
{
fromRos
(
tebPoses
.
front
()
->
pose
())}});
for
(
const
auto
&
[
poseVertex
,
timediff
]
:
ranges
::
views
::
zip
(
teb
.
poses
(),
teb
.
timediffs
()))
// all consecutive poses
for
(
const
auto
&
[
poseVertex
,
timediff
]
:
ranges
::
views
::
zip
(
tebPoses
|
ranges
::
views
::
drop
(
1
),
teb
.
timediffs
()))
{
const
core
::
Pose
pose
=
fromRos
(
poseVertex
->
pose
());
const
Duration
dt
=
Duration
::
SecondsDouble
(
timediff
->
dt
());
timestamp
+=
dt
;
timestamp
+=
dt
;
trajectory
.
push_back
(
core
::
LocalTrajectoryPoint
{.
timestamp
=
timestamp
,
.
pose
=
{
pose
}});
}
ARMARX_CHECK_EQUAL
(
trajectory
.
size
(),
tebPoses
.
size
());
return
trajectory
;
}
Loading