diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index d07965b..866b8b1 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -7,16 +7,17 @@ jobs: name: ament_${{ matrix.linter }} runs-on: ubuntu-latest container: - image: ubuntu:jammy + image: ubuntu:resolute strategy: fail-fast: false matrix: linter: [copyright, flake8, pep257] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ros-tooling/setup-ros@v0.7 with: required-ros-distributions: rolling + use-ros2-testing: true - uses: ros-tooling/action-ros-lint@v0.1 with: distribution: rolling @@ -26,7 +27,7 @@ jobs: name: ament_${{ matrix.linter }} runs-on: ubuntu-latest container: - image: ubuntu:jammy + image: ubuntu:resolute strategy: fail-fast: false matrix: @@ -36,6 +37,7 @@ jobs: - uses: ros-tooling/setup-ros@v0.7 with: required-ros-distributions: rolling + use-ros2-testing: true - uses: ros-tooling/action-ros-lint@v0.1 with: distribution: rolling diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6ba8b15..98cf730 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,7 +9,7 @@ jobs: build_and_test_source_rolling: runs-on: ubuntu-latest container: - image: ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-noble-testing + image: ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-resolute-testing steps: - name: Build and run tests id: action-ros-ci @@ -35,7 +35,7 @@ jobs: build_and_test_binaries_rolling: runs-on: ubuntu-latest container: - image: ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-noble-testing + image: ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-resolute-testing steps: - name: Build and run tests id: action-ros-ci diff --git a/turtle_tf2_cpp/CMakeLists.txt b/turtle_tf2_cpp/CMakeLists.txt index 2058b4c..ba291ca 100644 --- a/turtle_tf2_cpp/CMakeLists.txt +++ b/turtle_tf2_cpp/CMakeLists.txt @@ -81,6 +81,7 @@ target_link_libraries(turtle_tf2_message_filter PRIVATE ${geometry_msgs_TARGETS} message_filters::message_filters rclcpp::rclcpp + tf2::tf2 ${tf2_geometry_msgs_TARGETS} tf2_ros::tf2_ros ) diff --git a/turtle_tf2_cpp/src/dynamic_frame_tf2_broadcaster.cpp b/turtle_tf2_cpp/src/dynamic_frame_tf2_broadcaster.cpp index bd056c4..baa6e21 100644 --- a/turtle_tf2_cpp/src/dynamic_frame_tf2_broadcaster.cpp +++ b/turtle_tf2_cpp/src/dynamic_frame_tf2_broadcaster.cpp @@ -13,6 +13,7 @@ // limitations under the License. #include +#include #include #include @@ -30,7 +31,7 @@ class DynamicFrameBroadcaster : public rclcpp::Node DynamicFrameBroadcaster() : Node("dynamic_frame_tf2_broadcaster") { - tf_broadcaster_ = std::make_shared(this); + tf_broadcaster_ = std::make_shared(*this); timer_ = this->create_wall_timer( 100ms, std::bind(&DynamicFrameBroadcaster::broadcast_timer_callback, this)); } diff --git a/turtle_tf2_cpp/src/fixed_frame_tf2_broadcaster.cpp b/turtle_tf2_cpp/src/fixed_frame_tf2_broadcaster.cpp index b68f1f3..4714999 100644 --- a/turtle_tf2_cpp/src/fixed_frame_tf2_broadcaster.cpp +++ b/turtle_tf2_cpp/src/fixed_frame_tf2_broadcaster.cpp @@ -28,7 +28,7 @@ class FixedFrameBroadcaster : public rclcpp::Node FixedFrameBroadcaster() : Node("fixed_frame_tf2_broadcaster") { - tf_broadcaster_ = std::make_shared(this); + tf_broadcaster_ = std::make_shared(*this); timer_ = this->create_wall_timer( 100ms, std::bind(&FixedFrameBroadcaster::broadcast_timer_callback, this)); } diff --git a/turtle_tf2_cpp/src/static_turtle_tf2_broadcaster.cpp b/turtle_tf2_cpp/src/static_turtle_tf2_broadcaster.cpp index bb659f2..09e82bc 100644 --- a/turtle_tf2_cpp/src/static_turtle_tf2_broadcaster.cpp +++ b/turtle_tf2_cpp/src/static_turtle_tf2_broadcaster.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include #include #include "geometry_msgs/msg/transform_stamped.hpp" @@ -25,7 +27,7 @@ class StaticFramePublisher : public rclcpp::Node explicit StaticFramePublisher(char * transformation[]) : Node("static_turtle_tf2_broadcaster") { - tf_static_broadcaster_ = std::make_shared(this); + tf_static_broadcaster_ = std::make_shared(*this); // Publish static transforms once at startup this->make_transforms(transformation); diff --git a/turtle_tf2_cpp/src/turtle_tf2_listener.cpp b/turtle_tf2_cpp/src/turtle_tf2_listener.cpp index 264b41b..b280fc1 100644 --- a/turtle_tf2_cpp/src/turtle_tf2_listener.cpp +++ b/turtle_tf2_cpp/src/turtle_tf2_listener.cpp @@ -13,6 +13,8 @@ // limitations under the License. #include +#include +#include #include #include #include @@ -21,6 +23,7 @@ #include "geometry_msgs/msg/twist.hpp" #include "rclcpp/rclcpp.hpp" #include "tf2/exceptions.hpp" +#include "tf2/time.hpp" #include "tf2_ros/transform_listener.hpp" #include "tf2_ros/buffer.hpp" #include "turtlesim_msgs/srv/spawn.hpp" diff --git a/turtle_tf2_cpp/src/turtle_tf2_message_filter.cpp b/turtle_tf2_cpp/src/turtle_tf2_message_filter.cpp index fab2926..ca74e44 100644 --- a/turtle_tf2_cpp/src/turtle_tf2_message_filter.cpp +++ b/turtle_tf2_cpp/src/turtle_tf2_message_filter.cpp @@ -19,6 +19,7 @@ #include "geometry_msgs/msg/point_stamped.hpp" #include "message_filters/subscriber.hpp" #include "rclcpp/rclcpp.hpp" +#include "tf2/exceptions.hpp" #include "tf2_ros/buffer.hpp" #include "tf2_ros/create_timer_ros.hpp" #include "tf2_ros/message_filter.hpp" @@ -45,17 +46,14 @@ class PoseDrawer : public rclcpp::Node tf2_buffer_ = std::make_shared(this->get_clock()); // Create the timer interface before call to waitForTransform, // to avoid a tf2_ros::CreateTimerInterfaceException exception - auto timer_interface = std::make_shared( - this->get_node_base_interface(), - this->get_node_timers_interface()); + auto timer_interface = std::make_shared(*this); tf2_buffer_->setCreateTimerInterface(timer_interface); tf2_listener_ = std::make_shared(*tf2_buffer_); point_sub_.subscribe(this, "/turtle3/turtle_point_stamped", rclcpp::QoS(10)); tf2_filter_ = std::make_shared>( - point_sub_, *tf2_buffer_, target_frame_, 100, this->get_node_logging_interface(), - this->get_node_clock_interface(), buffer_timeout); + point_sub_, *tf2_buffer_, target_frame_, 100, *this, buffer_timeout); // Register a callback with tf2_ros::MessageFilter to be called when transforms are available tf2_filter_->registerCallback(&PoseDrawer::msgCallback, this); } diff --git a/turtle_tf2_py/setup.py b/turtle_tf2_py/setup.py index 99f5657..03438ca 100644 --- a/turtle_tf2_py/setup.py +++ b/turtle_tf2_py/setup.py @@ -29,7 +29,11 @@ 'follow turtle1 around as you drive turtle1 using the keyboard.' ), license='Apache License, Version 2.0', - tests_require=['pytest'], + extras_require={ + 'test': [ + 'pytest', + ], + }, entry_points={ 'console_scripts': [ 'static_turtle_tf2_broadcaster = turtle_tf2_py.static_turtle_tf2_broadcaster:main',