Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Brainstorm
  4. Running ROS2 using QT5

Running ROS2 using QT5

Scheduled Pinned Locked Moved Solved Brainstorm
9 Posts 4 Posters 4.0k Views
  • 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.
  • S Offline
    S Offline
    serkan_tr
    wrote on 28 Dec 2022, 11:08 last edited by
    #1

    Hello to everyone

    I'm new to qt so I'm running into a few issues. I'm trying to include ros2 in a qt interface that I want to do, when I did it with cmake, I got it working, but I have no idea how to do it on the qmake side

    INCLUDEPATH += C:\\opt\\ros\\foxy\\x64\\include 
    DEPENDPATH  += C:\opt\ros\foxy\x64\lib
    

    i added these two.
    ros sees it in qt creator, it doesn't give an error, but when I run it, it gives an error in all libraries

    I thought of two ways as a solution.

    1. I think that writing in the ros2 python file will not get stuck in the build part by this way (but how do I connect the signal slot) qt files were written over cpp, how can the signal in this section trigger the slots in python or how the signals in python trigger the slots on the cpp side
      2)I couldn't add ros to the qmake file, so if I have a cmake file and a qmake file, how can I run these files in each other?
      I will write inside the ros2 cmake file and run the cmake file with qmake
      can these be done
    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kent-Dorfman
      wrote on 28 Dec 2022, 12:10 last edited by
      #2

      dont assume that everyone knows what ros2 is.

      S 1 Reply Last reply 30 Dec 2022, 05:12
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 28 Dec 2022, 20:19 last edited by
        #3

        Hi and welcome to devnet,

        Solution number 3: use only CMake.

        CMake could already be used with Qt 5 and is now the default for Qt 6.

        By the way, why are you trying to mix Python and C++ ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        S 1 Reply Last reply 30 Dec 2022, 05:27
        0
        • K Kent-Dorfman
          28 Dec 2022, 12:10

          dont assume that everyone knows what ros2 is.

          S Offline
          S Offline
          serkan_tr
          wrote on 30 Dec 2022, 05:12 last edited by
          #4

          @Kent-Dorfman said in Running ROS2 using QT5:

          dont assume that everyone knows what ros2 is.

          ROS (Robot Operating System) is a robot operating system and is designed to facilitate the design and programming of robot software for robot developers. ROS can run on many robot systems and bundle software modules (called packages) for many robot types, making it easy for robots to communicate with each other, collect and share data, control motion, and automate tasks.

          ROS manages all software modules (packages) running on a robot system and the communication between them. This makes it easier to communicate between the components of the robot software and to add new modules. ROS also includes pre-developed modules for many robot platforms and saves robot software developers time.

          ROS is an open source project and is constantly being developed with contributions from the community. ROS helps robot software developers design and program robot software, making it easy for robots to communicate with each other, collect and share data, control motion, and automate tasks.

          1 Reply Last reply
          0
          • S SGaist
            28 Dec 2022, 20:19

            Hi and welcome to devnet,

            Solution number 3: use only CMake.

            CMake could already be used with Qt 5 and is now the default for Qt 6.

            By the way, why are you trying to mix Python and C++ ?

            S Offline
            S Offline
            serkan_tr
            wrote on 30 Dec 2022, 05:27 last edited by
            #5

            @SGaist said in Running ROS2 using QT5:

            Hi and welcome to devnet,

            Solution number 3: use only CMake.

            CMake could already be used with Qt 5 and is now the default for Qt 6.

            By the way, why are you trying to mix Python and C++ ?

            My goal is to integrate ROS into an open source QT project. I did this in the Ubuntu environment, but when I switched to the windows environment, it started giving errors.
            They did the QT project with both cmake and qmake, ubuntu works on both files, but windows qmake works, so I asked if ROS2 qmake can be used.
            I showed the required library paths for ROS2 and QT didn't give any errors but it gave errors during build so I gave up on going this way
            Since python is a code that works directly without compiling, I thought that if I could write in ROS python and access the QT project, my problem would be solved again.
            ,I'm wondering if the signal and slots are accessible by python because the open source project is written in C++

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 30 Dec 2022, 20:57 last edited by
              #6

              Before moving away from something that looks functional, which errors did you get on Windows ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              S 1 Reply Last reply 5 Jan 2023, 12:14
              0
              • J Offline
                J Offline
                JoeCFD
                wrote on 1 Jan 2023, 03:51 last edited by JoeCFD 1 Jan 2023, 03:55
                #7

                did you add lib names in the pro file?
                you need to add something like, same as in cmake files
                LIBS += -Llibpath -llibname1 -llibname2

                S 1 Reply Last reply 5 Jan 2023, 12:26
                0
                • S SGaist
                  30 Dec 2022, 20:57

                  Before moving away from something that looks functional, which errors did you get on Windows ?

                  S Offline
                  S Offline
                  serkan_tr
                  wrote on 5 Jan 2023, 12:14 last edited by
                  #8

                  @SGaist
                  yes, I gave up on going with qmake. I fixed the cmake file and because I got an error in debug mode, I continued in release mode. It's working now

                  1 Reply Last reply
                  0
                  • J JoeCFD
                    1 Jan 2023, 03:51

                    did you add lib names in the pro file?
                    you need to add something like, same as in cmake files
                    LIBS += -Llibpath -llibname1 -llibname2

                    S Offline
                    S Offline
                    serkan_tr
                    wrote on 5 Jan 2023, 12:26 last edited by serkan_tr 1 Apr 2025, 06:49
                    #9

                    @JoeCFD yes I tried but the libraries I added are used for ROS1. so ROS2 also bases these jobs on ament_cmake so it gave errors.
                    I solved the problem by cmake and moved forward
                    Sample code for ROS2

                    Screenshot from 2024-07-03 09-03-13.png

                    1 Reply Last reply
                    0

                    7/9

                    1 Jan 2023, 03:51

                    • Login

                    • Login or register to search.
                    7 out of 9
                    • First post
                      7/9
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved