mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 17:37:35 +08:00
feat: spacecraft tooling for commander and VehicleStatus
This commit is contained in:
@@ -92,6 +92,7 @@ uint8 vehicle_type
|
||||
uint8 VEHICLE_TYPE_ROTARY_WING = 0
|
||||
uint8 VEHICLE_TYPE_FIXED_WING = 1
|
||||
uint8 VEHICLE_TYPE_ROVER = 2
|
||||
uint8 VEHICLE_TYPE_SPACECRAFT = 7
|
||||
|
||||
uint8 FAILSAFE_DEFER_STATE_DISABLED = 0
|
||||
uint8 FAILSAFE_DEFER_STATE_ENABLED = 1
|
||||
|
||||
@@ -1734,6 +1734,8 @@ void Commander::updateParameters()
|
||||
|
||||
} else if (is_ground) {
|
||||
_vehicle_status.vehicle_type = vehicle_status_s::VEHICLE_TYPE_ROVER;
|
||||
} else if (is_spacecraft(_vehicle_status)) {
|
||||
_vehicle_status.vehicle_type = vehicle_status_s::VEHICLE_TYPE_SPACECRAFT;
|
||||
}
|
||||
|
||||
_vehicle_status.is_vtol = is_vtol(_vehicle_status);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "control_mode.hpp"
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
|
||||
#include <iostream>
|
||||
namespace mode_util
|
||||
{
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
#define VEHICLE_TYPE_VTOL_TILTROTOR 21
|
||||
#define VEHICLE_TYPE_VTOL_FIXEDROTOR 22 // VTOL standard
|
||||
#define VEHICLE_TYPE_VTOL_TAILSITTER 23
|
||||
#define VEHICLE_TYPE_SPACECRAFT 7
|
||||
|
||||
#define BLINK_MSG_TIME 700000 // 3 fast blinks (in us)
|
||||
|
||||
@@ -122,6 +123,11 @@ bool is_ground_vehicle(const vehicle_status_s ¤t_status)
|
||||
return (current_status.system_type == VEHICLE_TYPE_BOAT || current_status.system_type == VEHICLE_TYPE_GROUND_ROVER);
|
||||
}
|
||||
|
||||
bool is_spacecraft(const vehicle_status_s ¤t_status)
|
||||
{
|
||||
return (current_status.system_type == VEHICLE_TYPE_SPACECRAFT);
|
||||
}
|
||||
|
||||
// End time for currently blinking LED message, 0 if no blink message
|
||||
static hrt_abstime blink_msg_end = 0;
|
||||
static int fd_leds{-1};
|
||||
|
||||
@@ -56,6 +56,7 @@ bool is_vtol(const vehicle_status_s ¤t_status);
|
||||
bool is_vtol_tailsitter(const vehicle_status_s ¤t_status);
|
||||
bool is_fixed_wing(const vehicle_status_s ¤t_status);
|
||||
bool is_ground_vehicle(const vehicle_status_s ¤t_status);
|
||||
bool is_spacecraft(const vehicle_status_s ¤t_status);
|
||||
|
||||
int buzzer_init(void);
|
||||
void buzzer_deinit(void);
|
||||
|
||||
Reference in New Issue
Block a user