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
0ef5d892
Commit
0ef5d892
authored
7 years ago
by
Daniel Agar
Browse files
Options
Downloads
Patches
Plain Diff
navigator precland initialize all fields
- fixes coverity CID 264259
parent
ed261c76
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/modules/navigator/precland.cpp
+2
-15
2 additions, 15 deletions
src/modules/navigator/precland.cpp
src/modules/navigator/precland.h
+17
-17
17 additions, 17 deletions
src/modules/navigator/precland.h
with
19 additions
and
32 deletions
src/modules/navigator/precland.cpp
+
2
−
15
View file @
0ef5d892
...
...
@@ -61,18 +61,7 @@
PrecLand
::
PrecLand
(
Navigator
*
navigator
)
:
MissionBlock
(
navigator
),
ModuleParams
(
navigator
),
_targetPoseSub
(
0
),
_target_pose_valid
(
false
),
_state_start_time
(
0
),
_search_cnt
(
0
),
_approach_alt
(
0
)
{
}
void
PrecLand
::
on_inactive
()
ModuleParams
(
navigator
)
{
}
...
...
@@ -127,7 +116,7 @@ PrecLand::on_active()
_target_pose_valid
=
true
;
}
if
(
hrt_
absolute
_time
(
)
-
_target_pose
.
timestamp
>
(
uint64_t
)(
_param_timeout
.
get
()
*
SEC2USEC
)
)
{
if
(
(
hrt_
elapsed
_time
(
&
_target_pose
.
timestamp
)
/
1e-6
f
)
>
_param_timeout
.
get
())
{
_target_pose_valid
=
false
;
}
...
...
@@ -278,7 +267,6 @@ PrecLand::run_state_horizontal_approach()
pos_sp_triplet
->
current
.
type
=
position_setpoint_s
::
SETPOINT_TYPE_POSITION
;
_navigator
->
set_position_setpoint_triplet_updated
();
}
void
...
...
@@ -316,7 +304,6 @@ PrecLand::run_state_descend_above_target()
pos_sp_triplet
->
current
.
type
=
position_setpoint_s
::
SETPOINT_TYPE_LAND
;
_navigator
->
set_position_setpoint_triplet_updated
();
}
void
...
...
This diff is collapsed.
Click to expand it.
src/modules/navigator/precland.h
+
17
−
17
View file @
0ef5d892
...
...
@@ -67,14 +67,10 @@ class PrecLand : public MissionBlock, public ModuleParams
{
public:
PrecLand
(
Navigator
*
navigator
);
~
PrecLand
()
override
=
default
;
~
PrecLand
()
=
default
;
virtual
void
on_inactive
();
virtual
void
on_activation
();
virtual
void
on_active
();
void
on_activation
()
override
;
void
on_active
()
override
;
void
set_mode
(
PrecLandMode
mode
)
{
_mode
=
mode
;
};
...
...
@@ -103,22 +99,26 @@ private:
void
slewrate
(
float
&
sp_x
,
float
&
sp_y
);
landing_target_pose_s
_target_pose
{};
/**< precision landing target position */
int
_targetPoseSub
;
bool
_target_pose_valid
;
/**< wether we have received a landing target position message */
int
_targetPoseSub
{
-
1
};
bool
_target_pose_valid
{
false
};
/**< wether we have received a landing target position message */
struct
map_projection_reference_s
_map_ref
{};
/**< reference for local/global projections */
uint64_t
_state_start_time
;
/**< time when we entered current state */
uint64_t
_last_slewrate_time
;
/**< time when we last limited setpoint changes */
uint64_t
_target_acquired_time
;
/**< time when we first saw the landing target during search */
uint64_t
_point_reached_time
;
/**< time when we reached a setpoint */
int
_search_cnt
;
/**< counter of how many times we had to search for the landing target */
float
_approach_alt
;
/**< altitude at which to stay during horizontal approach */
uint64_t
_state_start_time
{
0
};
/**< time when we entered current state */
uint64_t
_last_slewrate_time
{
0
};
/**< time when we last limited setpoint changes */
uint64_t
_target_acquired_time
{
0
};
/**< time when we first saw the landing target during search */
uint64_t
_point_reached_time
{
0
};
/**< time when we reached a setpoint */
int
_search_cnt
{
0
};
/**< counter of how many times we had to search for the landing target */
float
_approach_alt
{
0.0
f
};
/**< altitude at which to stay during horizontal approach */
matrix
::
Vector2f
_sp_pev
;
matrix
::
Vector2f
_sp_pev_prev
;
PrecLandState
_state
;
PrecLandState
_state
{
PrecLandState
::
Start
}
;
PrecLandMode
_mode
;
PrecLandMode
_mode
{
PrecLandMode
::
Opportunistic
}
;
DEFINE_PARAMETERS
(
(
ParamFloat
<
px4
::
params
::
PLD_BTOUT
>
)
_param_timeout
,
...
...
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