diff --git a/cpp_pubsub/CMakeLists.txt b/cpp_pubsub/CMakeLists.txt deleted file mode 100644 index f199cabc..00000000 --- a/cpp_pubsub/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(cpp_pubsub) - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) -endif() - -# find dependencies -find_package(ament_cmake REQUIRED) -# uncomment the following section in order to fill in -# further dependencies manually. -# find_package( REQUIRED) -find_package(rclcpp REQUIRED) -find_package(std_msgs REQUIRED) - -add_executable(talker src/publisher_member_function.cpp) -ament_target_dependencies(talker rclcpp std_msgs) -add_executable(listener src/subscriber_member_function.cpp) -ament_target_dependencies(listener rclcpp std_msgs) - -install(TARGETS - talker - listener - DESTINATION lib/${PROJECT_NAME}) - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - # the following line skips the linter which checks for copyrights - # comment the line when a copyright and license is added to all source files - set(ament_cmake_copyright_FOUND TRUE) - # the following line skips cpplint (only works in a git repo) - # comment the line when this package is in a git repo and when - # a copyright and license is added to all source files - set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() - -ament_package() diff --git a/cpp_pubsub/package.xml b/cpp_pubsub/package.xml deleted file mode 100644 index 8553fb33..00000000 --- a/cpp_pubsub/package.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - cpp_pubsub - 0.0.0 - Example of publisher/subscriber nodes in ROS 2 for the 5G drone - ic - Apache License 2.0 - - ament_cmake - rclcpp - std_msgs - - ament_lint_auto - ament_lint_common - - - ament_cmake - - diff --git a/cpp_pubsub/src/publisher_member_function.cpp b/cpp_pubsub/src/publisher_member_function.cpp deleted file mode 100644 index c8d2ebfe..00000000 --- a/cpp_pubsub/src/publisher_member_function.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2016 Open Source Robotics Foundation, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include - -#include "rclcpp/rclcpp.hpp" -#include "std_msgs/msg/string.hpp" - -using namespace std::chrono_literals; - -/* This example creates a subclass of Node and uses std::bind() to register a - * member function as a callback from the timer. */ - -class MinimalPublisher : public rclcpp::Node -{ -public: - MinimalPublisher() - : Node("minimal_publisher"), count_(0) - { - publisher_ = this->create_publisher("topic", 10); - timer_ = this->create_wall_timer( - 500ms, std::bind(&MinimalPublisher::timer_callback, this)); - } - -private: - void timer_callback() - { - auto message = std_msgs::msg::String(); - message.data = "Hello, world! " + std::to_string(count_++); - RCLCPP_INFO(this->get_logger(), "Publishing: '%s'", message.data.c_str()); - publisher_->publish(message); - } - rclcpp::TimerBase::SharedPtr timer_; - rclcpp::Publisher::SharedPtr publisher_; - size_t count_; -}; - -int main(int argc, char * argv[]) -{ - rclcpp::init(argc, argv); - rclcpp::spin(std::make_shared()); - rclcpp::shutdown(); - return 0; -} diff --git a/cpp_pubsub/src/subscriber_member_function.cpp b/cpp_pubsub/src/subscriber_member_function.cpp deleted file mode 100644 index 1560403e..00000000 --- a/cpp_pubsub/src/subscriber_member_function.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2016 Open Source Robotics Foundation, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include "rclcpp/rclcpp.hpp" -#include "std_msgs/msg/string.hpp" -using std::placeholders::_1; - -class MinimalSubscriber : public rclcpp::Node -{ -public: - MinimalSubscriber() - : Node("minimal_subscriber") - { - subscription_ = this->create_subscription( - "topic", 10, std::bind(&MinimalSubscriber::topic_callback, this, _1)); - } - -private: - void topic_callback(const std_msgs::msg::String::SharedPtr msg) const - { - RCLCPP_INFO(this->get_logger(), "I heard: '%s'", msg->data.c_str()); - } - rclcpp::Subscription::SharedPtr subscription_; -}; - -int main(int argc, char * argv[]) -{ - rclcpp::init(argc, argv); - rclcpp::spin(std::make_shared()); - rclcpp::shutdown(); - return 0; -} diff --git a/drone_sensors/CMakeLists.txt b/drone_sensors/CMakeLists.txt deleted file mode 100644 index 7368ee75..00000000 --- a/drone_sensors/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(drone_sensors) - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) -endif() - -# find dependencies -find_package(ament_cmake REQUIRED) -# uncomment the following section in order to fill in -# further dependencies manually. -# find_package( REQUIRED) -find_package(rclcpp REQUIRED) -find_package(std_msgs REQUIRED) - -# add executable so that the node can be run with ros2 run -add_executable(height_sensor src/height_sensor.cpp) -ament_target_dependencies(height_sensor rclcpp std_msgs) - -# add install targets section so ros2 run can find the executable -install(TARGETS -height_sensor -DESTINATION lib/${PROJECT_NAME}) - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - # the following line skips the linter which checks for copyrights - # comment the line when a copyright and license is added to all source files - set(ament_cmake_copyright_FOUND TRUE) - # the following line skips cpplint (only works in a git repo) - # comment the line when this package is in a git repo and when - # a copyright and license is added to all source files - set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() - -ament_package() diff --git a/drone_sensors/package.xml b/drone_sensors/package.xml deleted file mode 100644 index a2ba2a45..00000000 --- a/drone_sensors/package.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - drone_sensors - 0.0.0 - package for the environment sensors of the 5G drone (height meter, object detection) - Sem van der Hoeven - Apache License 2.0 - - ament_cmake - - rclcpp - std_msgs - - ament_lint_auto - ament_lint_common - - - ament_cmake - - diff --git a/drone_sensors/src/height_sensor.cpp b/drone_sensors/src/height_sensor.cpp deleted file mode 100644 index 89f1237f..00000000 --- a/drone_sensors/src/height_sensor.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include //time measurement -#include // reading from serial port - -#include "rclcpp/rclcpp.hpp" -#include "std_msgs/msg/string.hpp" - -#define TEXT_MODE 0x00, 0x11, 0x01, 0x45 -#define BINARY_MODE 0x00, 0x11, 0x02, 0x4C -#define SINGLE_PIXEL_MODE 0x00, 0x21, 0x01, 0xBC -#define TWO_BY_TWO_PIXEL_MODE 0x00, 0x21, 0x02, 0xB5 -#define TWO_PIXEL_MODE 0x00, 0x21, 0x03, 0xB2 -#define SHORT_RANGE_MODE 0x00, 0x61, 0x01, 0xE7 -#define LONG_RANGE_MODE 0x00, 0x61, 0x03, 0xE9 - -using namespace std::chrono_literals; // for time measurements - - - -class HeightSensorPublisher : public rclcpp::Node -{ -public: - HeightSensorPublisher() : Node("height_sensor_publisher") - { - publisher_ = this->create_publisher("height_sensor", 10); - timer_ = this->create_wall_timer( - 5ms, std::bind(&HeightSensorPublisher::timer_callback, this)); - RCLCPP_INFO(this->get_logger(), "Starting height sensor publisher"); - - setup_serial_port(); - } - -private: - /** - * @brief Timer callback function to publish the height sensor data - * - */ - void timer_callback() - { - char *readdata = new char[1]; - serial_port.read(readdata, 1); - auto message = std_msgs::msg::String(); - RCLCPP_INFO(this->get_logger(), "data: %s", readdata); - - if (readdata[0] == 0x54) // 0x54 = T (from the user manual) - { - RCLCPP_INFO(this->get_logger(), "Height sensor start measurement"); - char *measurement = new char[2]; - serial_port.read(measurement, 2); - message.data = "Height: " + std::to_string(measurement[0]) + std::to_string(measurement[1]); - RCLCPP_INFO(this->get_logger(), "Publishing: %s", message.data.c_str()); - publisher_->publish(message); - - } - } - - /** - * @brief Set the up serial port object to read from the sensor (/dev/ttyACM0) - * - */ - void setup_serial_port() - { - serial_port.open("/dev/ttyACM0", std::ios::in); - if (!serial_port.is_open()) - { - RCLCPP_ERROR(this->get_logger(), "Could not open serial port"); - return; - } - else - { - RCLCPP_INFO(this->get_logger(), "Serial port opened on /dev/ttyACM0"); - } - - char bmode[] = {BINARY_MODE} - serial_port.write(bmode, 4); - } - - rclcpp::TimerBase::SharedPtr timer_; - rclcpp::Publisher::SharedPtr publisher_; - std::fstream serial_port; // serial port for reading from device -}; - -int main(int argc, char *argv[]) -{ - rclcpp::init(argc, argv); - - rclcpp::executors::SingleThreadedExecutor executor; - rclcpp::Node::SharedPtr node = std::make_shared(); - executor.add_node(node); - executor.spin(); - // rclcpp::spin(std::make_shared()); - - rclcpp::shutdown(); - - return 0; -} diff --git a/my_package/CMakeLists.txt b/my_package/CMakeLists.txt deleted file mode 100644 index ac32ca48..00000000 --- a/my_package/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(my_package) - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) -endif() - -# find dependencies -find_package(ament_cmake REQUIRED) -# uncomment the following section in order to fill in -# further dependencies manually. -# find_package( REQUIRED) - -add_executable(my_node src/my_node.cpp) -target_include_directories(my_node PUBLIC - $ - $) -target_compile_features(my_node PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 - -install(TARGETS my_node - DESTINATION lib/${PROJECT_NAME}) - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - # the following line skips the linter which checks for copyrights - # comment the line when a copyright and license is added to all source files - set(ament_cmake_copyright_FOUND TRUE) - # the following line skips cpplint (only works in a git repo) - # comment the line when this package is in a git repo and when - # a copyright and license is added to all source files - set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() - -ament_package() diff --git a/my_package/package.xml b/my_package/package.xml deleted file mode 100644 index 4bf230fe..00000000 --- a/my_package/package.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - my_package - 0.0.0 - TODO: Package description - ubuntu - TODO: License declaration - - ament_cmake - - ament_lint_auto - ament_lint_common - - - ament_cmake - - diff --git a/my_package/src/my_node.cpp b/my_package/src/my_node.cpp deleted file mode 100644 index 0248b108..00000000 --- a/my_package/src/my_node.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int main(int argc, char ** argv) -{ - (void) argc; - (void) argv; - - printf("hello world my_package package\n"); - return 0; -} diff --git a/my_package_py/my_package_py/__init__.py b/my_package_py/my_package_py/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/my_package_py/my_package_py/my_node_py.py b/my_package_py/my_package_py/my_node_py.py deleted file mode 100644 index ceb86f5c..00000000 --- a/my_package_py/my_package_py/my_node_py.py +++ /dev/null @@ -1,6 +0,0 @@ -def main(): - print('Hi from my_package_py.') - - -if __name__ == '__main__': - main() diff --git a/my_package_py/package.xml b/my_package_py/package.xml deleted file mode 100644 index cb3801eb..00000000 --- a/my_package_py/package.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - my_package_py - 0.0.0 - TODO: Package description - ubuntu - TODO: License declaration - - ament_copyright - ament_flake8 - ament_pep257 - python3-pytest - - - ament_python - - diff --git a/my_package_py/resource/my_package_py b/my_package_py/resource/my_package_py deleted file mode 100644 index e69de29b..00000000 diff --git a/my_package_py/setup.cfg b/my_package_py/setup.cfg deleted file mode 100644 index 8cc1be01..00000000 --- a/my_package_py/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[develop] -script_dir=$base/lib/my_package_py -[install] -install_scripts=$base/lib/my_package_py diff --git a/my_package_py/setup.py b/my_package_py/setup.py deleted file mode 100644 index 564a8995..00000000 --- a/my_package_py/setup.py +++ /dev/null @@ -1,26 +0,0 @@ -from setuptools import setup - -package_name = 'my_package_py' - -setup( - name=package_name, - version='0.0.0', - packages=[package_name], - data_files=[ - ('share/ament_index/resource_index/packages', - ['resource/' + package_name]), - ('share/' + package_name, ['package.xml']), - ], - install_requires=['setuptools'], - zip_safe=True, - maintainer='ubuntu', - maintainer_email='ubuntu@todo.todo', - description='TODO: Package description', - license='TODO: License declaration', - tests_require=['pytest'], - entry_points={ - 'console_scripts': [ - 'my_node_py = my_package_py.my_node_py:main' - ], - }, -) diff --git a/my_package_py/test/test_copyright.py b/my_package_py/test/test_copyright.py deleted file mode 100644 index 97a39196..00000000 --- a/my_package_py/test/test_copyright.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2015 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from ament_copyright.main import main -import pytest - - -# Remove the `skip` decorator once the source file(s) have a copyright header -@pytest.mark.skip(reason='No copyright header has been placed in the generated source file.') -@pytest.mark.copyright -@pytest.mark.linter -def test_copyright(): - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found errors' diff --git a/my_package_py/test/test_flake8.py b/my_package_py/test/test_flake8.py deleted file mode 100644 index 27ee1078..00000000 --- a/my_package_py/test/test_flake8.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2017 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from ament_flake8.main import main_with_errors -import pytest - - -@pytest.mark.flake8 -@pytest.mark.linter -def test_flake8(): - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ - '\n'.join(errors) diff --git a/my_package_py/test/test_pep257.py b/my_package_py/test/test_pep257.py deleted file mode 100644 index b234a384..00000000 --- a/my_package_py/test/test_pep257.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2015 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from ament_pep257.main import main -import pytest - - -@pytest.mark.linter -@pytest.mark.pep257 -def test_pep257(): - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' diff --git a/py_pubsub/package.xml b/py_pubsub/package.xml deleted file mode 100644 index b2dae22b..00000000 --- a/py_pubsub/package.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - py_pubsub - 0.0.0 - Example of publisher/subscriber nodes in Python - ubuntu - Apache License 2.0 - - rclpy - std_msgs - - ament_copyright - ament_flake8 - ament_pep257 - python3-pytest - - - ament_python - - diff --git a/py_pubsub/py_pubsub/__init__.py b/py_pubsub/py_pubsub/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/py_pubsub/py_pubsub/publisher_member_function.py b/py_pubsub/py_pubsub/publisher_member_function.py deleted file mode 100644 index dfdb0320..00000000 --- a/py_pubsub/py_pubsub/publisher_member_function.py +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2016 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import rclpy -from rclpy.node import Node - -from std_msgs.msg import String - - -class MinimalPublisher(Node): - - def __init__(self): - super().__init__('minimal_publisher') - self.publisher_ = self.create_publisher(String, 'topic', 10) - timer_period = 0.5 # seconds - self.timer = self.create_timer(timer_period, self.timer_callback) - self.i = 0 - - def timer_callback(self): - msg = String() - msg.data = 'Hello World: %d' % self.i - self.publisher_.publish(msg) - self.get_logger().info('Publishing: "%s"' % msg.data) - self.i += 1 - - -def main(args=None): - rclpy.init(args=args) - - minimal_publisher = MinimalPublisher() - - rclpy.spin(minimal_publisher) - - # Destroy the node explicitly - # (optional - otherwise it will be done automatically - # when the garbage collector destroys the node object) - minimal_publisher.destroy_node() - rclpy.shutdown() - - -if __name__ == '__main__': - main() diff --git a/py_pubsub/py_pubsub/subscriber_member_function.py b/py_pubsub/py_pubsub/subscriber_member_function.py deleted file mode 100644 index 78c72668..00000000 --- a/py_pubsub/py_pubsub/subscriber_member_function.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2016 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import rclpy -from rclpy.node import Node - -from std_msgs.msg import String - - -class MinimalSubscriber(Node): - - def __init__(self): - super().__init__('minimal_subscriber') - self.subscription = self.create_subscription( - String, - 'topic', - self.listener_callback, - 10) - self.subscription # prevent unused variable warning - - def listener_callback(self, msg): - self.get_logger().info('I heard: "%s"' % msg.data) - - -def main(args=None): - rclpy.init(args=args) - - minimal_subscriber = MinimalSubscriber() - - rclpy.spin(minimal_subscriber) - - # Destroy the node explicitly - # (optional - otherwise it will be done automatically - # when the garbage collector destroys the node object) - minimal_subscriber.destroy_node() - rclpy.shutdown() - - -if __name__ == '__main__': - main() diff --git a/py_pubsub/resource/py_pubsub b/py_pubsub/resource/py_pubsub deleted file mode 100644 index e69de29b..00000000 diff --git a/py_pubsub/setup.cfg b/py_pubsub/setup.cfg deleted file mode 100644 index 3f886b98..00000000 --- a/py_pubsub/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[develop] -script_dir=$base/lib/py_pubsub -[install] -install_scripts=$base/lib/py_pubsub diff --git a/py_pubsub/setup.py b/py_pubsub/setup.py deleted file mode 100644 index ebc173ef..00000000 --- a/py_pubsub/setup.py +++ /dev/null @@ -1,27 +0,0 @@ -from setuptools import setup - -package_name = 'py_pubsub' - -setup( - name=package_name, - version='0.0.0', - packages=[package_name], - data_files=[ - ('share/ament_index/resource_index/packages', - ['resource/' + package_name]), - ('share/' + package_name, ['package.xml']), - ], - install_requires=['setuptools'], - zip_safe=True, - maintainer='ubuntu', - maintainer_email='ubuntu@todo.todo', - description='Example of publisher/subscriber nodes in Python', - license='Apache License 2.0', - tests_require=['pytest'], - entry_points={ - 'console_scripts': [ - 'talker = py_pubsub.publisher_member_function:main', - 'listener = py_pubsub.subscriber_member_function:main', - ], - }, -) diff --git a/py_pubsub/test/test_copyright.py b/py_pubsub/test/test_copyright.py deleted file mode 100644 index 97a39196..00000000 --- a/py_pubsub/test/test_copyright.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2015 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from ament_copyright.main import main -import pytest - - -# Remove the `skip` decorator once the source file(s) have a copyright header -@pytest.mark.skip(reason='No copyright header has been placed in the generated source file.') -@pytest.mark.copyright -@pytest.mark.linter -def test_copyright(): - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found errors' diff --git a/py_pubsub/test/test_flake8.py b/py_pubsub/test/test_flake8.py deleted file mode 100644 index 27ee1078..00000000 --- a/py_pubsub/test/test_flake8.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2017 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from ament_flake8.main import main_with_errors -import pytest - - -@pytest.mark.flake8 -@pytest.mark.linter -def test_flake8(): - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ - '\n'.join(errors) diff --git a/py_pubsub/test/test_pep257.py b/py_pubsub/test/test_pep257.py deleted file mode 100644 index b234a384..00000000 --- a/py_pubsub/test/test_pep257.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2015 Open Source Robotics Foundation, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from ament_pep257.main import main -import pytest - - -@pytest.mark.linter -@pytest.mark.pep257 -def test_pep257(): - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings'