[ros-users] [Discourse.ros.org] [Next Generation ROS] ROS2: …

Forside
Vedhæftede filer:
Indlæg som e-mail
+ (text/plain)
Slet denne besked
Besvar denne besked
Skribent: Lennart Nachtigall via ros-users
Dato:  
Til: ros-users
Emne: [ros-users] [Discourse.ros.org] [Next Generation ROS] ROS2: running command inside Qt?


Hi,what do you mean by running inside Qt ? Building an application that uses Qt and ROS2 or opening a ROS2 package inside the Qt Creator IDE ? In the second case I'd say it is easier to open a bash. Then source the ros2_ws and your own workspace. (See also https://discourse.ros.org/t/trouble-opening-package-in-qtcreator/2196/5)
and then start qtcreator in this terminal.

In the first case you have to adjust your CMakeLists.txt (For example like that: https://github.com/firesurfer/ros2_components/blob/master/CMakeLists.txt)

The relevant lines are:
    find_package(Qt5Core REQUIRED)
    find_package(Qt5Network REQUIRED)
    find_package(Qt5Widgets REQUIRED)


and
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

And in the CMakeLists that acutally adds targets ( https://github.com/firesurfer/ros2_components/blob/master/src/ros2_components/CMakeLists.txt)

include_directories(
    ${Qt5Core_INCLUDE_DIRS} 
    ${Qt5Network_INCLUDE_DIRS}
    ${Qt5Widgets_INCLUDE_DIRS}


    )


and

target_link_libraries(<your target name>
    Qt5::Core
    Qt5::Network
    Qt5::Widgets


)





---
[Visit Topic](https://discourse.ros.org/t/ros2-running-command-inside-qt/2673/3) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list

http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>