From 1d1abb3ba2f13af7922dc4525454c448948da9f0 Mon Sep 17 00:00:00 2001 From: Jacob Dahl Date: Tue, 17 Mar 2026 21:55:35 -0800 Subject: [PATCH] refactor(simulation/gz_bridge): convert params.c to module.yaml Convert 1 parameter file(s) from legacy C format to YAML module configuration. --- .../simulation/gz_bridge/CMakeLists.txt | 1 + src/modules/simulation/gz_bridge/parameters.c | 107 ------------------ .../simulation/gz_bridge/parameters.yaml | 66 +++++++++++ 3 files changed, 67 insertions(+), 107 deletions(-) delete mode 100644 src/modules/simulation/gz_bridge/parameters.c create mode 100644 src/modules/simulation/gz_bridge/parameters.yaml diff --git a/src/modules/simulation/gz_bridge/CMakeLists.txt b/src/modules/simulation/gz_bridge/CMakeLists.txt index c639b4c679..74ef643c61 100644 --- a/src/modules/simulation/gz_bridge/CMakeLists.txt +++ b/src/modules/simulation/gz_bridge/CMakeLists.txt @@ -69,6 +69,7 @@ if (gz-transport_FOUND) ${GZ_TRANSPORT_TARGET} MODULE_CONFIG module.yaml + parameters.yaml ) target_include_directories(modules__simulation__gz_bridge diff --git a/src/modules/simulation/gz_bridge/parameters.c b/src/modules/simulation/gz_bridge/parameters.c deleted file mode 100644 index 0616da562f..0000000000 --- a/src/modules/simulation/gz_bridge/parameters.c +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2022 PX4 Development Team. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name PX4 nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/** - * Simulator Gazebo bridge enable - * - * @boolean - * @reboot_required true - * @group UAVCAN - */ -PARAM_DEFINE_INT32(SIM_GZ_EN, 0); - -/** - * Enable laser/lidar sensors in Gazebo bridge - * - * @boolean - * @reboot_required true - * @group Simulation - * @value 0 Disabled - * @value 1 Enabled - */ -PARAM_DEFINE_INT32(SIM_GZ_EN_LIDAR, 1); - -/** - * Enable optical flow sensor in Gazebo bridge - * - * @boolean - * @reboot_required true - * @group Simulation - * @value 0 Disabled - * @value 1 Enabled - */ -PARAM_DEFINE_INT32(SIM_GZ_EN_FLOW, 1); - -/** - * Enable airspeed sensor in Gazebo bridge - * - * @boolean - * @reboot_required true - * @group Simulation - * @value 0 Disabled - * @value 1 Enabled - */ -PARAM_DEFINE_INT32(SIM_GZ_EN_ASPD, 1); - -/** - * Enable barometer/air pressure sensor in Gazebo bridge - * - * @boolean - * @reboot_required true - * @group Simulation - * @value 0 Disabled - * @value 1 Enabled - */ -PARAM_DEFINE_INT32(SIM_GZ_EN_BARO, 1); - -/** - * Enable odometry in Gazebo bridge - * - * @boolean - * @reboot_required true - * @group Simulation - * @value 0 Disabled - * @value 1 Enabled - */ -PARAM_DEFINE_INT32(SIM_GZ_EN_ODOM, 1); - -/** - * Enable GPS/NavSat sensor in Gazebo bridge - * - * @boolean - * @reboot_required true - * @group Simulation - * @value 0 Disabled - * @value 1 Enabled - */ -PARAM_DEFINE_INT32(SIM_GZ_EN_GPS, 1); diff --git a/src/modules/simulation/gz_bridge/parameters.yaml b/src/modules/simulation/gz_bridge/parameters.yaml new file mode 100644 index 0000000000..4edca88ca3 --- /dev/null +++ b/src/modules/simulation/gz_bridge/parameters.yaml @@ -0,0 +1,66 @@ +module_name: gz_bridge +parameters: +- group: Simulation + definitions: + SIM_GZ_EN_LIDAR: + description: + short: Enable laser/lidar sensors in Gazebo bridge + type: enum + values: + 0: Disabled + 1: Enabled + default: 1 + reboot_required: true + SIM_GZ_EN_FLOW: + description: + short: Enable optical flow sensor in Gazebo bridge + type: enum + values: + 0: Disabled + 1: Enabled + default: 1 + reboot_required: true + SIM_GZ_EN_ASPD: + description: + short: Enable airspeed sensor in Gazebo bridge + type: enum + values: + 0: Disabled + 1: Enabled + default: 1 + reboot_required: true + SIM_GZ_EN_BARO: + description: + short: Enable barometer/air pressure sensor in Gazebo bridge + type: enum + values: + 0: Disabled + 1: Enabled + default: 1 + reboot_required: true + SIM_GZ_EN_ODOM: + description: + short: Enable odometry in Gazebo bridge + type: enum + values: + 0: Disabled + 1: Enabled + default: 1 + reboot_required: true + SIM_GZ_EN_GPS: + description: + short: Enable GPS/NavSat sensor in Gazebo bridge + type: enum + values: + 0: Disabled + 1: Enabled + default: 1 + reboot_required: true +- group: UAVCAN + definitions: + SIM_GZ_EN: + description: + short: Simulator Gazebo bridge enable + type: boolean + default: 0 + reboot_required: true