mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 06:13:34 +08:00
Changed constant name to UNMANNED_GROUND_VEHICLE
This commit is contained in:
committed by
Julian Oes
parent
714c90b9db
commit
21760a5856
@@ -1297,7 +1297,7 @@ Commander::run()
|
||||
status.vehicle_type = vehicle_status_s::VEHICLE_TYPE_FIXED_WING;
|
||||
|
||||
} else if (is_ground_rover(&status)) {
|
||||
status.vehicle_type = vehicle_status_s::VEHICLE_TYPE_GROUND;
|
||||
status.vehicle_type = vehicle_status_s::VEHICLE_TYPE_ROVER;
|
||||
|
||||
} else {
|
||||
status.vehicle_type = vehicle_status_s::VEHICLE_TYPE_UNKNOWN;
|
||||
@@ -1407,9 +1407,9 @@ Commander::run()
|
||||
status.system_type = (uint8_t)system_type;
|
||||
}
|
||||
|
||||
bool is_rotary = is_rotary_wing(&status) || (is_vtol(&status) && vtol_status.vtol_in_rw_mode);
|
||||
bool is_fixed = is_fixed_wing(&status) || (is_vtol(&status) && !vtol_status.vtol_in_rw_mode);
|
||||
bool is_ground = is_ground_rover(&status);
|
||||
const bool is_rotary = is_rotary_wing(&status) || (is_vtol(&status) && vtol_status.vtol_in_rw_mode);
|
||||
const bool is_fixed = is_fixed_wing(&status) || (is_vtol(&status) && !vtol_status.vtol_in_rw_mode);
|
||||
const bool is_ground = is_ground_rover(&status);
|
||||
|
||||
/* disable manual override for all systems that rely on electronic stabilization */
|
||||
if (is_rotary) {
|
||||
@@ -1419,7 +1419,7 @@ Commander::run()
|
||||
status.vehicle_type = vehicle_status_s::VEHICLE_TYPE_FIXED_WING;
|
||||
|
||||
} else if (is_ground) {
|
||||
status.vehicle_type = vehicle_status_s::VEHICLE_TYPE_GROUND;
|
||||
status.vehicle_type = vehicle_status_s::VEHICLE_TYPE_ROVER;
|
||||
}
|
||||
|
||||
/* set vehicle_status.is_vtol flag */
|
||||
@@ -1642,9 +1642,11 @@ Commander::run()
|
||||
if (is_vtol(&status)) {
|
||||
|
||||
// Check if there has been any change while updating the flags
|
||||
bool is_rotary = status.vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING;
|
||||
const auto new_vehicle_type = vtol_status.vtol_in_rw_mode ?
|
||||
vehicle_status_s::VEHICLE_TYPE_ROTARY_WING :
|
||||
vehicle_status_s::VEHICLE_TYPE_FIXED_WING;
|
||||
|
||||
if (is_rotary != vtol_status.vtol_in_rw_mode) {
|
||||
if (new_vehicle_type != status.vehicle_type) {
|
||||
status.vehicle_type = vtol_status.vtol_in_rw_mode ?
|
||||
vehicle_status_s::VEHICLE_TYPE_ROTARY_WING :
|
||||
vehicle_status_s::VEHICLE_TYPE_FIXED_WING;
|
||||
|
||||
@@ -507,7 +507,7 @@ bool StateMachineHelperTest::mainStateTransitionTest()
|
||||
struct vehicle_status_flags_s current_status_flags = {};
|
||||
|
||||
current_commander_state.main_state = test->from_state;
|
||||
current_vehicle_status.vehicle_type = test->condition_bits & MTT_ROTARY_WING ?
|
||||
current_vehicle_status.vehicle_type = (test->condition_bits & MTT_ROTARY_WING) ?
|
||||
vehicle_status_s::VEHICLE_TYPE_ROTARY_WING : vehicle_status_s::VEHICLE_TYPE_FIXED_WING;
|
||||
current_status_flags.condition_local_altitude_valid = test->condition_bits & MTT_LOC_ALT_VALID;
|
||||
current_status_flags.condition_local_position_valid = test->condition_bits & MTT_LOC_POS_VALID;
|
||||
|
||||
@@ -691,6 +691,7 @@ bool set_nav_state(vehicle_status_s *status, actuator_armed_s *armed, commander_
|
||||
status->nav_state = vehicle_status_s::NAVIGATION_STATE_AUTO_LOITER;
|
||||
|
||||
} else if (status_flags.condition_local_altitude_valid) {
|
||||
//TODO: Add case for rover
|
||||
if (status->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) {
|
||||
status->nav_state = vehicle_status_s::NAVIGATION_STATE_DESCEND;
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ int LandDetector::task_spawn(int argc, char *argv[])
|
||||
} else if (strcmp(argv[1], "vtol") == 0) {
|
||||
obj = new VtolLandDetector();
|
||||
|
||||
} else if (strcmp(argv[1], "ugv") == 0) {
|
||||
} else if (strcmp(argv[1], "rover") == 0) {
|
||||
obj = new RoverLandDetector();
|
||||
|
||||
} else {
|
||||
@@ -165,7 +165,7 @@ The module runs periodically on the HP work queue.
|
||||
|
||||
PRINT_MODULE_USAGE_NAME("land_detector", "system");
|
||||
PRINT_MODULE_USAGE_COMMAND_DESCR("start", "Start the background task");
|
||||
PRINT_MODULE_USAGE_ARG("fixedwing|multicopter|vtol|ugv", "Select vehicle type", false);
|
||||
PRINT_MODULE_USAGE_ARG("fixedwing|multicopter|vtol|rover", "Select vehicle type", false);
|
||||
PRINT_MODULE_USAGE_DEFAULT_COMMANDS();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -335,10 +335,12 @@ MissionBlock::is_mission_item_reached()
|
||||
&& PX4_ISFINITE(_mission_item.yaw))) {
|
||||
|
||||
/* check course if defined only for rotary wing except takeoff */
|
||||
float cog = _navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING
|
||||
? _navigator->get_global_position()->yaw : atan2f(
|
||||
float cog = (_navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) ?
|
||||
_navigator->get_global_position()->yaw :
|
||||
atan2f(
|
||||
_navigator->get_global_position()->vel_e,
|
||||
_navigator->get_global_position()->vel_n);
|
||||
_navigator->get_global_position()->vel_n
|
||||
);
|
||||
|
||||
float yaw_err = wrap_pi(_mission_item.yaw - cog);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user