Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ 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
required-ros-distributions: lyrical
- uses: ros-tooling/action-ros-lint@v0.1
with:
distribution: rolling
distribution: lyrical
linter: ${{ matrix.linter }}
package-name: turtle_tf2_py
ament_lint_cpp:
name: ament_${{ matrix.linter }}
runs-on: ubuntu-latest
container:
image: ubuntu:jammy
image: ubuntu:resolute
strategy:
fail-fast: false
matrix:
Expand All @@ -35,9 +35,9 @@ jobs:
- uses: actions/checkout@v4
- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: rolling
required-ros-distributions: lyrical
- uses: ros-tooling/action-ros-lint@v0.1
with:
distribution: rolling
distribution: lyrical
linter: ${{ matrix.linter }}
package-name: turtle_tf2_cpp
16 changes: 8 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ on:
pull_request:
push:
branches:
- ros2
- lyrical

jobs:
build_and_test_source_rolling:
build_and_test_source_lyrical:
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
Expand All @@ -18,8 +18,8 @@ jobs:
package-name: |
turtle_tf2_py
turtle_tf2_cpp
target-ros2-distro: rolling
vcs-repo-file-url: https://raw.githubusercontent.com/ros2/ros2/rolling/ros2.repos
target-ros2-distro: lyrical
vcs-repo-file-url: https://raw.githubusercontent.com/ros2/ros2/lyrical/ros2.repos
colcon-defaults: |
{
"build": {
Expand All @@ -32,10 +32,10 @@ jobs:
"pytest-args": ["-m", "not xfail"]
}
}
build_and_test_binaries_rolling:
build_and_test_binaries_lyrical:
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
Expand All @@ -44,7 +44,7 @@ jobs:
package-name: |
turtle_tf2_py
turtle_tf2_cpp
target-ros2-distro: rolling
target-ros2-distro: lyrical
colcon-defaults: |
{
"build": {
Expand Down
1 change: 1 addition & 0 deletions turtle_tf2_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
3 changes: 2 additions & 1 deletion turtle_tf2_cpp/src/dynamic_frame_tf2_broadcaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

#include <chrono>
#include <cmath>
#include <functional>
#include <memory>

Expand All @@ -30,7 +31,7 @@ class DynamicFrameBroadcaster : public rclcpp::Node
DynamicFrameBroadcaster()
: Node("dynamic_frame_tf2_broadcaster")
{
tf_broadcaster_ = std::make_shared<tf2_ros::TransformBroadcaster>(this);
tf_broadcaster_ = std::make_shared<tf2_ros::TransformBroadcaster>(*this);
timer_ = this->create_wall_timer(
100ms, std::bind(&DynamicFrameBroadcaster::broadcast_timer_callback, this));
}
Expand Down
2 changes: 1 addition & 1 deletion turtle_tf2_cpp/src/fixed_frame_tf2_broadcaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FixedFrameBroadcaster : public rclcpp::Node
FixedFrameBroadcaster()
: Node("fixed_frame_tf2_broadcaster")
{
tf_broadcaster_ = std::make_shared<tf2_ros::TransformBroadcaster>(this);
tf_broadcaster_ = std::make_shared<tf2_ros::TransformBroadcaster>(*this);
timer_ = this->create_wall_timer(
100ms, std::bind(&FixedFrameBroadcaster::broadcast_timer_callback, this));
}
Expand Down
4 changes: 3 additions & 1 deletion turtle_tf2_cpp/src/static_turtle_tf2_broadcaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <cstdlib>
#include <cstring>
#include <memory>

#include "geometry_msgs/msg/transform_stamped.hpp"
Expand All @@ -25,7 +27,7 @@ class StaticFramePublisher : public rclcpp::Node
explicit StaticFramePublisher(char * transformation[])
: Node("static_turtle_tf2_broadcaster")
{
tf_static_broadcaster_ = std::make_shared<tf2_ros::StaticTransformBroadcaster>(this);
tf_static_broadcaster_ = std::make_shared<tf2_ros::StaticTransformBroadcaster>(*this);

// Publish static transforms once at startup
this->make_transforms(transformation);
Expand Down
3 changes: 3 additions & 0 deletions turtle_tf2_cpp/src/turtle_tf2_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.

#include <chrono>
#include <cmath>
#include <cstring>
#include <functional>
#include <memory>
#include <string>
Expand All @@ -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"
Expand Down
8 changes: 3 additions & 5 deletions turtle_tf2_cpp/src/turtle_tf2_message_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -45,17 +46,14 @@ class PoseDrawer : public rclcpp::Node
tf2_buffer_ = std::make_shared<tf2_ros::Buffer>(this->get_clock());
// Create the timer interface before call to waitForTransform,
// to avoid a tf2_ros::CreateTimerInterfaceException exception
auto timer_interface = std::make_shared<tf2_ros::CreateTimerROS>(
this->get_node_base_interface(),
this->get_node_timers_interface());
auto timer_interface = std::make_shared<tf2_ros::CreateTimerROS>(*this);
tf2_buffer_->setCreateTimerInterface(timer_interface);
tf2_listener_ =
std::make_shared<tf2_ros::TransformListener>(*tf2_buffer_);

point_sub_.subscribe(this, "/turtle3/turtle_point_stamped", rclcpp::QoS(10));
tf2_filter_ = std::make_shared<tf2_ros::MessageFilter<geometry_msgs::msg::PointStamped>>(
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);
}
Expand Down
6 changes: 5 additions & 1 deletion turtle_tf2_py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading