mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 02:13:33 +08:00
@@ -458,7 +458,7 @@ void
|
|||||||
Navigator::publish_position_setpoint_triplet()
|
Navigator::publish_position_setpoint_triplet()
|
||||||
{
|
{
|
||||||
/* update navigation state */
|
/* update navigation state */
|
||||||
/* TODO: set nav_state */
|
_pos_sp_triplet.nav_state = _vstatus.nav_state;
|
||||||
|
|
||||||
/* lazily publish the position setpoint triplet only once available */
|
/* lazily publish the position setpoint triplet only once available */
|
||||||
if (_pos_sp_triplet_pub > 0) {
|
if (_pos_sp_triplet_pub > 0) {
|
||||||
|
|||||||
+14
-11
@@ -1432,17 +1432,20 @@ int sdlog2_thread_main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* --- GLOBAL POSITION SETPOINT --- */
|
/* --- GLOBAL POSITION SETPOINT --- */
|
||||||
if (copy_if_updated(ORB_ID(position_setpoint_triplet), subs.triplet_sub, &buf.triplet)) {
|
if (copy_if_updated(ORB_ID(position_setpoint_triplet), subs.triplet_sub, &buf.triplet)) {
|
||||||
log_msg.msg_type = LOG_GPSP_MSG;
|
|
||||||
log_msg.body.log_GPSP.nav_state = 0; /* TODO: Fix this */
|
if (buf.triplet.current.valid) {
|
||||||
log_msg.body.log_GPSP.lat = (int32_t)(buf.triplet.current.lat * 1e7d);
|
log_msg.msg_type = LOG_GPSP_MSG;
|
||||||
log_msg.body.log_GPSP.lon = (int32_t)(buf.triplet.current.lon * 1e7d);
|
log_msg.body.log_GPSP.nav_state = buf.triplet.nav_state;
|
||||||
log_msg.body.log_GPSP.alt = buf.triplet.current.alt;
|
log_msg.body.log_GPSP.lat = (int32_t)(buf.triplet.current.lat * 1e7d);
|
||||||
log_msg.body.log_GPSP.yaw = buf.triplet.current.yaw;
|
log_msg.body.log_GPSP.lon = (int32_t)(buf.triplet.current.lon * 1e7d);
|
||||||
log_msg.body.log_GPSP.type = buf.triplet.current.type;
|
log_msg.body.log_GPSP.alt = buf.triplet.current.alt;
|
||||||
log_msg.body.log_GPSP.loiter_radius = buf.triplet.current.loiter_radius;
|
log_msg.body.log_GPSP.yaw = buf.triplet.current.yaw;
|
||||||
log_msg.body.log_GPSP.loiter_direction = buf.triplet.current.loiter_direction;
|
log_msg.body.log_GPSP.type = buf.triplet.current.type;
|
||||||
log_msg.body.log_GPSP.pitch_min = buf.triplet.current.pitch_min;
|
log_msg.body.log_GPSP.loiter_radius = buf.triplet.current.loiter_radius;
|
||||||
LOGBUFFER_WRITE_AND_COUNT(GPSP);
|
log_msg.body.log_GPSP.loiter_direction = buf.triplet.current.loiter_direction;
|
||||||
|
log_msg.body.log_GPSP.pitch_min = buf.triplet.current.pitch_min;
|
||||||
|
LOGBUFFER_WRITE_AND_COUNT(GPSP);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- VICON POSITION --- */
|
/* --- VICON POSITION --- */
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ struct position_setpoint_triplet_s
|
|||||||
struct position_setpoint_s previous;
|
struct position_setpoint_s previous;
|
||||||
struct position_setpoint_s current;
|
struct position_setpoint_s current;
|
||||||
struct position_setpoint_s next;
|
struct position_setpoint_s next;
|
||||||
|
|
||||||
|
unsigned nav_state; /**< report the navigation state */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user