fix: esc status sizing fix for gz simulation

* init: working towards dual-action ATMOS

* fix: update gz sim to latest

* fix: add motor number max fitting Actuator

* fix: revert non-necessary changes

* fix: ensure esc count does not exceed maximum number of ESCs

* fix: remove extra modules

* fix: sync submodules with remote

* fix: sync with main
This commit is contained in:
Pedro Roque 2025-12-16 15:46:51 -08:00 committed by GitHub
parent 5632728467
commit cb682006fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -109,9 +109,10 @@ void GZMixingInterfaceESC::motorSpeedCallback(const gz::msgs::Actuators &actuato
pthread_mutex_lock(&_node_mutex);
esc_status_s esc_status{};
esc_status.esc_count = actuators.velocity_size();
// Limit to max supported ESCs while allowing for a larger number of system actuators
esc_status.esc_count = math::min(actuators.velocity_size(), static_cast<int>(esc_status_s::CONNECTED_ESC_MAX));
for (int i = 0; i < actuators.velocity_size(); i++) {
for (int i = 0; i < esc_status.esc_count; i++) {
esc_status.esc[i].timestamp = hrt_absolute_time();
esc_status.esc[i].esc_rpm = actuators.velocity(i);
esc_status.esc_online_flags |= 1 << i;

View File

@ -1,3 +1,4 @@
__max_num_motors: &max_num_motors 12
__max_num_servos: &max_num_servos 8
__max_num_tilts: &max_num_tilts 4
@ -18,7 +19,7 @@ actuator_output:
min: { min: 0, max: 1000, default: 0 }
max: { min: 0, max: 1000, default: 1000 }
failsafe: { min: 0, max: 1000 }
num_channels: *max_num_servos
num_channels: *max_num_motors
- param_prefix: SIM_GZ_SV
group_label: 'Servos'
channel_label: 'Servo'