diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a3b45fa..dc37f55d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ find_package(geometry_msgs REQUIRED) find_package(px4_msgs REQUIRED) find_package(rclcpp REQUIRED) find_package(sensor_msgs REQUIRED) +find_package(rclpy REQUIRED) ################# # Setup targets # @@ -111,4 +112,17 @@ if(BUILD_TESTING) ament_lint_auto_find_test_dependencies() endif() +########### +# Python ## +########### + +# Install Python modules +ament_python_install_package(${PROJECT_NAME}) + +# Install Python executables +install(PROGRAMS + src/examples/offboard_py/offboard_control.py + DESTINATION lib/${PROJECT_NAME} +) + ament_package() diff --git a/px4_ros_com/__init__.py b/px4_ros_com/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/px4_ros_com/module_to_import.py b/px4_ros_com/module_to_import.py new file mode 100644 index 00000000..e69de29b diff --git a/src/examples/offboard_py/offboard_control.py b/src/examples/offboard_py/offboard_control.py old mode 100644 new mode 100755 index b23e9cd2..7d59f536 --- a/src/examples/offboard_py/offboard_control.py +++ b/src/examples/offboard_py/offboard_control.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import rclpy from rclpy.node import Node from rclpy.qos import QoSProfile, ReliabilityPolicy, HistoryPolicy, DurabilityPolicy