aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2015-01-23 18:11:44 +0100
committerThomas Gubler <thomasgubler@gmail.com>2015-01-23 18:11:44 +0100
commitaa7e5ddb388e5d382b3dc214de6a1581c2a2fe71 (patch)
treef90f5ba1a5d1883b5ef3f97fdfefe9c3902e1546
parenta36d0dce85868f35ad9c4e097f5b788e84d7d18f (diff)
downloadpx4-firmware-aa7e5ddb388e5d382b3dc214de6a1581c2a2fe71.tar.gz
px4-firmware-aa7e5ddb388e5d382b3dc214de6a1581c2a2fe71.tar.bz2
px4-firmware-aa7e5ddb388e5d382b3dc214de6a1581c2a2fe71.zip
move position of spin_once in publisher example
-rw-r--r--src/examples/publisher/publisher_example.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/examples/publisher/publisher_example.cpp b/src/examples/publisher/publisher_example.cpp
index 6b30c2fe3..9952a16e4 100644
--- a/src/examples/publisher/publisher_example.cpp
+++ b/src/examples/publisher/publisher_example.cpp
@@ -54,13 +54,14 @@ int PublisherExample::main()
px4::Rate loop_rate(10);
while (px4::ok()) {
+ loop_rate.sleep();
+ _n.spinOnce();
+
px4_rc_channels msg;
msg.data().timestamp_last_valid = px4::get_time_micros();
PX4_INFO("%llu", msg.data().timestamp_last_valid);
_rc_channels_pub->publish(msg);
- _n.spinOnce();
- loop_rate.sleep();
}
return 0;