mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 01:33:33 +08:00
Renamed actuator_safety back to actuator_armed, compiling but untested
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <uORB/uORB.h>
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
#include <uORB/topics/actuator_safety.h>
|
||||
#include <uORB/topics/actuator_armed.h>
|
||||
#include <uORB/topics/vehicle_control_mode.h>
|
||||
#include <uORB/topics/vehicle_attitude.h>
|
||||
#include <uORB/topics/manual_control_setpoint.h>
|
||||
@@ -159,7 +159,7 @@ flow_position_control_thread_main(int argc, char *argv[])
|
||||
const float time_scale = powf(10.0f,-6.0f);
|
||||
|
||||
/* structures */
|
||||
struct actuator_safety_s safety;
|
||||
struct actuator_armed_s armed;
|
||||
struct vehicle_control_mode_s control_mode;
|
||||
struct vehicle_attitude_s att;
|
||||
struct manual_control_setpoint_s manual;
|
||||
@@ -171,7 +171,7 @@ flow_position_control_thread_main(int argc, char *argv[])
|
||||
/* subscribe to attitude, motor setpoints and system state */
|
||||
int parameter_update_sub = orb_subscribe(ORB_ID(parameter_update));
|
||||
int vehicle_attitude_sub = orb_subscribe(ORB_ID(vehicle_attitude));
|
||||
int safety_sub = orb_subscribe(ORB_ID(actuator_safety));
|
||||
int armed_sub = orb_subscribe(ORB_ID(actuator_armed));
|
||||
int control_mode_sub = orb_subscribe(ORB_ID(vehicle_control_mode));
|
||||
int manual_control_setpoint_sub = orb_subscribe(ORB_ID(manual_control_setpoint));
|
||||
int filtered_bottom_flow_sub = orb_subscribe(ORB_ID(filtered_bottom_flow));
|
||||
@@ -261,7 +261,7 @@ flow_position_control_thread_main(int argc, char *argv[])
|
||||
perf_begin(mc_loop_perf);
|
||||
|
||||
/* get a local copy of the vehicle state */
|
||||
orb_copy(ORB_ID(actuator_safety), safety_sub, &safety);
|
||||
orb_copy(ORB_ID(actuator_armed), armed_sub, &armed);
|
||||
/* get a local copy of manual setpoint */
|
||||
orb_copy(ORB_ID(manual_control_setpoint), manual_control_setpoint_sub, &manual);
|
||||
/* get a local copy of attitude */
|
||||
@@ -578,7 +578,7 @@ flow_position_control_thread_main(int argc, char *argv[])
|
||||
close(parameter_update_sub);
|
||||
close(vehicle_attitude_sub);
|
||||
close(vehicle_local_position_sub);
|
||||
close(safety_sub);
|
||||
close(armed_sub);
|
||||
close(control_mode_sub);
|
||||
close(manual_control_setpoint_sub);
|
||||
close(speed_sp_pub);
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#include <math.h>
|
||||
#include <uORB/uORB.h>
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
#include <uORB/topics/actuator_safety.h>
|
||||
#include <uORB/topics/actuator_armed.h>
|
||||
#include <uORB/topics/vehicle_control_mode.h>
|
||||
#include <uORB/topics/vehicle_attitude.h>
|
||||
#include <uORB/topics/vehicle_attitude_setpoint.h>
|
||||
@@ -159,8 +159,8 @@ int flow_position_estimator_thread_main(int argc, char *argv[])
|
||||
static float sonar_lp = 0.0f;
|
||||
|
||||
/* subscribe to vehicle status, attitude, sensors and flow*/
|
||||
struct actuator_safety_s safety;
|
||||
memset(&safety, 0, sizeof(safety));
|
||||
struct actuator_armed_s armed;
|
||||
memset(&armed, 0, sizeof(armed));
|
||||
struct vehicle_control_mode_s control_mode;
|
||||
memset(&control_mode, 0, sizeof(control_mode));
|
||||
struct vehicle_attitude_s att;
|
||||
@@ -173,8 +173,8 @@ int flow_position_estimator_thread_main(int argc, char *argv[])
|
||||
/* subscribe to parameter changes */
|
||||
int parameter_update_sub = orb_subscribe(ORB_ID(parameter_update));
|
||||
|
||||
/* subscribe to safety topic */
|
||||
int safety_sub = orb_subscribe(ORB_ID(actuator_safety));
|
||||
/* subscribe to armed topic */
|
||||
int armed_sub = orb_subscribe(ORB_ID(actuator_armed));
|
||||
|
||||
/* subscribe to safety topic */
|
||||
int control_mode_sub = orb_subscribe(ORB_ID(vehicle_control_mode));
|
||||
@@ -270,7 +270,7 @@ int flow_position_estimator_thread_main(int argc, char *argv[])
|
||||
/* got flow, updating attitude and status as well */
|
||||
orb_copy(ORB_ID(vehicle_attitude), vehicle_attitude_sub, &att);
|
||||
orb_copy(ORB_ID(vehicle_attitude_setpoint), vehicle_attitude_setpoint_sub, &att_sp);
|
||||
orb_copy(ORB_ID(actuator_safety), safety_sub, &safety);
|
||||
orb_copy(ORB_ID(actuator_armed), armed_sub, &armed);
|
||||
orb_copy(ORB_ID(vehicle_control_mode), control_mode_sub, &control_mode);
|
||||
|
||||
/* vehicle state estimation */
|
||||
@@ -284,12 +284,12 @@ int flow_position_estimator_thread_main(int argc, char *argv[])
|
||||
|
||||
if (!vehicle_liftoff)
|
||||
{
|
||||
if (safety.armed && att_sp.thrust > params.minimum_liftoff_thrust && sonar_new > 0.3f && sonar_new < 1.0f)
|
||||
if (armed.armed && att_sp.thrust > params.minimum_liftoff_thrust && sonar_new > 0.3f && sonar_new < 1.0f)
|
||||
vehicle_liftoff = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!safety.armed || (att_sp.thrust < params.minimum_liftoff_thrust && sonar_new <= 0.3f))
|
||||
if (!armed.armed || (att_sp.thrust < params.minimum_liftoff_thrust && sonar_new <= 0.3f))
|
||||
vehicle_liftoff = false;
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ int flow_position_estimator_thread_main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* filtering ground distance */
|
||||
if (!vehicle_liftoff || !safety.armed)
|
||||
if (!vehicle_liftoff || !armed.armed)
|
||||
{
|
||||
/* not possible to fly */
|
||||
sonar_valid = false;
|
||||
@@ -453,7 +453,7 @@ int flow_position_estimator_thread_main(int argc, char *argv[])
|
||||
|
||||
close(vehicle_attitude_setpoint_sub);
|
||||
close(vehicle_attitude_sub);
|
||||
close(safety_sub);
|
||||
close(armed_sub);
|
||||
close(control_mode_sub);
|
||||
close(parameter_update_sub);
|
||||
close(optical_flow_sub);
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <uORB/uORB.h>
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
#include <uORB/topics/actuator_safety.h>
|
||||
#include <uORB/topics/actuator_armed.h>
|
||||
#include <uORB/topics/vehicle_control_mode.h>
|
||||
#include <uORB/topics/vehicle_attitude.h>
|
||||
#include <uORB/topics/vehicle_attitude_setpoint.h>
|
||||
@@ -156,7 +156,7 @@ flow_speed_control_thread_main(int argc, char *argv[])
|
||||
uint32_t counter = 0;
|
||||
|
||||
/* structures */
|
||||
struct actuator_safety_s safety;
|
||||
struct actuator_armed_s armed;
|
||||
struct vehicle_control_mode_s control_mode;
|
||||
struct filtered_bottom_flow_s filtered_flow;
|
||||
struct vehicle_bodyframe_speed_setpoint_s speed_sp;
|
||||
@@ -166,7 +166,7 @@ flow_speed_control_thread_main(int argc, char *argv[])
|
||||
/* subscribe to attitude, motor setpoints and system state */
|
||||
int parameter_update_sub = orb_subscribe(ORB_ID(parameter_update));
|
||||
int vehicle_attitude_sub = orb_subscribe(ORB_ID(vehicle_attitude));
|
||||
int safety_sub = orb_subscribe(ORB_ID(actuator_safety));
|
||||
int armed_sub = orb_subscribe(ORB_ID(actuator_armed));
|
||||
int control_mode_sub = orb_subscribe(ORB_ID(vehicle_control_mode));
|
||||
int filtered_bottom_flow_sub = orb_subscribe(ORB_ID(filtered_bottom_flow));
|
||||
int vehicle_bodyframe_speed_setpoint_sub = orb_subscribe(ORB_ID(vehicle_bodyframe_speed_setpoint));
|
||||
@@ -229,8 +229,8 @@ flow_speed_control_thread_main(int argc, char *argv[])
|
||||
{
|
||||
perf_begin(mc_loop_perf);
|
||||
|
||||
/* get a local copy of the safety topic */
|
||||
orb_copy(ORB_ID(actuator_safety), safety_sub, &safety);
|
||||
/* get a local copy of the armed topic */
|
||||
orb_copy(ORB_ID(actuator_armed), armed_sub, &armed);
|
||||
/* get a local copy of the control mode */
|
||||
orb_copy(ORB_ID(vehicle_control_mode), control_mode_sub, &control_mode);
|
||||
/* get a local copy of filtered bottom flow */
|
||||
@@ -355,7 +355,7 @@ flow_speed_control_thread_main(int argc, char *argv[])
|
||||
close(vehicle_attitude_sub);
|
||||
close(vehicle_bodyframe_speed_setpoint_sub);
|
||||
close(filtered_bottom_flow_sub);
|
||||
close(safety_sub);
|
||||
close(armed_sub);
|
||||
close(control_mode_sub);
|
||||
close(att_sp_pub);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user