# HITL with voxl 2

Source: https://forum.modalai.com/topic/1204/hitl-with-voxl-2
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2022-08-16 04:31:22 UTC by Tamas Pal 0
Replies: 23 · Views: 6458

## Tamas Pal 0 · 2022-08-16 04:31:22 UTC

https://docs.modalai.com/voxl2-PX4-hitl/
In the VOXL2 PX4 HITL for software setup on voxl 2 the file voxl-px4-hitl file is not getting generated after compilation. I have tried this with both ubuntu and debian, results are still the same. Is it like that or there is some error?

Terminal:
**/hitl$ git submodule update --init --recursive**
Submodule 'Tools/flightgear_bridge' (https://github.com/PX4/PX4-FlightGear-Bridge.git) registered for path 'Tools/flightgear_bridge'
Submodule 'Tools/jMAVSim' (https://github.com/PX4/jMAVSim.git) registered for path 'Tools/jMAVSim'
Submodule 'Tools/jsbsim_bridge' (https://github.com/PX4/px4-jsbsim-bridge.git) registered for path 'Tools/jsbsim_bridge'
Submodule 'Tools/sitl_gazebo' (https://github.com/PX4/PX4-SITL_gazebo.git) registered for path 'Tools/sitl_gazebo'
Submodule 'boards/atlflight/cmake_hexagon' (https://github.com/PX4/cmake_hexagon.git) registered for path 'boards/atlflight/cmake_hexagon'
Submodule 'mavlink/include/mavlink/v2.0' (https://github.com/mavlink/c_library_v2.git) registered for path 'mavlink/include/mavlink/v2.0'
Submodule 'platforms/nuttx/NuttX/apps' (https://github.com/PX4/NuttX-apps.git) registered for path 'platforms/nuttx/NuttX/apps'
Submodule 'platforms/nuttx/NuttX/nuttx' (https://github.com/PX4/NuttX.git) registered for path 'platforms/nuttx/NuttX/nuttx'
Submodule 'platforms/qurt/dspal' (https://github.com/modalai/dspal.git) registered for path 'platforms/qurt/dspal'
Submodule 'src/drivers/gps/devices' (https://github.com/modalai/PX4-GPSDrivers.git) registered for path 'src/drivers/gps/devices'
Submodule 'src/drivers/uavcan/libuavcan' (https://github.com/PX4/libuavcan.git) registered for path 'src/drivers/uavcan/libuavcan'
Submodule 'src/lib/ecl' (https://github.com/PX4/PX4-ECL.git) registered for path 'src/lib/ecl'
Submodule 'src/lib/matrix' (https://github.com/PX4/PX4-Matrix.git) registered for path 'src/lib/matrix'
Submodule 'src/modules/micrortps_bridge/micro-CDR' (https://github.com/PX4/Micro-CDR.git) registered for path 'src/modules/micrortps_bridge/micro-CDR'
Cloning into '/home/tamas/Develop/hitl/Tools/flightgear_bridge'...
Cloning into '/home/tamas/Develop/hitl/Tools/jMAVSim'...
Cloning into '/home/tamas/Develop/hitl/Tools/jsbsim_bridge'...
Cloning into '/home/tamas/Develop/hitl/Tools/sitl_gazebo'...
Cloning into '/home/tamas/Develop/hitl/boards/atlflight/cmake_hexagon'...
Cloning into '/home/tamas/Develop/hitl/mavlink/include/mavlink/v2.0'...
Cloning into '/home/tamas/Develop/hitl/platforms/nuttx/NuttX/apps'...
Cloning into '/home/tamas/Develop/hitl/platforms/nuttx/NuttX/nuttx'...
Cloning into '/home/tamas/Develop/hitl/platforms/qurt/dspal'...
Cloning into '/home/tamas/Develop/hitl/src/drivers/gps/devices'...
Cloning into '/home/tamas/Develop/hitl/src/drivers/uavcan/libuavcan'...
Cloning into '/home/tamas/Develop/hitl/src/lib/ecl'...
Cloning into '/home/tamas/Develop/hitl/src/lib/matrix'...
Cloning into '/home/tamas/Develop/hitl/src/modules/micrortps_bridge/micro-CDR'...
Submodule path 'Tools/flightgear_bridge': checked out '7c2c623da9f5dcb3f01d32830af1a2ed958de363'
Submodule 'models/FlightGear-Rascal' (https://github.com/ThunderFly-aerospace/FlightGear-Rascal.git) registered for path 'Tools/flightgear_bridge/models/Rascal'
Submodule 'models/FlightGear-TF-G1' (https://github.com/ThunderFly-aerospace/FlightGear-TF-G1.git) registered for path 'Tools/flightgear_bridge/models/TF-G1'
Submodule 'models/FlightGear-TF-G2' (https://github.com/ThunderFly-aerospace/FlightGear-TF-G2.git) registered for path 'Tools/flightgear_bridge/models/TF-G2'
Submodule 'models/FlightGear-TF-R1' (https://github.com/ThunderFly-aerospace/FlightGear-TF-R1.git) registered for path 'Tools/flightgear_bridge/models/TF-R1'
Cloning into '/home/tamas/Develop/hitl/Tools/flightgear_bridge/models/Rascal'...
Cloning into '/home/tamas/Develop/hitl/Tools/flightgear_bridge/models/TF-G1'...
Cloning into '/home/tamas/Develop/hitl/Tools/flightgear_bridge/models/TF-G2'...
Cloning into '/home/tamas/Develop/hitl/Tools/flightgear_bridge/models/TF-R1'...
Submodule path 'Tools/flightgear_bridge/models/Rascal': checked out 'cbdb2fc7dd44331da1dcd04a891ed7f8c27b1ef0'
Submodule path 'Tools/flightgear_bridge/models/TF-G1': checked out '4540de7ae8e71b9bd6e6f67d085695be0ab36bc3'
Submodule path 'Tools/flightgear_bridge/models/TF-G2': checked out '562ee71388c493675269210f7692d8b7a8bb800d'
Submodule path 'Tools/flightgear_bridge/models/TF-R1': checked out '158e429a0110589b1e2adfe868e166271470e144'
Submodule path 'Tools/jMAVSim': checked out '66b764ada522893c05224950aa6268c809f8e48a'
Submodule 'jMAVlib' (https://github.com/PX4/jMAVlib.git) registered for path 'Tools/jMAVSim/jMAVlib'
Cloning into '/home/tamas/Develop/hitl/Tools/jMAVSim/jMAVlib'...
Submodule path 'Tools/jMAVSim/jMAVlib': checked out 'c08380767b21938391bec676a43b36b837af9ba4'
Submodule path 'Tools/jsbsim_bridge': checked out 'e070c50d591541d440510b65c9da5cad1db5aa9a'
Submodule 'models/ATI-Resolution' (https://github.com/FGMEMBERS/ATI-Resolution.git) registered for path 'Tools/jsbsim_bridge/models/ATI-Resolution'
Submodule 'models/Rascal' (https://github.com/Auterion/FlightGear-Rascal.git) registered for path 'Tools/jsbsim_bridge/models/Rascal'
Cloning into '/home/tamas/Develop/hitl/Tools/jsbsim_bridge/models/ATI-Resolution'...
Cloning into '/home/tamas/Develop/hitl/Tools/jsbsim_bridge/models/Rascal'...
Submodule path 'Tools/jsbsim_bridge/models/ATI-Resolution': checked out '40571cd808a204f4062128daeb6bb6db8c134c48'
Submodule path 'Tools/jsbsim_bridge/models/Rascal': checked out 'd0d1db1961549e557885002cf9c3cff40cc27be2'
Submodule path 'Tools/sitl_gazebo': checked out 'e580bbcd1eb6902c658ed3ece3b3b28dfd57eb17'
Submodule 'external/OpticalFlow' (https://github.com/PX4/OpticalFlow.git) registered for path 'Tools/sitl_gazebo/external/OpticalFlow'
Cloning into '/home/tamas/Develop/hitl/Tools/sitl_gazebo/external/OpticalFlow'...
Submodule path 'Tools/sitl_gazebo/external/OpticalFlow': checked out '28ef45c1fcb532b2bfd54c16b059c6a545143b2f'
Submodule 'external/klt_feature_tracker' (https://github.com/ethz-ait/klt_feature_tracker.git) registered for path 'Tools/sitl_gazebo/external/OpticalFlow/external/klt_feature_tracker'
Cloning into '/home/tamas/Develop/hitl/Tools/sitl_gazebo/external/OpticalFlow/external/klt_feature_tracker'...
Submodule path 'Tools/sitl_gazebo/external/OpticalFlow/external/klt_feature_tracker': checked out '9b5b567ae77f93d1ef4d36151529ba2506a46e7a'
Submodule path 'boards/atlflight/cmake_hexagon': checked out '08fd0a73045346448adf6969660196228b23e1fa'
Submodule path 'mavlink/include/mavlink/v2.0': checked out '5637057af5ab8ec5667e3f8e5f8c73d3bc60eed8'
Submodule path 'platforms/nuttx/NuttX/apps': checked out 'af732cdf24d81cfbb51f7ef6189a83c2687df7c2'
Submodule path 'platforms/nuttx/NuttX/nuttx': checked out 'e7701b9e792e310112d0b45419f5f30fb384bca2'
Submodule path 'platforms/qurt/dspal': checked out '30b82752b50d8e2baa7f6415e1f96feb98c1b743'
Submodule 'cmake_hexagon' (https://github.com/ATLFlight/cmake_hexagon) registered for path 'platforms/qurt/dspal/cmake_hexagon'
Cloning into '/home/tamas/Develop/hitl/platforms/qurt/dspal/cmake_hexagon'...
Submodule path 'platforms/qurt/dspal/cmake_hexagon': checked out '07168bd5715818802b78f674816ec851307998a7'
Submodule path 'src/drivers/gps/devices': checked out '061c4008f8525d5a01a480efb0e4486577342701'
Submodule path 'src/drivers/uavcan/libuavcan': checked out '04377cc2704eb7e2fae36fffa5e67063cc40b4c0'
Submodule 'dsdl' (https://github.com/UAVCAN/dsdl) registered for path 'src/drivers/uavcan/libuavcan/dsdl'
Submodule 'libuavcan/dsdl_compiler/pyuavcan' (https://github.com/UAVCAN/pyuavcan) registered for path 'src/drivers/uavcan/libuavcan/libuavcan/dsdl_compiler/pyuavcan'
Cloning into '/home/tamas/Develop/hitl/src/drivers/uavcan/libuavcan/dsdl'...
Cloning into '/home/tamas/Develop/hitl/src/drivers/uavcan/libuavcan/libuavcan/dsdl_compiler/pyuavcan'...
remote: Enumerating objects: 951, done.
remote: Counting objects: 100% (951/951), done.
remote: Compressing objects: 100% (379/379), done.
remote: Total 951 (delta 567), reused 951 (delta 567), pack-reused 0
Receiving objects: 100% (951/951), 122.30 KiB | 6.44 MiB/s, done.
Resolving deltas: 100% (567/567), done.
From https://github.com/UAVCAN/dsdl
 * branch            192295c4f9b67f4a20b0eabf74757b6597415f2b -> FETCH_HEAD
Submodule path 'src/drivers/uavcan/libuavcan/dsdl': checked out '192295c4f9b67f4a20b0eabf74757b6597415f2b'
Submodule path 'src/drivers/uavcan/libuavcan/libuavcan/dsdl_compiler/pyuavcan': checked out 'c58477a644d20ccf95a20c151f3a0402f271c3b8'
Submodule 'dsdl' (https://github.com/UAVCAN/dsdl) registered for path 'src/drivers/uavcan/libuavcan/libuavcan/dsdl_compiler/pyuavcan/dsdl'
Cloning into '/home/tamas/Develop/hitl/src/drivers/uavcan/libuavcan/libuavcan/dsdl_compiler/pyuavcan/dsdl'...
remote: Enumerating objects: 457, done.
remote: Counting objects: 100% (457/457), done.
remote: Compressing objects: 100% (205/205), done.
remote: Total 457 (delta 247), reused 454 (delta 247), pack-reused 0
Receiving objects: 100% (457/457), 60.34 KiB | 10.06 MiB/s, done.
Resolving deltas: 100% (247/247), done.
From https://github.com/UAVCAN/dsdl
 * branch            fd12483ddd4e58242d61d74a163e7aeaa1e0f466 -> FETCH_HEAD
Submodule path 'src/drivers/uavcan/libuavcan/libuavcan/dsdl_compiler/pyuavcan/dsdl': checked out 'fd12483ddd4e58242d61d74a163e7aeaa1e0f466'
Submodule path 'src/lib/ecl': checked out 'b919f3ddf41ab422d09af91eaea2b2f9729fab13'
Submodule path 'src/lib/matrix': checked out '977cf52322ab3ca93125423a0f9e9b3eca0516d7'
Submodule path 'src/modules/micrortps_bridge/micro-CDR': checked out '56b2696e4a9bb43d2aef9690fc5c6a2d6b1af8ee'

## Reply by Tamas Pal 0 · 2022-08-16 10:59:24 UTC

@Matthew-Booker 
In the **VOXL2 PX4 HITL** for software setup on voxl 2 the file voxl-px4-hitl file is missing in the voxl-master branch of github "**https://github.com/modalai/px4-firmware/tree/voxl-master**". We followed the instructions from "**https://docs.modalai.com/voxl2-PX4-hitl/**" I have tried this with both ubuntu and debian, results are still the same. Is it like that or there is some error? How to run hitl with **voxl 2** as the files are missing.

## Reply by Zachary Lowell · 2022-08-16 15:39:50 UTC

Hi @Tamas-Pal-0 - looks like you are correct in that the voxl-px4-hitl has not been pulled into voxl-master. I would recommend for now switching over to the `voxl-dev` branch and running with the steps through there. Once it has been pulled into voxl-master, then you can recompile, reflash, and run through it on that branch. Other options as well is you can copy the file `voxl-px4-hitl` from the `voxl-dev` branch into your current working `voxl-master`, recompile, and reflash the voxl2 with the newer firmware containing the correct executable.

## Reply by Tamas Pal 0 · 2022-08-19 11:26:15 UTC

Unable to run this command 
*echo 1 | sudo tee /sys/bus/usb-serial/devices/ttyUSB0/latency_timer*
In the terminal it is showing permission denied after running the command
***tamas@tamas:~$ echo 1 | sudo tee /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
tee: /sys/bus/usb-serial/devices/ttyUSB0/latency_timer: Permission denied
1***
How to fix the problem?

## Reply by Zachary Lowell · 2022-08-19 14:36:42 UTC

@Tamas-Pal-0 said in [HITL with voxl 2](/post/5673):
> 0

This seems like a permissions issue on your end and that your user doesnt have super user permissions.

## Reply by Tamas Pal 0 · 2022-08-24 13:26:55 UTC (in reply to Zachary Lowell)

@Zachary-Lowell 
```
tamas@tamas:~$ echo 1 | sudo tee /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
tee: /sys/bus/usb-serial/devices/ttyUSB0/latency_timer: Permission denied
1
tamas@tamas:~$ ls /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
ls: cannot access '/sys/bus/usb-serial/devices/ttyUSB0/latency_timer': No such file or directory
```
How to fix it ?

## Reply by Eric Katzfey (ModalAI staff) · 2022-08-24 16:09:11 UTC (in reply to Tamas Pal 0)

@Tamas-Pal-0 What do you get with ```ls /dev/ttyUSB*```?

## Reply by Tamas Pal 0 · 2022-08-24 16:29:26 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 
I got this
```
tamas@tamas:~$ ls /dev/ttyUSB*
/dev/ttyUSB0
```
I am unable to modify anything inside **/sys/bus/usb-serial/devices/ttyUSB0** with root user also. How to fix it?

## Reply by Eric Katzfey (ModalAI staff) · 2022-08-24 16:47:48 UTC (in reply to Tamas Pal 0)

@Tamas-Pal-0 I'm not sure. This works in our development environment so something must be different in your environment. What version of Linux are you using? What cable are you using?

## Reply by Tamas Pal 0 · 2022-08-25 04:39:58 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 
The issue is fixed. It was a hardware issue. I changed the ftdi cable and the issue was solved. The  previous FTDI cable was not allowing me to change anything in  /sys/bus/usb-serial/devices/ttyUSB0 directory. The file **latency_timer** was also not there. However with the other cable, there is no such issue. Thank you for your valuable input.

## Reply by Tamas Pal 0 · 2022-08-26 05:57:31 UTC

For 3.3v J18 jst port which port of ftdi cable should be used, CTS# or RTS# ?

## Reply by Eric Katzfey (ModalAI staff) · 2022-08-26 16:11:56 UTC (in reply to Tamas Pal 0)

@Tamas-Pal-0 For UART it is just GND, TX, and RX

## Reply by Tamas Pal 0 · 2022-08-29 02:29:21 UTC (in reply to Eric Katzfey)

@Eric-Katzfey you mean we only have to connect 3 pins in j18 port ?

## Reply by Eric Katzfey (ModalAI staff) · 2022-08-29 15:24:33 UTC (in reply to Tamas Pal 0)

@Tamas-Pal-0 Yes, the fourth pin is power and we don't want that one.

## Reply by Tamas Pal 0 · 2022-08-31 05:45:05 UTC

Is there any way to verify that FTDI cable is connected properly with J18 port ?

## Reply by Eric Katzfey (ModalAI staff) · 2022-08-31 16:32:12 UTC (in reply to Tamas Pal 0)

@Tamas-Pal-0 The easiest way would be to recompile the modalai_dsp PX4 driver to add more debug messages. But if you aren't comfortable with that then we'll need to come up with something else.

## Reply by Tamas Pal 0 · 2022-09-01 05:17:14 UTC

How to do that? Is there any other way to this ?

## Reply by Eric Katzfey (ModalAI staff) · 2022-09-01 16:16:20 UTC (in reply to Tamas Pal 0)

@Tamas-Pal-0 The simulator will be sending heartbeat messages out over the serial cable. You can use the ```screen``` program to see if anything is coming from voxl 2 in the serial cable.

## Reply by Tamas Pal 0 · 2022-09-02 05:30:17 UTC (in reply to Eric Katzfey)

@Eric-Katzfey How to use screen program in this case ?

## Reply by Eric Katzfey (ModalAI staff) · 2022-09-02 16:36:52 UTC (in reply to Tamas Pal 0)

@Tamas-Pal-0 ```screen``` is just a standard Linux program. There are many ways to check the output of the serial port. To start, you could always just do ```cat /dev/ttyUSB0``` and see if anything is coming out. This post shows how to get a hex dump: https://superuser.com/questions/1402386/view-serial-device-output-in-console-in-hex

## Reply by Tamas Pal 0 · 2022-09-06 14:28:40 UTC

The problem is solved. The problem was with ftdi cable. Thank you for your valuable inputs

## Reply by Eric Katzfey (ModalAI staff) · 2022-09-06 15:24:46 UTC (in reply to Tamas Pal 0)

@Tamas-Pal-0 Excellent! How were you able to determine that it was the cable?

## Reply by Taylor Presley · 2023-01-08 18:38:41 UTC

@Eric-Katzfey @Tamas-Pal-0 For future users troubleshooting HITL setup, I was having the same issue as above. [This cable](https://www.adafruit.com/product/954) would not allow me to set the latency or share data with the VOXL 2 through J18 port, but [this cable](https://www.adafruit.com/product/70?gclid=CjwKCAiA8OmdBhAgEiwAShr40_S44Hr74VKxl9m7WPrvjAzeU8VJXdsAeyEe5sbKf7SdSYYbyEd07xoC5IIQAvD_BwE) works as intended.

## Reply by Tamas Pal 0 · 2023-01-09 05:56:32 UTC (in reply to Taylor Presley)

@Taylor-Presley Right. Some cables work some don't.
