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

    Serial port for HITL and building gazebo target

    Ask your questions right here!
    3
    6
    543
    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.
    • Youngjoo KimY
      Youngjoo Kim
      last edited by Youngjoo Kim

      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#L124

      But 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

      Eric KatzfeyE 1 Reply Last reply Reply Quote 0
      • Zachary LowellZ
        Zachary Lowell ModalAI Team
        last edited by Zachary Lowell

        @Youngjoo-Kim said in Serial port for HITL and building gazebo target:

        mavlink start -d /dev/uart_esc -b 921600 -m onboard -r 80000

        Hi @Youngjoo-Kim

        1. 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).

        2. 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 KimY 1 Reply Last reply Reply Quote 0
        • Eric KatzfeyE
          Eric Katzfey ModalAI Team @Youngjoo Kim
          last edited by

          @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.

          Youngjoo KimY 1 Reply Last reply Reply Quote 0
          • Youngjoo KimY
            Youngjoo Kim @Eric Katzfey
            last edited by Youngjoo Kim

            @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?

            Eric KatzfeyE 1 Reply Last reply Reply Quote 0
            • Youngjoo KimY
              Youngjoo Kim @Zachary Lowell
              last edited by

              @Zachary-Lowell Thank you for your answer.

              1. 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?

              1. Thanks.
              1 Reply Last reply Reply Quote 0
              • Eric KatzfeyE
                Eric Katzfey ModalAI Team @Youngjoo Kim
                last edited by

                @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.

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