Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. VOXL Compute & Autopilot
  3. Flight Core
  4. Get vehicle attitude

Get vehicle attitude

Scheduled Pinned Locked Moved Flight Core
9 Posts 2 Posters 1.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Andrew KeefeA Offline
    Andrew KeefeA Offline
    Andrew Keefe
    wrote on last edited by
    #1

    Is there a parameter I need, or a minimum number of sensors, to produce a vehicle_attitude message? I'm looking for a clean pitch/roll/yaw but it's not being published. I don't have a GPS/compass plugged in at the moment, but my gyros and IMU are calibrated.

    1 Reply Last reply
    0
    • modaltbM Offline
      modaltbM Offline
      modaltb
      ModalAI Team
      wrote on last edited by
      #2

      Hey @Andrew-Keefe ,

      What FW version are you running? Are you using vision features or just the flight controller?

      By default, PX4 (and EKF2 by way of the ECL library) won't initialize without mag data.....

      Our 1.10 release (we have a 1.11 release as well in 'beta') provides the ability to allow EKF2 to initialize without mag data. The 1.10 release needs "EV" data (external vision) but our 1.11 allows initialization even without EV data.

      1 Reply Last reply
      0
      • Andrew KeefeA Offline
        Andrew KeefeA Offline
        Andrew Keefe
        wrote on last edited by
        #3

        I branched off of version 1.0.

        Just the flight controller, and honestly not really even that. Just the sensors. There is no vision. I will connect my compass and calibrate it and see if that does the trick. I'm on the bench so rotating the compass isn't always easy.

        1 Reply Last reply
        0
        • modaltbM Offline
          modaltbM Offline
          modaltb
          ModalAI Team
          wrote on last edited by
          #4

          Yes I've had this issue myself. Here's were we tweak the ECL/EKF2 init:

          Link Preview Image
          - remove requirement to have ev data in buffer to initialize if MASK_… · modalai/ecl@207ad80

          Estimation & Control Library for Guidance, Navigation and Control Applications - - remove requirement to have ev data in buffer to initialize if MASK_… · modalai/ecl@207ad80

          favicon

          GitHub (github.com)

          You could hack at that code on your local branch and ignore mag totally and the estimator should get going (I'm more of a drivers guy and not a flight guy, so the ramifications of this are still in the air (no pun intended!))

          1 Reply Last reply
          0
          • Andrew KeefeA Offline
            Andrew KeefeA Offline
            Andrew Keefe
            wrote on last edited by
            #5

            That worked, and now I'm getting pitch from vehicle_attitude.
            With the filter enabled though, PWM is also being enabled by the system, which is interfering with the code I wrote to manually control them. I'm getting chattering.

            1 Reply Last reply
            0
            • Andrew KeefeA Offline
              Andrew KeefeA Offline
              Andrew Keefe
              wrote on last edited by
              #6

              @modaltb Can you help point me to where PWM is being enabled once EKF2 is initialized? I can't seem to get rid of this chatter.

              1 Reply Last reply
              0
              • modaltbM Offline
                modaltbM Offline
                modaltb
                ModalAI Team
                wrote on last edited by
                #7

                It's been a bit since I was in this area, but I think this is close to where you can debug setting of the PWM outputs:

                Link Preview Image
                px4-firmware/platforms/nuttx/src/px4/stm/stm32_common/io_pins/pwm_servo.c at modalai-1.11 · modalai/px4-firmware

                PX4 Autopilot Software. Contribute to modalai/px4-firmware development by creating an account on GitHub.

                favicon

                GitHub (github.com)

                That's not in the 'normal' source tree which can cause break point headaches, but it's called from here: https://github.com/modalai/px4-firmware/blob/modalai-1.11/src/drivers/pwm_out/PWMOut.cpp#L562

                I had an issue before in here that was caused by a timer bug and the wrong CCR was being used. This has been fixed, but for reference the timers are setup here: https://github.com/modalai/px4-firmware/blob/modalai-1.11/boards/modalai/fc-v1/src/timer_config.cpp#L55

                Not sure if that will help but that's where I'd start if you haven't alraedy trie

                1 Reply Last reply
                0
                • Andrew KeefeA Offline
                  Andrew KeefeA Offline
                  Andrew Keefe
                  wrote on last edited by
                  #8

                  I don't have a pwm_out driver. I do have a pwm_servo, and it's being called from PX4FMU, such as from update_pwm_out_state.

                  What I need to do, I think, is disable the mixer values for PWM so that I can set them manually. I'm not sure if my

                  ret = px4_ioctl(fd, PWM_SERVO_SET(PORT_FIN), pwm_value);

                  command goes to the mixer, or if I can bypass the mixer in mixer_module.cpp.

                  I'm basically commenting out things one at a time to see what happens since I'm not set up to step through the code.

                  1 Reply Last reply
                  0
                  • Andrew KeefeA Offline
                    Andrew KeefeA Offline
                    Andrew Keefe
                    wrote on last edited by
                    #9

                    Ah, when I run the PWM program there is no chatter on the PWM signals, so I'm going to review that code again and compare it to mine.

                    1 Reply Last reply
                    0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    ModalAI
                    Categories Recent Tags ModalAI.com Docs
                    © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups