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
a4380a83
Commit
a4380a83
authored
3 years ago
by
Fabian Reister
Browse files
Options
Downloads
Patches
Plain Diff
bugfix (not!)
parent
6da7f923
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/Navigation/libraries/core/test/coreTest.cpp
+21
-18
21 additions, 18 deletions
source/Navigation/libraries/core/test/coreTest.cpp
source/Navigation/libraries/server/Navigator.cpp
+9
-1
9 additions, 1 deletion
source/Navigation/libraries/server/Navigator.cpp
with
30 additions
and
19 deletions
source/Navigation/libraries/core/test/coreTest.cpp
+
21
−
18
View file @
a4380a83
...
...
@@ -38,12 +38,10 @@ BOOST_AUTO_TEST_CASE(testPathLength)
{
armarx
::
nav
::
core
::
Path
path
{
armarx
::
nav
::
core
::
Pose
(
Eigen
::
Translation3f
(
0
,
0
,
0
)),
armarx
::
nav
::
core
::
Pose
(
Eigen
::
Translation3f
(
0
,
2000
,
0
)),
armarx
::
nav
::
core
::
Pose
(
Eigen
::
Translation3f
(
0
,
2000
,
0
)),
armarx
::
nav
::
core
::
Pose
(
Eigen
::
Translation3f
(
0
,
2000
,
0
)),
armarx
::
nav
::
core
::
Pose
(
Eigen
::
Translation3f
(
0
,
2000
,
0
))};
armarx
::
nav
::
core
::
Pose
(
Eigen
::
Translation3f
(
0
,
4000
,
0
))};
const
auto
traj
=
armarx
::
nav
::
core
::
Trajectory
::
FromPath
(
path
,
100
);
BOOST_CHECK_CLOSE
(
traj
.
length
(),
2
000
,
0.1
);
BOOST_CHECK_CLOSE
(
traj
.
length
(),
4
000
,
0.
0
1
);
}
BOOST_AUTO_TEST_CASE
(
testResampleAlongLine
)
...
...
@@ -56,24 +54,29 @@ BOOST_AUTO_TEST_CASE(testResampleAlongLine)
const
auto
resampledTraj
=
traj
.
resample
(
500
);
for
(
const
auto
&
pt
:
resampledTraj
.
positions
())
{
ARMARX_INFO
<<
VAROUT
(
pt
);
}
BOOST_CHECK_EQUAL
(
resampledTraj
.
points
().
size
(),
4
);
}
//
BOOST_AUTO_TEST_CASE(testResampleAlongLineWithWaypoint)
//
{
//
armarx::nav::core::Path path{armarx::nav::core::Pose(Eigen::Translation3f(0, 0, 0)),
//
armarx::nav::core::Pose(Eigen::Translation3f(0, 1000, 0)),
//
armarx::nav::core::Pose(Eigen::Translation3f(0, 2000, 0))};
BOOST_AUTO_TEST_CASE
(
testResampleAlongLineWithWaypoint
)
{
armarx
::
nav
::
core
::
Path
path
{
armarx
::
nav
::
core
::
Pose
(
Eigen
::
Translation3f
(
0
,
0
,
0
)),
armarx
::
nav
::
core
::
Pose
(
Eigen
::
Translation3f
(
0
,
1000
,
0
)),
armarx
::
nav
::
core
::
Pose
(
Eigen
::
Translation3f
(
0
,
2000
,
0
))};
//
const auto traj = armarx::nav::core::Trajectory::FromPath(path, 100);
//
BOOST_CHECK_EQUAL(traj.points().size(), 3);
const
auto
traj
=
armarx
::
nav
::
core
::
Trajectory
::
FromPath
(
path
,
100
);
BOOST_CHECK_EQUAL
(
traj
.
points
().
size
(),
3
);
//
const auto resampledTraj = traj.resample(500);
const
auto
resampledTraj
=
traj
.
resample
(
500
);
//
for (const auto& pt : resampledTraj.positions())
//
{
//
ARMARX_INFO << VAROUT(pt);
//
}
for
(
const
auto
&
pt
:
resampledTraj
.
positions
())
{
ARMARX_INFO
<<
VAROUT
(
pt
);
}
//
BOOST_CHECK_EQUAL(resampledTraj.points().size(), 5);
//
}
BOOST_CHECK_EQUAL
(
resampledTraj
.
points
().
size
(),
5
);
}
This diff is collapsed.
Click to expand it.
source/Navigation/libraries/server/Navigator.cpp
+
9
−
1
View file @
a4380a83
...
...
@@ -191,11 +191,13 @@ namespace armarx::nav::server
if
(
isPaused
()
or
isStopped
())
{
// [[unlikely]]
ARMARX_INFO
<<
deactivateSpam
(
1
)
<<
"stopped or paused"
;
return
;
}
if
(
not
isStackResultValid
())
{
ARMARX_INFO
<<
deactivateSpam
(
1
)
<<
"stack result invalid"
;
// [[unlikely]]
return
;
}
...
...
@@ -305,6 +307,8 @@ namespace armarx::nav::server
void
Navigator
::
pause
()
{
ARMARX_INFO
<<
"pause"
;
executorEnabled
.
store
(
false
);
ARMARX_CHECK_NOT_NULL
(
config
.
executor
);
...
...
@@ -314,12 +318,16 @@ namespace armarx::nav::server
void
Navigator
::
resume
()
{
ARMARX_INFO
<<
"resume"
;
executorEnabled
.
store
(
true
);
}
void
Navigator
::
stop
()
{
ARMARX_INFO
<<
"stop"
;
pause
();
// TODO: Reset own state.
}
...
...
@@ -327,7 +335,7 @@ namespace armarx::nav::server
bool
Navigator
::
isPaused
()
const
noexcept
{
return
executorEnabled
.
load
();
return
not
executorEnabled
.
load
();
}
bool
...
...
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