mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-09 16:21:35 +08:00
Fix for sensor airspeed enable.
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
This commit is contained in:
@@ -35,7 +35,6 @@
|
||||
find_package(gz-transport
|
||||
#REQUIRED COMPONENTS core
|
||||
NAMES
|
||||
#ignition-transport11 # IGN (Fortress and earlier) no longer supported
|
||||
gz-transport12
|
||||
#QUIET
|
||||
)
|
||||
|
||||
@@ -152,7 +152,7 @@ int GZBridge::init()
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
// Airspeed: /world/$WORLD/model/$MODEL/link/airspeed_link/sensor/air_speed/air_speed
|
||||
std::string airpressure_topic = "/world/" + _world_name + "/model/" + _model_name +
|
||||
"/link/airspeed_link/sensor/air_speed/air_speed";
|
||||
@@ -162,7 +162,6 @@ int GZBridge::init()
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (!_mixing_interface_esc.init(_model_name)) {
|
||||
PX4_ERR("failed to init ESC output");
|
||||
@@ -329,14 +328,14 @@ void GZBridge::clockCallback(const gz::msgs::Clock &clock)
|
||||
pthread_mutex_unlock(&_node_mutex);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
void GZBridge::airpressureCallback(const gz::msgs::FluidPressure &air_pressure)
|
||||
{
|
||||
if (hrt_absolute_time() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&_mutex);
|
||||
pthread_mutex_lock(&_node_mutex);
|
||||
|
||||
const uint64_t time_us = (air_pressure.header().stamp().sec() * 1000000)
|
||||
+ (air_pressure.header().stamp().nsec() / 1000);
|
||||
@@ -353,7 +352,7 @@ void GZBridge::airpressureCallback(const gz::msgs::FluidPressure &air_pressure)
|
||||
|
||||
pthread_mutex_unlock(&_node_mutex);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void GZBridge::imuCallback(const gz::msgs::IMU &imu)
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
#include <gz/msgs.hh>
|
||||
#include <gz/transport.hh>
|
||||
|
||||
// #include <gz/msgs/fluid_pressure.pb.h>
|
||||
#include <gz/msgs/fluid_pressure.pb.h>
|
||||
#include <gz/msgs/imu.pb.h>
|
||||
|
||||
using namespace time_literals;
|
||||
@@ -94,14 +94,14 @@ private:
|
||||
|
||||
void clockCallback(const gz::msgs::Clock &clock);
|
||||
|
||||
//void airpressureCallback(const gz::msgs::FluidPressure &air_pressure);
|
||||
void airpressureCallback(const gz::msgs::FluidPressure &air_pressure);
|
||||
void imuCallback(const gz::msgs::IMU &imu);
|
||||
void poseInfoCallback(const gz::msgs::Pose_V &pose);
|
||||
|
||||
// Subscriptions
|
||||
uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s};
|
||||
|
||||
//uORB::Publication<differential_pressure_s> _differential_pressure_pub{ORB_ID(differential_pressure)};
|
||||
uORB::Publication<differential_pressure_s> _differential_pressure_pub{ORB_ID(differential_pressure)};
|
||||
uORB::Publication<vehicle_angular_velocity_s> _angular_velocity_ground_truth_pub{ORB_ID(vehicle_angular_velocity_groundtruth)};
|
||||
uORB::Publication<vehicle_attitude_s> _attitude_ground_truth_pub{ORB_ID(vehicle_attitude_groundtruth)};
|
||||
uORB::Publication<vehicle_global_position_s> _gpos_ground_truth_pub{ORB_ID(vehicle_global_position_groundtruth)};
|
||||
|
||||
Reference in New Issue
Block a user