mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
Add ifdefs for airspeed gz msgs
This commit is contained in:
parent
00e783766a
commit
022756732e
@ -206,12 +206,15 @@ int GZBridge::init()
|
||||
// Airspeed: /world/$WORLD/model/$MODEL/link/base_link/sensor/airspeed_sensor/air_speed
|
||||
std::string airspeed_topic = "/world/" + _world_name + "/model/" + _model_name +
|
||||
"/link/base_link/sensor/airspeed_sensor/air_speed";
|
||||
#if 0
|
||||
|
||||
if (!_node.Subscribe(airspeed_topic, &GZBridge::airspeedCallback, this)) {
|
||||
PX4_ERR("failed to subscribe to %s", airspeed_topic.c_str());
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Air pressure: /world/$WORLD/model/$MODEL/link/base_link/sensor/air_pressure_sensor/air_pressure
|
||||
std::string air_pressure_topic = "/world/" + _world_name + "/model/" + _model_name +
|
||||
"/link/base_link/sensor/air_pressure_sensor/air_pressure";
|
||||
@ -424,6 +427,7 @@ void GZBridge::barometerCallback(const gz::msgs::FluidPressure &air_pressure)
|
||||
pthread_mutex_unlock(&_node_mutex);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void GZBridge::airspeedCallback(const gz::msgs::AirSpeed &air_speed)
|
||||
{
|
||||
if (hrt_absolute_time() == 0) {
|
||||
@ -449,6 +453,7 @@ void GZBridge::airspeedCallback(const gz::msgs::AirSpeed &air_speed)
|
||||
|
||||
pthread_mutex_unlock(&_node_mutex);
|
||||
}
|
||||
#endif
|
||||
|
||||
void GZBridge::imuCallback(const gz::msgs::IMU &imu)
|
||||
{
|
||||
|
||||
@ -101,8 +101,9 @@ private:
|
||||
bool updateClock(const uint64_t tv_sec, const uint64_t tv_nsec);
|
||||
|
||||
void clockCallback(const gz::msgs::Clock &clock);
|
||||
|
||||
#if 0
|
||||
void airspeedCallback(const gz::msgs::AirSpeed &air_speed);
|
||||
#endif
|
||||
void barometerCallback(const gz::msgs::FluidPressure &air_pressure);
|
||||
void imuCallback(const gz::msgs::IMU &imu);
|
||||
void poseInfoCallback(const gz::msgs::Pose_V &pose);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user