Skip to content

Commit 099158e

Browse files
mc_raptor: overwrite offboard parameter
1 parent df5d420 commit 099158e

4 files changed

Lines changed: 19 additions & 2 deletions

File tree

src/modules/mc_raptor/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ px4_add_module(
1313
SRCS
1414
mc_raptor.cpp
1515
rl_tools_adapter.cpp
16+
MODULE_CONFIG
17+
module.yaml
1618
DEPENDS
1719
px4_work_queue
1820
rl_tools

src/modules/mc_raptor/mc_raptor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ bool Raptor::init()
8383
register_ext_component_request.px4_ros2_api_version = 1;
8484
register_ext_component_request.register_arming_check = true;
8585
register_ext_component_request.register_mode = true;
86-
register_ext_component_request.enable_replace_internal_mode = true;
86+
register_ext_component_request.enable_replace_internal_mode = _param_mc_raptor_offboard.get();
8787
register_ext_component_request.replace_internal_mode = vehicle_status_s::NAVIGATION_STATE_OFFBOARD;
8888
register_ext_component_request.request_offboard_setpoints = true;
8989
_register_ext_component_request_pub.publish(register_ext_component_request);

src/modules/mc_raptor/mc_raptor.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ class Raptor : public ModuleBase<Raptor>, public ModuleParams, public px4::Sched
180180
float previous_action[RL_TOOLS_INTERFACE_APPLICATIONS_L2F_ACTION_DIM];
181181

182182
DEFINE_PARAMETERS(
183-
(ParamInt<px4::params::IMU_GYRO_RATEMAX>) _param_imu_gyro_ratemax
183+
(ParamInt<px4::params::IMU_GYRO_RATEMAX>) _param_imu_gyro_ratemax,
184+
(ParamBool<px4::params::MC_RAPTOR_OFFB>) _param_mc_raptor_offboard
184185
)
185186

186187
void updateArmingCheckReply(bool active);

src/modules/mc_raptor/module.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module_name: mc_raptor
2+
parameters:
3+
- group: Multicopter Raptor
4+
definitions:
5+
MC_RAPTOR_OFFB:
6+
description:
7+
short: Enable Offboard mode replacement
8+
long: |
9+
When enabled, the Raptor mode will replace the Offboard mode.
10+
If disabled, the Raptor mode will be available as a separate external mode. In the latter case, Raptor will just hold the position, without requiring external setpoints. When Raptor replaces the Offboard mode, it requires external setpoints to be activated.
11+
type: boolean
12+
default: false
13+
category: System
14+

0 commit comments

Comments
 (0)