From 1129087ef9e4c9d4ece1d850351b79f44d61caa8 Mon Sep 17 00:00:00 2001 From: "paul.quillen" Date: Tue, 5 Nov 2024 10:27:54 -0600 Subject: [PATCH] AP_DDS: fixed stack frame size on build. --- libraries/AP_DDS/AP_DDS_Client.cpp | 5 ++++- libraries/AP_DDS/AP_DDS_Client.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/AP_DDS/AP_DDS_Client.cpp b/libraries/AP_DDS/AP_DDS_Client.cpp index b30117e52c630..c2b0a7a7de218 100644 --- a/libraries/AP_DDS/AP_DDS_Client.cpp +++ b/libraries/AP_DDS/AP_DDS_Client.cpp @@ -82,11 +82,14 @@ ardupilot_msgs_msg_GlobalPosition AP_DDS_Client::rx_global_position_control_topi #endif // AP_DDS_GLOBAL_POS_CTRL_ENABLED // Define the parameter server data members, which are static class scope. +// If these are created on the stack, then the AP_DDS_Client::on_request +// frame size is exceeded. #if AP_DDS_PARAMETER_SERVER_ENABLED rcl_interfaces_srv_SetParameters_Request AP_DDS_Client::set_parameter_request {}; rcl_interfaces_srv_SetParameters_Response AP_DDS_Client::set_parameter_response {}; rcl_interfaces_srv_GetParameters_Request AP_DDS_Client::get_parameters_request {}; rcl_interfaces_srv_GetParameters_Response AP_DDS_Client::get_parameters_response {}; +rcl_interfaces_msg_Parameter AP_DDS_Client::param {}; #endif const AP_Param::GroupInfo AP_DDS_Client::var_info[] { @@ -823,7 +826,7 @@ void AP_DDS_Client::on_request(uxrSession* uxr_session, uxrObjectId object_id, u // Set parameters and responses for each one requested set_parameter_response.results_size = set_parameter_request.parameters_size; for (size_t i = 0; i < set_parameter_request.parameters_size; i++) { - rcl_interfaces_msg_Parameter param = set_parameter_request.parameters[i]; + param = set_parameter_request.parameters[i]; enum ap_var_type var_type; diff --git a/libraries/AP_DDS/AP_DDS_Client.h b/libraries/AP_DDS/AP_DDS_Client.h index 0610a4d622f05..ded3451f99228 100644 --- a/libraries/AP_DDS/AP_DDS_Client.h +++ b/libraries/AP_DDS/AP_DDS_Client.h @@ -214,6 +214,7 @@ class AP_DDS_Client static rcl_interfaces_srv_SetParameters_Response set_parameter_response; static rcl_interfaces_srv_GetParameters_Request get_parameters_request; static rcl_interfaces_srv_GetParameters_Response get_parameters_response; + static rcl_interfaces_msg_Parameter param; #endif // connection parametrics