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
e6391189
Commit
e6391189
authored
8 years ago
by
Beat Küng
Browse files
Options
Downloads
Patches
Plain Diff
px4_simple_app: update printf to latest format version
parent
0da44b71
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/examples/px4_simple_app/px4_simple_app.c
+6
-6
6 additions, 6 deletions
src/examples/px4_simple_app/px4_simple_app.c
with
6 additions
and
6 deletions
src/examples/px4_simple_app/px4_simple_app.c
+
6
−
6
View file @
e6391189
/****************************************************************************
*
* Copyright (c) 2012-201
5
PX4 Development Team. All rights reserved.
* Copyright (c) 2012-201
6
PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
@@ -58,7 +58,8 @@ int px4_simple_app_main(int argc, char *argv[])
/* subscribe to sensor_combined topic */
int
sensor_sub_fd
=
orb_subscribe
(
ORB_ID
(
sensor_combined
));
orb_set_interval
(
sensor_sub_fd
,
1000
);
/* limit the update rate to 5 Hz */
orb_set_interval
(
sensor_sub_fd
,
200
);
/* advertise attitude topic */
struct
vehicle_attitude_s
att
;
...
...
@@ -82,14 +83,13 @@ int px4_simple_app_main(int argc, char *argv[])
/* handle the poll result */
if
(
poll_ret
==
0
)
{
/* this means none of our providers is giving us data */
PX4_ERR
(
"
[px4_simple_app]
Got no data within a second"
);
PX4_ERR
(
"Got no data within a second"
);
}
else
if
(
poll_ret
<
0
)
{
/* this is seriously bad - should be an emergency */
if
(
error_counter
<
10
||
error_counter
%
50
==
0
)
{
/* use a counter to prevent flooding (and slowing us down) */
PX4_ERR
(
"[px4_simple_app] ERROR return value from poll(): %d"
,
poll_ret
);
PX4_ERR
(
"ERROR return value from poll(): %d"
,
poll_ret
);
}
error_counter
++
;
...
...
@@ -101,7 +101,7 @@ int px4_simple_app_main(int argc, char *argv[])
struct
sensor_combined_s
raw
;
/* copy sensors raw data into local buffer */
orb_copy
(
ORB_ID
(
sensor_combined
),
sensor_sub_fd
,
&
raw
);
PX4_
WARN
(
"[px4_simple_app]
Accelerometer:
\t
%8.4f
\t
%8.4f
\t
%8.4f"
,
PX4_
INFO
(
"
Accelerometer:
\t
%8.4f
\t
%8.4f
\t
%8.4f"
,
(
double
)
raw
.
accelerometer_m_s2
[
0
],
(
double
)
raw
.
accelerometer_m_s2
[
1
],
(
double
)
raw
.
accelerometer_m_s2
[
2
]);
...
...
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