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
bfa269f6
Commit
bfa269f6
authored
2 years ago
by
Corvin-N
Browse files
Options
Downloads
Patches
Plain Diff
Add oldHuman to be able to call propagation multiple times between two update calls
parent
44fbd12c
No related branches found
No related tags found
3 merge requests
!68
Add human tracking
,
!53
Draft: Implement basic version of kalman filter for human tracking
,
!28
Draft: Dev -> Main
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/armarx/navigation/human/HumanFilter.cpp
+5
-3
5 additions, 3 deletions
source/armarx/navigation/human/HumanFilter.cpp
source/armarx/navigation/human/HumanFilter.h
+10
-2
10 additions, 2 deletions
source/armarx/navigation/human/HumanFilter.h
with
15 additions
and
5 deletions
source/armarx/navigation/human/HumanFilter.cpp
+
5
−
3
View file @
bfa269f6
...
...
@@ -40,18 +40,18 @@ namespace armarx::navigation::human
HumanFilter
::
propagation
(
const
armarx
::
core
::
time
::
DateTime
&
detectionTime
)
{
double
dt
=
(
detectionTime
-
human
.
detectionTime
).
toSecondsDouble
();
oldPose
=
human
.
pose
;
SystemModelT
::
ControlT
control
=
toUkfControl
(
human
.
linearVelocity
);
ukf
->
propagation
(
control
,
dt
);
human
.
pose
=
fromUkfState
(
ukf
->
getCurrentState
());
human
.
detectionTime
=
detectionTime
;
}
void
HumanFilter
::
update
(
const
core
::
Pose2D
&
pose
,
const
DateTime
&
detectionTime
)
{
double
dt
=
(
detectionTime
-
h
uman
.
detectionTime
).
toSecondsDouble
();
double
dt
=
(
detectionTime
-
oldH
uman
.
detectionTime
).
toSecondsDouble
();
//update ukf with new observation
SystemModelT
::
ObsT
observation
=
toUkfObs
(
pose
);
...
...
@@ -60,7 +60,7 @@ namespace armarx::navigation::human
core
::
Pose2D
newPose
=
fromUkfState
(
ukf
->
getCurrentState
());
// calculate velocity
Eigen
::
Vector2f
ds
=
newPose
.
translation
()
-
old
P
ose
.
translation
();
Eigen
::
Vector2f
ds
=
newPose
.
translation
()
-
old
Human
.
p
ose
.
translation
();
Eigen
::
Vector2f
linVelocity
=
ds
/
dt
;
// apply exponential smoothing to velocity
//TODO try other approaches?
...
...
@@ -71,6 +71,8 @@ namespace armarx::navigation::human
human
.
detectionTime
=
detectionTime
;
human
.
pose
=
newPose
;
human
.
linearVelocity
=
newVelocity
;
oldHuman
=
human
;
}
const
Human
&
...
...
This diff is collapsed.
Click to expand it.
source/armarx/navigation/human/HumanFilter.h
+
10
−
2
View file @
bfa269f6
...
...
@@ -64,7 +64,7 @@ namespace armarx::navigation::human
/**
* @brief HumanFilter::propagation propagate the system model to the given point in time. This
* means that the human pose is updated according to the filters prediction for the given point
* in time
* in time
. Should be called at most once between every two calls of HumanFilter::update.
* @param detectionTime the point in time for which the pose should be predicted
*/
void
propagation
(
const
DateTime
&
detectionTime
);
...
...
@@ -92,7 +92,15 @@ namespace armarx::navigation::human
private
:
Parameters
params
;
core
::
Pose2D
oldPose
;
/**
* @brief oldHuman stores information about the human at the point in time of the last
* HumanFilter::update call
*/
Human
oldHuman
;
/**
* @brief human stores information about the human at the point in time of the last
* HumanFilter::propagation call
*/
Human
human
;
std
::
unique_ptr
<
UnscentedKalmanFilter
<
SystemModelT
>>
ukf
;
};
...
...
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