mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-02 18:40:34 +08:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -102,7 +102,7 @@ private:
|
||||
|
||||
void clockCallback(const gz::msgs::Clock &clock);
|
||||
|
||||
// void airspeedCallback(const gz::msgs::AirSpeedSensor &air_pressure);
|
||||
void airspeedCallback(const gz::msgs::AirSpeed &air_speed);
|
||||
void barometerCallback(const gz::msgs::FluidPressure &air_pressure);
|
||||
void imuCallback(const gz::msgs::IMU &imu);
|
||||
void poseInfoCallback(const gz::msgs::Pose_V &pose);
|
||||
@@ -123,7 +123,7 @@ private:
|
||||
// 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<obstacle_distance_s> _obstacle_distance_pub{ORB_ID(obstacle_distance)};
|
||||
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)};
|
||||
|
||||
@@ -195,7 +195,7 @@ int SensorAirspeedSim::print_usage(const char *reason)
|
||||
|
||||
)DESCR_STR");
|
||||
|
||||
PRINT_MODULE_USAGE_NAME("sensor_arispeed_sim", "system");
|
||||
PRINT_MODULE_USAGE_NAME("sensor_airspeed_sim", "system");
|
||||
PRINT_MODULE_USAGE_COMMAND("start");
|
||||
PRINT_MODULE_USAGE_DEFAULT_COMMANDS();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user