move position of spin_once in publisher example

This commit is contained in:
Thomas Gubler
2015-01-23 18:11:44 +01:00
parent a36d0dce85
commit aa7e5ddb38
+3 -2
View File
@@ -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;