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
d3ed7738
Commit
d3ed7738
authored
7 years ago
by
Daniel Agar
Committed by
Nuno Marques
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
sensors coverity fix 143426
parent
086ddf50
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/sensors/sensors.cpp
+17
-37
17 additions, 37 deletions
src/modules/sensors/sensors.cpp
with
17 additions
and
37 deletions
src/modules/sensors/sensors.cpp
+
17
−
37
View file @
d3ed7738
...
...
@@ -157,39 +157,39 @@ public:
private
:
DevHandle
_h_adc
;
/**< ADC driver handle */
hrt_abstime
_last_adc
;
/**< last time we took input from the ADC */
hrt_abstime
_last_adc
{
0
}
;
/**< last time we took input from the ADC */
const
bool
_hil_enabled
;
/**< if true, HIL is active */
bool
_armed
;
/**< arming status of the vehicle */
bool
_armed
{
false
}
;
/**< arming status of the vehicle */
int
_actuator_ctrl_0_sub
;
/**< attitude controls sub */
int
_diff_pres_sub
;
/**< raw differential pressure subscription */
int
_vcontrol_mode_sub
;
/**< vehicle control mode subscription */
int
_params_sub
;
/**< notification of parameter updates */
int
_actuator_ctrl_0_sub
{
-
1
}
;
/**< attitude controls sub */
int
_diff_pres_sub
{
-
1
}
;
/**< raw differential pressure subscription */
int
_vcontrol_mode_sub
{
-
1
}
;
/**< vehicle control mode subscription */
int
_params_sub
{
-
1
}
;
/**< notification of parameter updates */
orb_advert_t
_sensor_pub
;
/**< combined sensor data topic */
orb_advert_t
_battery_pub
[
BOARD_NUMBER_BRICKS
]
=
{
nullptr
};
/**< battery status */
orb_advert_t
_sensor_pub
{
nullptr
}
;
/**< combined sensor data topic */
orb_advert_t
_battery_pub
[
BOARD_NUMBER_BRICKS
]
{
};
/**< battery status */
#if BOARD_NUMBER_BRICKS > 1
int
_battery_pub_intance0ndx
=
0
;
/**< track the index of instance 0 */
int
_battery_pub_intance0ndx
{
0
}
;
/**< track the index of instance 0 */
#endif
orb_advert_t
_airspeed_pub
;
/**< airspeed */
orb_advert_t
_diff_pres_pub
;
/**< differential_pressure */
orb_advert_t
_sensor_preflight
;
/**< sensor preflight topic */
orb_advert_t
_airspeed_pub
{
nullptr
}
;
/**< airspeed */
orb_advert_t
_diff_pres_pub
{
nullptr
}
;
/**< differential_pressure */
orb_advert_t
_sensor_preflight
{
nullptr
}
;
/**< sensor preflight topic */
perf_counter_t
_loop_perf
;
/**< loop performance counter */
DataValidator
_airspeed_validator
;
/**< data validator to monitor airspeed */
struct
battery_status_s
_battery_status
[
BOARD_NUMBER_BRICKS
];
/**< battery status */
struct
differential_pressure_s
_diff_pres
;
struct
airspeed_s
_airspeed
;
battery_status_s
_battery_status
[
BOARD_NUMBER_BRICKS
]
{}
;
/**< battery status */
differential_pressure_s
_diff_pres
{}
;
airspeed_s
_airspeed
{}
;
Battery
_battery
[
BOARD_NUMBER_BRICKS
];
/**< Helper lib to publish battery_status topic. */
Parameters
_parameters
;
/**< local copies of interesting parameters */
ParameterHandles
_parameter_handles
;
/**< handles for interesting parameters */
Parameters
_parameters
{}
;
/**< local copies of interesting parameters */
ParameterHandles
_parameter_handles
{}
;
/**< handles for interesting parameters */
RCUpdate
_rc_update
;
VotedSensorsUpdate
_voted_sensors_update
;
...
...
@@ -233,31 +233,11 @@ private:
};
Sensors
::
Sensors
(
bool
hil_enabled
)
:
_last_adc
(
0
),
_hil_enabled
(
hil_enabled
),
_armed
(
false
),
_actuator_ctrl_0_sub
(
-
1
),
_diff_pres_sub
(
-
1
),
_vcontrol_mode_sub
(
-
1
),
_params_sub
(
-
1
),
/* publications */
_sensor_pub
(
nullptr
),
_airspeed_pub
(
nullptr
),
_diff_pres_pub
(
nullptr
),
_sensor_preflight
(
nullptr
),
/* performance counters */
_loop_perf
(
perf_alloc
(
PC_ELAPSED
,
"sensors"
)),
_rc_update
(
_parameters
),
_voted_sensors_update
(
_parameters
,
hil_enabled
)
{
memset
(
&
_diff_pres
,
0
,
sizeof
(
_diff_pres
));
memset
(
&
_parameters
,
0
,
sizeof
(
_parameters
));
initialize_parameter_handles
(
_parameter_handles
);
_airspeed_validator
.
set_timeout
(
300000
);
...
...
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