forked from Archive/PX4-Autopilot
Merge remote-tracking branch 'upstream/master' into new_state_machine
Conflicts: src/modules/sdlog2/sdlog2.c src/modules/sdlog2/sdlog2_messages.h
This commit is contained in:
commit
f052442c2b
|
@ -695,6 +695,7 @@ int sdlog2_thread_main(int argc, char *argv[])
|
|||
struct log_OUT0_s log_OUT0;
|
||||
struct log_AIRS_s log_AIRS;
|
||||
struct log_ARSP_s log_ARSP;
|
||||
struct log_FLOW_s log_FLOW;
|
||||
} body;
|
||||
} log_msg = {
|
||||
LOG_PACKET_HEADER_INIT(0)
|
||||
|
@ -1131,10 +1132,13 @@ int sdlog2_thread_main(int argc, char *argv[])
|
|||
if (fds[ifds++].revents & POLLIN) {
|
||||
orb_copy(ORB_ID(optical_flow), subs.flow_sub, &buf.flow);
|
||||
log_msg.msg_type = LOG_FLOW_MSG;
|
||||
log_msg.body.log_FLOW.flow_comp_x_m = buf.flow.flow_comp_x_m;
|
||||
log_msg.body.log_FLOW.flow_comp_y_m = buf.flow.flow_comp_y_m;
|
||||
log_msg.body.log_FLOW.ground_distance_m = buf.flow.ground_distance_m;
|
||||
log_msg.body.log_FLOW.flow_raw_x = buf.flow.flow_raw_x;
|
||||
log_msg.body.log_FLOW.flow_raw_y = buf.flow.flow_raw_y;
|
||||
log_msg.body.log_FLOW.flow_comp_x = buf.flow.flow_comp_x_m;
|
||||
log_msg.body.log_FLOW.flow_comp_y = buf.flow.flow_comp_y_m;
|
||||
log_msg.body.log_FLOW.distance = buf.flow.ground_distance_m;
|
||||
log_msg.body.log_FLOW.quality = buf.flow.quality;
|
||||
log_msg.body.log_FLOW.sensor_id = buf.flow.sensor_id;
|
||||
LOGBUFFER_WRITE_AND_COUNT(FLOW);
|
||||
}
|
||||
|
||||
|
|
|
@ -207,13 +207,16 @@ struct log_ARSP_s {
|
|||
float yaw_rate_sp;
|
||||
};
|
||||
|
||||
/* --- FLOW - FLOW DATA --- */
|
||||
/* --- FLOW - OPTICAL FLOW --- */
|
||||
#define LOG_FLOW_MSG 16
|
||||
struct log_FLOW_s {
|
||||
float flow_comp_x_m;
|
||||
float flow_comp_y_m;
|
||||
float ground_distance_m;
|
||||
int16_t flow_raw_x;
|
||||
int16_t flow_raw_y;
|
||||
float flow_comp_x;
|
||||
float flow_comp_y;
|
||||
float distance;
|
||||
uint8_t quality;
|
||||
uint8_t sensor_id;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
|
@ -235,7 +238,7 @@ static const struct log_format_s log_formats[] = {
|
|||
LOG_FORMAT(OUT0, "ffffffff", "Out0,Out1,Out2,Out3,Out4,Out5,Out6,Out7"),
|
||||
LOG_FORMAT(AIRS, "ff", "IndSpeed,TrueSpeed"),
|
||||
LOG_FORMAT(ARSP, "fff", "RollRateSP,PitchRateSP,YawRateSP"),
|
||||
LOG_FORMAT(FLOW, "fffB", "FlowX,FlowY,SonAlt,FQual")
|
||||
LOG_FORMAT(FLOW, "hhfffBB", "RawX,RawY,CompX,CompY,Dist,Q,SensID"),
|
||||
};
|
||||
|
||||
static const int log_formats_num = sizeof(log_formats) / sizeof(struct log_format_s);
|
||||
|
|
|
@ -57,8 +57,8 @@ struct optical_flow_s {
|
|||
|
||||
uint64_t timestamp; /**< in microseconds since system start */
|
||||
|
||||
uint16_t flow_raw_x; /**< flow in pixels in X direction, not rotation-compensated */
|
||||
uint16_t flow_raw_y; /**< flow in pixels in Y direction, not rotation-compensated */
|
||||
int16_t flow_raw_x; /**< flow in pixels in X direction, not rotation-compensated */
|
||||
int16_t flow_raw_y; /**< flow in pixels in Y direction, not rotation-compensated */
|
||||
float flow_comp_x_m; /**< speed over ground in meters, rotation-compensated */
|
||||
float flow_comp_y_m; /**< speed over ground in meters, rotation-compensated */
|
||||
float ground_distance_m; /**< Altitude / distance to ground in meters */
|
||||
|
|
Loading…
Reference in New Issue