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
a24b614d
Commit
a24b614d
authored
6 years ago
by
Dennis Mannhart
Browse files
Options
Downloads
Patches
Plain Diff
FlightTaskAutoLine: generate heading along track if yaw setpoint is not valid
parent
e0f505ec
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
+16
-0
16 additions, 0 deletions
src/lib/FlightTasks/tasks/FlightTaskAutoLine.cpp
src/lib/FlightTasks/tasks/FlightTaskAutoLine.hpp
+1
-0
1 addition, 0 deletions
src/lib/FlightTasks/tasks/FlightTaskAutoLine.hpp
with
17 additions
and
0 deletions
src/lib/FlightTasks/tasks/FlightTaskAutoLine.cpp
+
16
−
0
View file @
a24b614d
...
...
@@ -44,10 +44,26 @@ static constexpr float SIGMA_NORM = 0.001f;
void
FlightTaskAutoLine
::
_generateSetpoints
()
{
if
(
!
PX4_ISFINITE
(
_yaw_setpoint
))
{
// no valid heading -> set heading along track
_generateHeadingAlongTrack
();
}
_generateAltitudeSetpoints
();
_generateXYsetpoints
();
}
void
FlightTaskAutoLine
::
_generateHeadingAlongTrack
()
{
Vector2f
prev_to_dest
=
Vector2f
(
&
(
_target
-
_prev_wp
)(
0
));
if
(
!
_compute_heading_from_2D_vector
(
_yaw_setpoint
,
prev_to_dest
))
{
// heading could not be computed. best we can do is to set heading
// to current yaw
_yaw_setpoint
=
_yaw
;
}
}
void
FlightTaskAutoLine
::
_generateXYsetpoints
()
{
Vector2f
pos_sp_to_dest
=
Vector2f
(
&
(
_target
-
_position_setpoint
)(
0
));
...
...
This diff is collapsed.
Click to expand it.
src/lib/FlightTasks/tasks/FlightTaskAutoLine.hpp
+
1
−
0
View file @
a24b614d
...
...
@@ -59,6 +59,7 @@ protected:
void
_generateSetpoints
()
override
;
/**< Generate setpoints along line. */
void
_generateHeadingAlongTrack
();
/**< Generates heading along track. */
void
_generateAltitudeSetpoints
();
/**< Generate velocity and position setpoints for following line along z. */
void
_generateXYsetpoints
();
/**< Generate velocity and position setpoints for following line along xy. */
};
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