ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    HITL on VOXL2

    Ask your questions right here!
    3
    15
    929
    Loading More Posts
    • 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.
    • K
      kerct
      last edited by

      I have changed the voxl-px4 version on Starling and added the 3 files (voxl-px4-hitl, voxl-px4-hitl-start, and voxl-px4-hitl-set-default-parameters.config) respectively from the response here https://forum.modalai.com/topic/2529/development-on-starling-v2/4

      However, I am still unable to carry out HITL properly as shown

      7c3345cc-d024-49ca-9a95-fc3dca0bc48c-image.png

      56739048-ab2f-471b-9859-f48db5257b94-image.png

      What could be the issue?

      Eric KatzfeyE 1 Reply Last reply Reply Quote 0
      • Eric KatzfeyE
        Eric Katzfey ModalAI Team @kerct
        last edited by

        @kerct You need to run voxl-px4-hitl manually so that you can directly interact with the px4 shell. In your screenshot you try to run it manually but it fails because voxl-px4 is already running in the background. To disable that you need to stop the auto starting of voxl-px4 and any other applications that depend on voxl-px4. You can view all of the voxl applications and their current state with the command voxl-inspect-services. At a minimum you will need to do systemctl disable voxl-vision-hub, systemctl disable voxl-mavlink-server, and systemctl disable voxl-px4. Then reboot the board and look at voxl-inspect-services again. You should see that voxl-px4 is disabled and not running. Then you can run voxl-px4-hitl and you will be able to interact directly with the px4 shell to enter the qshell commander arm command.

        K 1 Reply Last reply Reply Quote 0
        • K
          kerct @Eric Katzfey
          last edited by

          @Eric-Katzfey Thanks! I am able to do a basic HITL now. However I get this error message on QGC

          78afda14-a360-4188-9725-cd2a97201c34-image.png

          I see that the flight mode on QGC is always "unknown", is this expected?

          fe5d9451-5cee-4e1c-a2f3-65386fb011a5-image.png
          5a82fcef-cd34-4ca1-9a9b-d569310af5be-image.png

          Eric KatzfeyE 1 Reply Last reply Reply Quote 1
          • Eric KatzfeyE
            Eric Katzfey ModalAI Team @kerct
            last edited by

            @kerct Getting QGC to work properly with gazebo running on the same computer can be a little tricky. There are a few things that can go wrong. The first is that it can take the serial port if it is started before gazebo. We need gazebo to get the serial port so it has to be started first. The next issue is that gazebo will forward all mavlink messages it gets to QGC. So without any changes to gazebo QGC will get some conflicting information from gazebo. It should still work but you will see some odd behavior on QGC. The flight mode will switch back and forth between unknown and position. You can look at the mavlink inspector in QGC and see that there are two different heartbeat messages coming in. I think there is a way to configure gazebo not to forward the messages but I haven't figured it out yet. Instead I comment out line 746 in file Tools/simulation/gazebo-classic/sitl_gazebo-classic/src/mavlink_interface.cpp (e.g. // forward_mavlink_message(&message);" and rebuild gazebo to prevent that. But your issue could also be more basic than that. QGC may only be connecting to gazebo and not VOXL2 at all. How are you connecting QGC to VOXL2? Do you have WiFi setup? Is it in station mode or softap mode? If you have the luxury of having a second computer you can try to run QGC on that computer so that it makes it harder for gazebo and QGC to interact.

            K 1 Reply Last reply Reply Quote 0
            • K
              kerct @Eric Katzfey
              last edited by

              @Eric-Katzfey Thanks for the explanation! However in my case I don't see the flight mode switching back at forth, it is just stuck at unknown. My mavlink inspector in QGC only shows one heartbeat message:
              d3783397-5a5d-43c4-bfca-ce279b2c20a4-image.png

              I tried VOXL2 in both station and softap mode, but still get the same result. I am connecting QGC to VOXL2 over UDP.

              Eric KatzfeyE 1 Reply Last reply Reply Quote 0
              • Eric KatzfeyE
                Eric Katzfey ModalAI Team @kerct
                last edited by

                @kerct That indicates that QGC is only connecting to gazebo and not VOXL2 at all. Can you ping across the WiFi link in both directions? Do you have voxl-mavlink-server running on VOXL2?

                K 1 Reply Last reply Reply Quote 0
                • K
                  kerct @Eric Katzfey
                  last edited by

                  @Eric-Katzfey Ah okay, I had voxl-mavlink-server disabled but turns out I didn't need to disable it in order to start voxl-px4-hitl. I saw the flight mode switching too but it stops after commenting out forward_mavlink_message 🙂

                  Should voxl-vision-hub be disabled for HITL? When I enable it, the drone (iris_hitl) drops and lands by itself after taking off
                  730b172a-770e-49c0-8a1a-16a143e8574f-image.png

                  If it is meant to be disabled, how are we supposed to test MAVROS/ MAVSDK in HITL?

                  Eric KatzfeyE 3 Replies Last reply Reply Quote 0
                  • Zachary Lowell 0Z
                    Zachary Lowell 0 ModalAI Team
                    last edited by

                    @kerct you are not supposed to disable voxl-vision-hub. Voxl-vision-hub is indeed required for mavsdk and mavros communication via the secondary ip address over localhost, etc.

                    Why are you enabling it middair? What happens when it is enabled from the get go?

                    voxl-vision-hub should have the enable_secondary_host set to true, with the port set to something like 14551, and then in voxl-mavlink-server, you should have the secondary ip address set to 127.0.0.1 (localhost). Then the initial ip address is that of the computer running qgc which it looks like you already have!

                    1 Reply Last reply Reply Quote 0
                    • Zachary Lowell 0Z
                      Zachary Lowell 0 ModalAI Team
                      last edited by

                      @kerct said in HITL on VOXL2:

                      Should voxl-vision-hub be disabled for HITL? When I enable it, the drone (iris_hitl) drops and lands by itself after taking off

                      I will try recreating on the bench today and let you know @kerct

                      1 Reply Last reply Reply Quote 0
                      • Zachary Lowell 0Z
                        Zachary Lowell 0 ModalAI Team
                        last edited by

                        @kerct said in HITL on VOXL2:

                        Should voxl-vision-hub be disabled for HITL? When I enable it, the drone (iris_hitl) drops and lands by itself after taking off

                        @kerct what happens when you run voxl-px4-hitl with voxl-vision-hub enabled but you have qgc closed and takeoff/land via the px4 shell? Does it still automatically land when it hits the pinacle of the flight?

                        1 Reply Last reply Reply Quote 0
                        • Eric KatzfeyE
                          Eric Katzfey ModalAI Team @kerct
                          last edited by

                          @kerct Can you supply the output of voxl-inspect-services? I'd like to see all of the other modules running.

                          1 Reply Last reply Reply Quote 0
                          • Eric KatzfeyE
                            Eric Katzfey ModalAI Team @kerct
                            last edited by

                            @kerct If voxl-qvio-server is still running it may be sending real VIO data to PX4. So that would be confusing since gazebo would be sending fake sensor data indicating that the drone is gaining altitude and the real VIO data would be saying that the drone hasn't moved. Killing voxl-vision-hub would solve that be preventing that data from reaching PX4. But really it's voxl-qvio-server that should be stopped.

                            1 Reply Last reply Reply Quote 0
                            • Zachary Lowell 0Z
                              Zachary Lowell 0 ModalAI Team
                              last edited by

                              @Eric-Katzfey said in HITL on VOXL2:

                              that

                              @Eric-Katzfey @kerct can confirm as well that disabling/stopping voxl-qvio-server allows to fly perfeclty in hitl. Culprit is qvio not voxl-vision-hub.

                              K 1 Reply Last reply Reply Quote 0
                              • Eric KatzfeyE
                                Eric Katzfey ModalAI Team @kerct
                                last edited by

                                @kerct We will update the documentation to reflect these findings. Thanks!

                                1 Reply Last reply Reply Quote 0
                                • K
                                  kerct @Zachary Lowell 0
                                  last edited by

                                  @Zachary-Lowell-0 @Eric-Katzfey Yup, all's good now after stopping voxl-qvio-server. Thanks for the help!

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post
                                  Powered by NodeBB | Contributors