HITL on VOXL2
-
@Eric-Katzfey Thanks! I am able to do a basic HITL now. However I get this error message on QGC
I see that the flight mode on QGC is always "unknown", is this expected?
-
@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.
-
@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:
I tried VOXL2 in both station and softap mode, but still get the same result. I am connecting QGC to VOXL2 over UDP.
-
@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?
-
@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
If it is meant to be disabled, how are we supposed to test MAVROS/ MAVSDK in HITL?
-
@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!
-
@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
-
@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?
-
@kerct Can you supply the output of
voxl-inspect-services
? I'd like to see all of the other modules running. -
@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.
-
@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.
-
@kerct We will update the documentation to reflect these findings. Thanks!
-
@Zachary-Lowell-0 @Eric-Katzfey Yup, all's good now after stopping voxl-qvio-server. Thanks for the help!