Skip to content

Conversation

dakejahl
Copy link
Contributor

@dakejahl dakejahl commented Oct 14, 2025

In conjunction with PX4/PX4-gazebo-models#122

context
Support for using x500_gimbal in our px4-ros2 precision landing example.

Copy link

github-actions bot commented Oct 14, 2025

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 480 byte (0.02 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +480  +0.0%    +480    .text
  [NEW]    +288  [NEW]    +288    ucdr_serialize_gimbal_device_attitude_status()
  +0.1%    +120  +0.1%    +120    [section .text]
  +2.6%     +84  +2.6%     +84    UxrceddsClient::run()
  +5.0%      +4  +5.0%      +4    write_user_stack.constprop.0
 -11.1%     -16 -11.1%     -16    px4::wq_configurations::lp_default
+0.0%     +55  [ = ]       0    .debug_abbrev
+0.0%      +8  [ = ]       0    .debug_aranges
+0.0%     +28  [ = ]       0    .debug_frame
+0.0%    +704  [ = ]       0    .debug_info
+0.0%    +617  [ = ]       0    .debug_line
+0.0%     +73  [ = ]       0    .debug_loclists
-0.0%     -20  [ = ]       0    .debug_rnglists
  [DEL]      -3  [ = ]       0    [Unmapped]
  -0.0%     -17  [ = ]       0    [section .debug_rnglists]
+0.0%    +255  [ = ]       0    .debug_str
-1.2%      -3  [ = ]       0    .shstrtab
+0.0%     +67  [ = ]       0    .strtab
  [NEW]     +67  [ = ]       0    ucdr_serialize_gimbal_device_attitude_status()
+0.0%     +32  [ = ]       0    .symtab
  [NEW]     +32  [ = ]       0    ucdr_serialize_gimbal_device_attitude_status()
-5.4%    -480  [ = ]       0    [Unmapped]
+0.0% +1.77Ki  +0.0%    +480    TOTAL

px4_fmu-v6x [Total VM Diff: 480 byte (0.02 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +480  +0.0%    +480    .text
  [NEW]    +288  [NEW]    +288    ucdr_serialize_gimbal_device_attitude_status()
  +0.1%    +104  +0.1%    +104    [section .text]
  +2.6%     +84  +2.6%     +84    UxrceddsClient::run()
   +44%      +4   +44%      +4    g_nullstring
  +5.0%      +4  +5.0%      +4    write_user_stack.constprop.0
  -4.5%      -4  -4.5%      -4    FlightTask
+0.0%     +55  [ = ]       0    .debug_abbrev
+0.0%      +8  [ = ]       0    .debug_aranges
+0.0%     +28  [ = ]       0    .debug_frame
+0.0%    +704  [ = ]       0    .debug_info
+0.0%    +617  [ = ]       0    .debug_line
+0.0%     +73  [ = ]       0    .debug_loclists
-0.0%     -16  [ = ]       0    .debug_rnglists
   +50%      +1  [ = ]       0    [Unmapped]
  -0.0%     -17  [ = ]       0    [section .debug_rnglists]
+0.0%    +255  [ = ]       0    .debug_str
+0.4%      +1  [ = ]       0    .shstrtab
+0.0%     +67  [ = ]       0    .strtab
  [NEW]     +67  [ = ]       0    ucdr_serialize_gimbal_device_attitude_status()
+0.0%     +32  [ = ]       0    .symtab
  [NEW]     +32  [ = ]       0    ucdr_serialize_gimbal_device_attitude_status()
-10.5%    -480  [ = ]       0    [Unmapped]
+0.0% +1.78Ki  +0.0%    +480    TOTAL

Updated: 2025-10-14T18:50:20

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
Copy link
Member

@beniaminopozzan beniaminopozzan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dakejahl , in

matrix::Quatf q_yaw_correction = matrix::Quatf(cosf(yaw_offset / 2), 0, 0, sinf(yaw_offset / 2));

matrix::Quatf q_gimbal_FLU = q_yaw_correction * q_gimbal_FLU_raw;
_q_gimbal = q_FLU_to_FRD * q_gimbal_FLU * q_FLU_to_FRD.inversed();

you're computing

_q_gimbal = q_FLU_to_FRD *  q_yaw_correction * q_gimbal_FLU_raw * q_FLU_to_FRD.inversed();

There q_FLU_to_FRD * q_yaw_correction is a ENU to NED rotation so I pushed a simplified version of the formula.

Would you be able to test it please?

Nevertheless, the PR looks goods, if you prefer to keep your version feel free to force push it, I'll approve straight away

@dakejahl
Copy link
Contributor Author

@beniaminopozzan thank you for the simplification! I just tested and it works the same as before

@dakejahl dakejahl merged commit a645368 into main Oct 14, 2025
71 checks passed
@dakejahl dakejahl deleted the pr-gz_gimbal_yaw branch October 14, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants