mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-16 20:56:01 +08:00
test replay / build (replay, base) (push) Waiting to run
test replay / build (replay, clang) (push) Waiting to run
test scripts / build (astyle-cleanliness) (push) Waiting to run
test scripts / build (check_autotest_options) (push) Waiting to run
test scripts / build (logger_metadata) (push) Waiting to run
test scripts / build (param_parse) (push) Waiting to run
test scripts / build (python-cleanliness) (push) Waiting to run
test scripts / build (validate_board_list) (push) Waiting to run
test copter / build (base) (push) Waiting to run
test copter / build (clang) (push) Waiting to run
test copter / autotest (sitltest-copter-tests1a) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests1b) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests1c) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests1d) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests1e) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests2a) (push) Blocked by required conditions
test copter / autotest (sitltest-copter-tests2b) (push) Blocked by required conditions
test copter / build-gcc-heli (push) Waiting to run
test copter / autotest-heli (sitltest-heli) (push) Blocked by required conditions
test unit tests and sitl building / build (examples, base) (push) Waiting to run
test unit tests and sitl building / build (examples, clang) (push) Waiting to run
test unit tests and sitl building / build (sitl, base) (push) Waiting to run
test unit tests and sitl building / build (sitl, clang) (push) Waiting to run
test unit tests and sitl building / build (unit-tests, base) (push) Waiting to run
test unit tests and sitl building / build (unit-tests, clang) (push) Waiting to run
colcon build/test / build-test (push) Has been cancelled
Cygwin Build / build (push) Has been cancelled
ESP32 Build / build (esp32buzz, 10) (push) Has been cancelled
ESP32 Build / build (esp32s3empty, 10) (push) Has been cancelled
Macos Build / build (CubeOrange) (push) Has been cancelled
Macos Build / build (sitl) (push) Has been cancelled
QURT Build / build (push) Has been cancelled
test ccache / build (10, chibios) (push) Has been cancelled
test chibios / build (CubeOrange-ODID, 10, chibios) (push) Has been cancelled
test chibios / build (CubeOrange-PPP, 10, chibios) (push) Has been cancelled
test chibios / build (CubeOrange-bootloader, 10, chibios) (push) Has been cancelled
test chibios / build (CubeRed-EKF2, 10, chibios) (push) Has been cancelled
test chibios / build (CubeRedPrimary-bootloader, 10, chibios) (push) Has been cancelled
test chibios / build (MatekF405-Wing, 10, chibios) (push) Has been cancelled
test chibios / build (Pixhawk6X-PPPGW, 10, chibios) (push) Has been cancelled
test chibios / build (SOHW, 10, chibios) (push) Has been cancelled
test chibios / build (build-options-defaults-test, 10, chibios) (push) Has been cancelled
test chibios / build (configure-all, 10, chibios) (push) Has been cancelled
test chibios / build (fmuv2-plane, 10, chibios) (push) Has been cancelled
test chibios / build (fmuv3, 10, chibios) (push) Has been cancelled
test chibios / build (fmuv3-bootloader, 10, chibios) (push) Has been cancelled
test chibios / build (iofirmware, 10, chibios) (push) Has been cancelled
test chibios / build (new-check, 10, chibios) (push) Has been cancelled
test chibios / build (periph-build, 10, chibios) (push) Has been cancelled
test chibios / build (revo-bootloader, 10, chibios) (push) Has been cancelled
test chibios / build (revo-mini, 10, chibios) (push) Has been cancelled
test chibios / build (signing, 10, chibios) (push) Has been cancelled
test chibios / build (stm32f7, 10, chibios) (push) Has been cancelled
test chibios / build (stm32h7, 10, chibios) (push) Has been cancelled
test chibios / build (stm32h7-debug, 10, chibios) (push) Has been cancelled
test dds / build (sitl) (push) Has been cancelled
test dds / build (stm32h7) (push) Has been cancelled
test Linux SBC / build (bbbmini, armhf) (push) Has been cancelled
test Linux SBC / build (bebop, armhf) (push) Has been cancelled
test Linux SBC / build (bhat, armhf) (push) Has been cancelled
test Linux SBC / build (canzero, armhf) (push) Has been cancelled
test Linux SBC / build (erlebrain2, armhf) (push) Has been cancelled
test Linux SBC / build (linux, base) (push) Has been cancelled
test Linux SBC / build (navigator, armhf-musl) (push) Has been cancelled
test Linux SBC / build (navigator64, aarch64) (push) Has been cancelled
test Linux SBC / build (navio, armhf) (push) Has been cancelled
test Linux SBC / build (navio2, armhf) (push) Has been cancelled
test Linux SBC / build (pxf, armhf) (push) Has been cancelled
test Linux SBC / build (pxfmini, armhf) (push) Has been cancelled
test blimp / build (base) (push) Has been cancelled
test blimp / build (clang) (push) Has been cancelled
test ap_periph / build-gcc-ap_periph (push) Has been cancelled
test plane / build (base) (push) Has been cancelled
test plane / build (clang) (push) Has been cancelled
test rover / build (base) (push) Has been cancelled
test rover / build (clang) (push) Has been cancelled
test sub / build (base) (push) Has been cancelled
test sub / build (clang) (push) Has been cancelled
test tracker / build (base) (push) Has been cancelled
test tracker / build (clang) (push) Has been cancelled
test blimp / autotest (sitltest-blimp) (push) Has been cancelled
test ap_periph / autotest-can (sitltest-can) (push) Has been cancelled
test plane / autotest (sitltest-plane-tests1a) (push) Has been cancelled
test plane / autotest (sitltest-plane-tests1b) (push) Has been cancelled
test plane / autotest (sitltest-quadplane) (push) Has been cancelled
test rover / autotest (sitltest-balancebot) (push) Has been cancelled
test rover / autotest (sitltest-rover) (push) Has been cancelled
test rover / autotest (sitltest-sailboat) (push) Has been cancelled
test sub / autotest (sitltest-sub) (push) Has been cancelled
test tracker / autotest (sitltest-tracker) (push) Has been cancelled
94 lines
3.4 KiB
C++
94 lines
3.4 KiB
C++
#include <AP_Logger/AP_Logger_config.h>
|
|
|
|
#if HAL_LOGGING_ENABLED
|
|
|
|
#include <AP_AHRS/AP_AHRS.h>
|
|
#include "AC_Avoid.h"
|
|
#include "AP_OADijkstra.h"
|
|
#include "AP_OABendyRuler.h"
|
|
#include <AP_Logger/AP_Logger.h>
|
|
#include <AP_AHRS/AP_AHRS.h>
|
|
|
|
#if AP_OAPATHPLANNER_BENDYRULER_ENABLED
|
|
void AP_OABendyRuler::Write_OABendyRuler(const uint8_t type, const bool active, const float target_yaw, const float target_pitch, const bool resist_chg, const float margin, const Location &final_dest, const Location &oa_dest) const
|
|
{
|
|
int32_t oa_dest_alt, final_alt;
|
|
const bool got_oa_dest = oa_dest.get_alt_cm(Location::AltFrame::ABOVE_ORIGIN, oa_dest_alt);
|
|
const bool got_final_dest = final_dest.get_alt_cm(Location::AltFrame::ABOVE_ORIGIN, final_alt);
|
|
|
|
const struct log_OABendyRuler pkt{
|
|
LOG_PACKET_HEADER_INIT(LOG_OA_BENDYRULER_MSG),
|
|
time_us : AP_HAL::micros64(),
|
|
type : type,
|
|
active : active,
|
|
target_yaw : (uint16_t)wrap_360(target_yaw),
|
|
yaw : (uint16_t)wrap_360(AP::ahrs().yaw_sensor * 0.01f),
|
|
target_pitch: (uint16_t)target_pitch,
|
|
resist_chg : resist_chg,
|
|
margin : margin,
|
|
final_lat : final_dest.lat,
|
|
final_lng : final_dest.lng,
|
|
final_alt : got_final_dest ? final_alt : final_dest.alt,
|
|
oa_lat : oa_dest.lat,
|
|
oa_lng : oa_dest.lng,
|
|
oa_alt : got_oa_dest ? oa_dest_alt : oa_dest.alt
|
|
};
|
|
AP::logger().WriteBlock(&pkt, sizeof(pkt));
|
|
}
|
|
#endif // AP_OAPATHPLANNER_BENDYRULER_ENABLED
|
|
|
|
#if AP_OAPATHPLANNER_DIJKSTRA_ENABLED
|
|
void AP_OADijkstra::Write_OADijkstra(const uint8_t state, const uint8_t error_id, const uint8_t curr_point, const uint8_t tot_points, const Location &final_dest, const Location &oa_dest) const
|
|
{
|
|
const struct log_OADijkstra pkt{
|
|
LOG_PACKET_HEADER_INIT(LOG_OA_DIJKSTRA_MSG),
|
|
time_us : AP_HAL::micros64(),
|
|
state : state,
|
|
error_id : error_id,
|
|
curr_point : curr_point,
|
|
tot_points : tot_points,
|
|
final_lat : final_dest.lat,
|
|
final_lng : final_dest.lng,
|
|
oa_lat : oa_dest.lat,
|
|
oa_lng : oa_dest.lng
|
|
};
|
|
AP::logger().WriteBlock(&pkt, sizeof(pkt));
|
|
}
|
|
#endif
|
|
|
|
#if AP_OAPATHPLANNER_ENABLED
|
|
void AP_OADijkstra::Write_Visgraph_point(const uint8_t version, const uint8_t point_num, const int32_t Lat, const int32_t Lon) const
|
|
{
|
|
const struct log_OD_Visgraph pkt{
|
|
LOG_PACKET_HEADER_INIT(LOG_OD_VISGRAPH_MSG),
|
|
time_us : AP_HAL::micros64(),
|
|
version : version,
|
|
point_num : point_num,
|
|
Lat : Lat,
|
|
Lon : Lon,
|
|
};
|
|
AP::logger().WriteBlock(&pkt, sizeof(pkt));
|
|
}
|
|
#endif
|
|
|
|
#if AP_AVOIDANCE_ENABLED
|
|
void AC_Avoid::Write_SimpleAvoidance(const uint8_t state, const Vector3f& desired_vel, const Vector3f& modified_vel, const bool back_up) const
|
|
{
|
|
const struct log_SimpleAvoid pkt{
|
|
LOG_PACKET_HEADER_INIT(LOG_SIMPLE_AVOID_MSG),
|
|
time_us : AP_HAL::micros64(),
|
|
state : state,
|
|
desired_vel_x : desired_vel.x * 0.01f,
|
|
desired_vel_y : desired_vel.y * 0.01f,
|
|
desired_vel_z : desired_vel.z * 0.01f,
|
|
modified_vel_x : modified_vel.x * 0.01f,
|
|
modified_vel_y : modified_vel.y * 0.01f,
|
|
modified_vel_z : modified_vel.z * 0.01f,
|
|
backing_up : back_up,
|
|
};
|
|
AP::logger().WriteBlock(&pkt, sizeof(pkt));
|
|
}
|
|
#endif
|
|
|
|
#endif // HAL_LOGGING_ENABLED
|