本文整理汇总了C++中AP_AHRS类的典型用法代码示例。如果您正苦于以下问题:C++ AP_AHRS类的具体用法?C++ AP_AHRS怎么用?C++ AP_AHRS使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AP_AHRS类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: send_ahrs
void GCS_MAVLINK::send_ahrs(AP_AHRS &ahrs)
{
const Vector3f &omega_I = ahrs.get_gyro_drift();
mavlink_msg_ahrs_send(
chan,
omega_I.x,
omega_I.y,
omega_I.z,
0,
0,
ahrs.get_error_rp(),
ahrs.get_error_yaw());
}
示例2:
// report AHRS2 state
void GCS_MAVLINK::send_ahrs2(AP_AHRS &ahrs)
{
#if AP_AHRS_NAVEKF_AVAILABLE
Vector3f euler;
struct Location loc;
if (ahrs.get_secondary_attitude(euler) && ahrs.get_secondary_position(loc)) {
mavlink_msg_ahrs2_send(chan,
euler.x,
euler.y,
euler.z,
loc.alt*1.0e-2f,
loc.lat,
loc.lng);
}
#endif
}
示例3: mavlink_msg_ahrs2_send
// report AHRS2 state
void GCS_MAVLINK::send_ahrs2(AP_AHRS &ahrs)
{
#if AP_AHRS_NAVEKF_AVAILABLE
Vector3f euler;
struct Location loc {};
if (ahrs.get_secondary_attitude(euler)) {
mavlink_msg_ahrs2_send(chan,
euler.x,
euler.y,
euler.z,
loc.alt*1.0e-2f,
loc.lat,
loc.lng);
}
AP_AHRS_NavEKF &_ahrs = reinterpret_cast<AP_AHRS_NavEKF&>(ahrs);
if (_ahrs.get_NavEKF2().activeCores() > 0) {
_ahrs.get_NavEKF2().getLLH(loc);
_ahrs.get_NavEKF2().getEulerAngles(-1,euler);
mavlink_msg_ahrs3_send(chan,
euler.x,
euler.y,
euler.z,
loc.alt*1.0e-2f,
loc.lat,
loc.lng,
0, 0, 0, 0);
}
#endif
}
示例4: send_feedback
/*
Send camera feedback to the GCS
*/
void AP_Camera::send_feedback(mavlink_channel_t chan, AP_GPS &gps, const AP_AHRS &ahrs, const Location ¤t_loc)
{
float altitude, altitude_rel;
if (current_loc.flags.relative_alt) {
altitude = current_loc.alt+ahrs.get_home().alt;
altitude_rel = current_loc.alt;
} else {
altitude = current_loc.alt;
altitude_rel = current_loc.alt - ahrs.get_home().alt;
}
mavlink_msg_camera_feedback_send(chan,
gps.time_epoch_usec(),
0, 0, _image_index,
current_loc.lat, current_loc.lng,
altitude/100.0f, altitude_rel/100.0f,
ahrs.roll_sensor/100.0f, ahrs.pitch_sensor/100.0f, ahrs.yaw_sensor/100.0f,
0.0f,CAMERA_FEEDBACK_PHOTO);
}
示例5: send_local_position
/*
send LOCAL_POSITION_NED message
*/
void GCS_MAVLINK::send_local_position(const AP_AHRS &ahrs) const
{
Vector3f local_position, velocity;
if (!ahrs.get_relative_position_NED(local_position) ||
!ahrs.get_velocity_NED(velocity)) {
// we don't know the position and velocity
return;
}
mavlink_msg_local_position_ned_send(
chan,
hal.scheduler->millis(),
local_position.x,
local_position.y,
local_position.z,
velocity.x,
velocity.y,
velocity.z);
}