Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
b9cf4dfb
Commit
b9cf4dfb
authored
6 years ago
by
bresch
Committed by
Beat Küng
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
VelocitySmoothing - Get rid of math.h, math.cpp and px4_defines dependencies
parent
ddab0ccd
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
src/lib/FlightTasks/tasks/Utility/VelocitySmoothing.cpp
+6
-8
6 additions, 8 deletions
src/lib/FlightTasks/tasks/Utility/VelocitySmoothing.cpp
src/lib/FlightTasks/tasks/Utility/VelocitySmoothing.hpp
+4
-3
4 additions, 3 deletions
src/lib/FlightTasks/tasks/Utility/VelocitySmoothing.hpp
with
10 additions
and
11 deletions
src/lib/FlightTasks/tasks/Utility/VelocitySmoothing.cpp
+
6
−
8
View file @
b9cf4dfb
...
...
@@ -35,8 +35,6 @@
#include
<cstdio>
#include
<float.h>
#include
<math.h>
#include
<px4_defines.h>
#include
<mathlib/mathlib.h>
...
...
@@ -210,22 +208,22 @@ void VelocitySmoothing::updateDurations(float T123)
_max_jerk_T1
=
(
_vel_sp
-
_vel
>
0.
f
)
?
_max_jerk
:
-
_max_jerk
;
// compute increasing acceleration time
if
(
PX4_ISFINITE
(
T123
)
)
{
T1
=
computeT1
(
T123
,
_accel
,
_vel
,
_vel_sp
,
_max_jerk_T1
);
if
(
T123
<
0.
f
)
{
T1
=
computeT1
(
_accel
,
_vel
,
_vel_sp
,
_max_jerk_T1
);
}
else
{
T1
=
computeT1
(
_accel
,
_vel
,
_vel_sp
,
_max_jerk_T1
);
T1
=
computeT1
(
T123
,
_accel
,
_vel
,
_vel_sp
,
_max_jerk_T1
);
}
// compute decreasing acceleration time
T3
=
computeT3
(
T1
,
_accel
,
_max_jerk_T1
);
// compute constant acceleration time
if
(
PX4_ISFINITE
(
T123
)
)
{
T2
=
computeT2
(
T1
23
,
T1
,
T3
);
if
(
T123
<
0.
f
)
{
T2
=
computeT2
(
T1
,
T3
,
_accel
,
_vel
,
_vel_sp
,
_max_jerk_T1
);
}
else
{
T2
=
computeT2
(
T1
,
T3
,
_accel
,
_vel
,
_vel_sp
,
_max_jerk_T1
);
T2
=
computeT2
(
T1
23
,
T1
,
T3
);
}
_T1
=
T1
;
...
...
This diff is collapsed.
Click to expand it.
src/lib/FlightTasks/tasks/Utility/VelocitySmoothing.hpp
+
4
−
3
View file @
b9cf4dfb
...
...
@@ -33,8 +33,6 @@
#pragma once
#include
<matrix/matrix/math.hpp>
/**
* @class VelocitySmoothing
*
...
...
@@ -115,6 +113,9 @@ public:
static
void
timeSynchronization
(
VelocitySmoothing
*
traj
,
int
n_traj
);
float
getTotalTime
()
const
{
return
_T1
+
_T2
+
_T3
;
}
float
getT1
()
const
{
return
_T1
;
}
float
getT2
()
const
{
return
_T2
;
}
float
getT3
()
const
{
return
_T3
;
}
float
getVelSp
()
const
{
return
_vel_sp
;
}
private
:
...
...
@@ -124,7 +125,7 @@ private:
* @param T123 optional parameter. If set, the total trajectory time will be T123, if not,
* the algorithm optimizes for time.
*/
void
updateDurations
(
float
T123
=
NAN
);
void
updateDurations
(
float
T123
=
-
1.
f
);
/**
* Compute increasing acceleration time
*/
...
...
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