Serial port for HITL and building gazebo target
-
Hi
I'm trying HITL with gazebo. It would be appreciated if you could help me with these 2 questions.
I'm trying to make a mavlink connection directly to the serial port (not via voxl-vision-px4. I configured it to connect with QGC and ROS via mavros.).
In voxl-px4-hitl.config, I tried
mavlink start -d /dev/uart_esc -b 921600 -m onboard -r 80000
because it seems the ESC is using J18.
https://docs.modalai.com/voxl2-esc-configs/
https://github.com/modalai/px4-firmware/blob/voxl-dev/boards/modalai/rb5-flight/voxl-px4.config#L124But running voxl-px4-hitl says
ERROR [mavlink] Device /dev/uart_esc does not exist
Which port should I put in the config?
I was working on the voxl-dev branch because px4-firmware submodule in voxl-px4 is pointing to the latest commit in voxl-dev branch.
But the HITL guide is using voxl-master branch. I succeeded to build the target in voxl-master:
DONT_RUN=1 make px4_sitl_default gazebo
But it fails in voxl-dev.
I wonder if it is supposed to work or not.
And I wonder if it is okay to run voxl-dev on VOXL2 for HITL.Thanks
-
@Youngjoo-Kim said in Serial port for HITL and building gazebo target:
mavlink start -d /dev/uart_esc -b 921600 -m onboard -r 80000
-
You cannot leverage that serial port to connect to QGC and run HITL at the same time. There will be conflicting mavlink packets and it will not work. You either neither connect to QGC via voxl-vision-px4 and have those serial mavlink packets be passing the gazebo packets, or not run gazebo at all and only have a serial connection going to QGC. If I put my money on it - the /dev/uart_esc actually isnt the name of the wire in the dev environment. In px4 for the voxl2 these ports are usually represented by numbers instead of paths - so I would recommend putting a value of '2' which should be the dsp port you are connected to (the 4 pin jst connector on the bottom of the voxl2).
-
You can run any version of px4 for whichever computer is running gazebo. I always just checkout PX4-Autopilot v1.12.3 to run gazebo.
Let me know if this helps out.
Zach -
-
@Youngjoo-Kim Mavlink runs on the applications processor (Linux). There is no UART available to that processor without purchasing add on cards. The UART for the ESC is connected to the DSP processor which runs the real time flight control software for PX4. You cannot directly access that port from the applications processor.
-
@Eric-Katzfey Thank you for your answer Eric.
Could you tell me about the J18 port, like which part of VOXL SDK is communicating with it? -
@Zachary-Lowell Thank you for your answer.
- I'm using QGC via wifi, not the serial port. So it might be okay to use the serial port for other purposes.
With some struggles, I found that /dev/ttyHS0 'exists' because putting this port doesn't give me any error. (But it could be some other port connected to the ARM, rather than the 4-pin JST port)
Anyway, do you know how to figure out which port name corresponds to the port on the board?- Thanks.
-
@Youngjoo-Kim J18 is the port normally used for the UART based ESC. It is connected to the DSP, not the Linux processor. You cannot directly access it from Linux. Why do you need to run Mavlink over a serial port? We support and recommend using UDP.