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
Commits
e63b21d5
Commit
e63b21d5
authored
2 years ago
by
Fabian Reister
Browse files
Options
Downloads
Patches
Plain Diff
ros_conversions: new types
parent
4eaccefa
No related branches found
No related tags found
3 merge requests
!31
Feature/teb local planner new api
,
!28
Draft: Dev -> Main
,
!27
Add TEB to CMake config
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/armarx/navigation/local_planning/ros_conversions.cpp
+21
-15
21 additions, 15 deletions
source/armarx/navigation/local_planning/ros_conversions.cpp
source/armarx/navigation/local_planning/ros_conversions.h
+2
-2
2 additions, 2 deletions
source/armarx/navigation/local_planning/ros_conversions.h
with
23 additions
and
17 deletions
source/armarx/navigation/local_planning/ros_conversions.cpp
+
21
−
15
View file @
e63b21d5
#include
"ros_conversions.h"
#include
"ArmarXCore/core/exceptions/local/ExpressionException.h"
#include
"ArmarXCore/core/time/Clock.h"
#include
"ArmarXCore/core/time/Duration.h"
#include
"armarx/navigation/core/Trajectory.h"
#include
<armarx/navigation/conversions/eigen.h>
#include
<range/v3/view/zip.hpp>
namespace
armarx
::
navigation
::
conv
{
teb_local_planner
::
PoseSE2
...
...
@@ -41,13 +47,13 @@ namespace armarx::navigation::conv
}
teb_local_planner
::
TimedElasticBand
toRos
(
const
core
::
Trajectory
&
trajectory
)
toRos
(
const
core
::
Global
Trajectory
&
trajectory
)
{
teb_local_planner
::
TimedElasticBand
teb
;
bool
first
=
true
;
teb_local_planner
::
PoseSE2
lastPose
;
for
(
const
core
::
TrajectoryPoint
&
point
:
trajectory
.
points
())
for
(
const
core
::
Global
TrajectoryPoint
&
point
:
trajectory
.
points
())
{
teb_local_planner
::
PoseSE2
pose
=
toRos
(
point
.
waypoint
.
pose
);
teb
.
addPose
(
pose
);
...
...
@@ -67,27 +73,27 @@ namespace armarx::navigation::conv
return
teb
;
}
core
::
Trajectory
core
::
Local
Trajectory
fromRos
(
const
teb_local_planner
::
TimedElasticBand
&
teb
)
{
core
::
Trajectory
Points
trajectory
;
core
::
Local
Trajectory
trajectory
;
trajectory
.
reserve
(
teb
.
poses
().
size
());
teb_local_planner
::
PoseSequence
::
const_iterator
poseIt
=
teb
.
poses
().
begin
();
for
(
const
teb_local_planner
::
VertexTimeDiff
*
timeDiff
:
teb
.
timediffs
())
{
Eigen
::
Vector2d
distance
=
poseIt
[
1
]
->
pose
().
position
()
-
poseIt
[
0
]
->
pose
().
position
();
float
velocity
=
distance
.
norm
()
/
timeDiff
->
dt
();
// TODO this timestamp should be given via the argument list
DateTime
timestamp
=
Clock
::
Now
();
core
::
Pose
pose
=
fromRos
(
poseIt
[
0
]
->
pose
());
ARMARX_CHECK_EQUAL
(
teb
.
poses
().
size
(),
teb
.
timediffs
().
size
());
for
(
const
auto
&
[
poseVertex
,
timediff
]
:
ranges
::
views
::
zip
(
teb
.
poses
(),
teb
.
timediffs
()))
{
const
core
::
Pose
pose
=
fromRos
(
poseVertex
->
pose
());
const
Duration
dt
=
Duration
::
SecondsDouble
(
timediff
->
dt
());
timestamp
+=
dt
;
trajectory
.
push_back
({.
waypoint
=
{
pose
},
.
velocity
=
velocity
});
poseIt
++
;
trajectory
.
push_back
(
core
::
LocalTrajectoryPoint
{.
timestamp
=
timestamp
,
.
pose
=
{
pose
}});
}
core
::
Pose
end
=
fromRos
(
teb
.
poses
().
end
()[
0
]
->
pose
());
trajectory
.
push_back
({.
waypoint
=
{
end
},
.
velocity
=
0
});
return
{
trajectory
}
;
return
trajectory
;
}
...
...
This diff is collapsed.
Click to expand it.
source/armarx/navigation/local_planning/ros_conversions.h
+
2
−
2
View file @
e63b21d5
...
...
@@ -36,9 +36,9 @@ namespace armarx::navigation::conv
geometry_msgs
::
Twist
toRos
(
const
core
::
Twist
&
velocity
);
teb_local_planner
::
TimedElasticBand
toRos
(
const
core
::
Trajectory
&
trajectory
);
teb_local_planner
::
TimedElasticBand
toRos
(
const
core
::
Global
Trajectory
&
trajectory
);
core
::
Trajectory
fromRos
(
const
teb_local_planner
::
TimedElasticBand
&
teb
);
core
::
Local
Trajectory
fromRos
(
const
teb_local_planner
::
TimedElasticBand
&
teb
);
}
// namespace armarx::navigation::conv
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