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
dbb222e6
Commit
dbb222e6
authored
6 years ago
by
Dennis Mannhart
Committed by
Lorenz Meier
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
FlightTaskAutoLine: set landing constraints and reset constraints
parent
4d6539b0
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/FlightTaskAutoLine.cpp
+11
-2
11 additions, 2 deletions
src/lib/FlightTasks/tasks/FlightTaskAutoLine.cpp
src/lib/FlightTasks/tasks/FlightTaskAutoLine.hpp
+3
-1
3 additions, 1 deletion
src/lib/FlightTasks/tasks/FlightTaskAutoLine.hpp
with
14 additions
and
3 deletions
src/lib/FlightTasks/tasks/FlightTaskAutoLine.cpp
+
11
−
2
View file @
dbb222e6
...
...
@@ -52,6 +52,9 @@ bool FlightTaskAutoLine::activate()
bool
FlightTaskAutoLine
::
update
()
{
// always reset constraints because they might change depending on the type
_setDefaultConstraints
();
bool
follow_line
=
_type
==
WaypointType
::
loiter
||
_type
==
WaypointType
::
position
;
bool
follow_line_prev
=
_type_previous
==
WaypointType
::
loiter
||
_type_previous
==
WaypointType
::
position
;
...
...
@@ -131,6 +134,9 @@ void FlightTaskAutoLine::_generateLandSetpoints()
// Keep xy-position and go down with landspeed. */
_position_setpoint
=
Vector3f
(
_target
(
0
),
_target
(
1
),
NAN
);
_velocity_setpoint
=
Vector3f
(
Vector3f
(
NAN
,
NAN
,
MPC_LAND_SPEED
.
get
()));
// set constraints
_constraints
.
tilt
=
MPC_TILTMAX_LND
.
get
();
_constraints
.
speed_down
=
MPC_LAND_SPEED
.
get
();
}
void
FlightTaskAutoLine
::
_generateTakeoffSetpoints
()
...
...
@@ -138,6 +144,9 @@ void FlightTaskAutoLine::_generateTakeoffSetpoints()
// Takeoff is completely defined by target position. */
_position_setpoint
=
_target
;
_velocity_setpoint
=
Vector3f
(
NAN
,
NAN
,
NAN
);
// set constraints
_constraints
.
speed_up
=
MPC_TKO_SPEED
.
get
();
}
void
FlightTaskAutoLine
::
_generateVelocitySetpoints
()
...
...
@@ -396,11 +405,11 @@ void FlightTaskAutoLine::_generateAltitudeSetpoints()
// for now we use the altitude above home and assume that we want to land at same height as we took off
float
vel_limit
=
math
::
gradual
(
_alt_above_ground
,
MPC_LAND_ALT2
.
get
(),
MPC_LAND_ALT1
.
get
(),
MPC_LAND_SPEED
.
get
(),
_
limi
ts
.
speed_d
n_max
);
MPC_LAND_SPEED
.
get
(),
_
constrain
ts
.
speed_d
own
);
// Speed at threshold is by default maximum speed. Threshold defines
// the point in z at which vehicle slows down to reach target altitude.
float
speed_sp
=
(
flying_upward
)
?
_
limi
ts
.
speed_up
_max
:
vel_limit
;
float
speed_sp
=
(
flying_upward
)
?
_
constrain
ts
.
speed_up
:
vel_limit
;
// Target threshold defines the distance to target(2) at which
// the vehicle starts to slow down to approach the target smoothly.
...
...
This diff is collapsed.
Click to expand it.
src/lib/FlightTasks/tasks/FlightTaskAutoLine.hpp
+
3
−
1
View file @
dbb222e6
...
...
@@ -74,7 +74,9 @@ protected:
(
ParamFloat
<
px4
::
params
::
MPC_LAND_ALT2
>
)
MPC_LAND_ALT2
,
// altitude at which speed limit downwards reached minimum speed
(
ParamFloat
<
px4
::
params
::
MPC_ACC_UP_MAX
>
)
MPC_ACC_UP_MAX
,
(
ParamFloat
<
px4
::
params
::
MPC_ACC_DOWN_MAX
>
)
MPC_ACC_DOWN_MAX
,
(
ParamFloat
<
px4
::
params
::
MPC_ACC_HOR
>
)
MPC_ACC_HOR
// acceleration in flight
(
ParamFloat
<
px4
::
params
::
MPC_ACC_HOR
>
)
MPC_ACC_HOR
,
// acceleration in flight
(
ParamFloat
<
px4
::
params
::
MPC_TILTMAX_LND
>
)
MPC_TILTMAX_LND
,
(
ParamFloat
<
px4
::
params
::
MPC_TKO_SPEED
>
)
MPC_TKO_SPEED
)
void
_generateIdleSetpoints
();
...
...
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