Update GZBridge to be able to use gazebo airspeed. Add quadtailsitter. (#23455)

* Update GZBridge to be able to use gazebo airspeed. Add gz quadtailsitter.

* Fix formatting

---------

Co-authored-by: jmackay2 <jmackay2@gmail.com>
This commit is contained in:
jmackay2
2024-08-19 02:54:57 -04:00
committed by GitHub
parent e29a36adb4
commit 7e45f49152
7 changed files with 103 additions and 16 deletions
+6 -10
View File
@@ -203,17 +203,15 @@ int GZBridge::init()
PX4_WARN("failed to subscribe to %s", laser_scan_topic.c_str());
}
#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";
// 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 (!_node.Subscribe(airpressure_topic, &GZBridge::airspeedCallback, this)) {
PX4_ERR("failed to subscribe to %s", airpressure_topic.c_str());
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";
@@ -426,8 +424,7 @@ void GZBridge::barometerCallback(const gz::msgs::FluidPressure &air_pressure)
pthread_mutex_unlock(&_node_mutex);
}
#if 0
void GZBridge::airspeedCallback(const gz::msgs::AirSpeedSensor &air_speed)
void GZBridge::airspeedCallback(const gz::msgs::AirSpeed &air_speed)
{
if (hrt_absolute_time() == 0) {
return;
@@ -452,7 +449,6 @@ void GZBridge::airspeedCallback(const gz::msgs::AirSpeedSensor &air_speed)
pthread_mutex_unlock(&_node_mutex);
}
#endif
void GZBridge::imuCallback(const gz::msgs::IMU &imu)
{