fixed multi subscribing and publishing

removed debugging message

changed to orb_publish_auto
This commit is contained in:
Sebastian Verling
2016-05-22 12:19:47 +02:00
committed by Lorenz Meier
parent 556851a511
commit c1cdef7e63
2 changed files with 11 additions and 27 deletions
+6 -5
View File
@@ -1272,7 +1272,7 @@ int sdlog2_thread_main(int argc, char *argv[])
int local_pos_sp_sub;
int global_pos_sub;
int triplet_sub;
int gps_pos_sub;
int gps_pos_sub[2];
int sat_info_sub;
int att_pos_mocap_sub;
int vision_pos_sub;
@@ -1304,7 +1304,8 @@ int sdlog2_thread_main(int argc, char *argv[])
subs.cmd_sub = -1;
subs.status_sub = -1;
subs.vtol_status_sub = -1;
subs.gps_pos_sub = -1;
subs.gps_pos_sub[0] = -1;
subs.gps_pos_sub[1] = -1;
subs.sensor_sub = -1;
subs.att_sub = -1;
subs.att_sp_sub = -1;
@@ -1369,7 +1370,7 @@ int sdlog2_thread_main(int argc, char *argv[])
if (log_on_start) {
/* check GPS topic to get GPS time */
if (log_name_timestamp) {
if (!copy_if_updated_multi(ORB_ID(vehicle_gps_position), 0, &subs.gps_pos_sub, &buf_gps_pos)) {
if (!copy_if_updated_multi(ORB_ID(vehicle_gps_position), 0, &subs.gps_pos_sub[0], &buf_gps_pos)) {
gps_time_sec = buf_gps_pos.time_utc_usec / 1e6;
}
}
@@ -1483,7 +1484,7 @@ int sdlog2_thread_main(int argc, char *argv[])
}
/* --- GPS POSITION - LOG MANAGEMENT --- */
bool gps_pos_updated = copy_if_updated_multi(ORB_ID(vehicle_gps_position), 0, &subs.gps_pos_sub, &buf_gps_pos);
bool gps_pos_updated = copy_if_updated_multi(ORB_ID(vehicle_gps_position), 0, &subs.gps_pos_sub[0], &buf_gps_pos);
if (gps_pos_updated && log_name_timestamp) {
gps_time_sec = buf_gps_pos.time_utc_usec / 1e6;
@@ -1720,7 +1721,7 @@ int sdlog2_thread_main(int argc, char *argv[])
}
/* --- GPS POSITION - UNIT #2 --- */
if (copy_if_updated_multi(ORB_ID(vehicle_gps_position), 1, &subs.gps_pos_sub, &buf.dual_gps_pos)) {
if (copy_if_updated_multi(ORB_ID(vehicle_gps_position), 1, &subs.gps_pos_sub[1], &buf.dual_gps_pos)) {
log_msg.msg_type = LOG_GPS_MSG;
log_msg.body.log_GPS.gps_time = buf.dual_gps_pos.time_utc_usec;
log_msg.body.log_GPS.fix_type = buf.dual_gps_pos.fix_type;