Skip to content

Commit 796fdaf

Browse files
author
Alexander Tiderko
committed
fixed build for rolling
1 parent 3fdac8a commit 796fdaf

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

fkie_iop_client_costmap2d/include/urn_jaus_jss_iop_CostMap2DClient/CostMap2DClient_ReceiveFSM.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ along with this program; or you can read the full license at
4141

4242
#include "CostMap2DClient_ReceiveFSM_sm.h"
4343
#include <rclcpp/rclcpp.hpp>
44+
#include <rclcpp/node_interfaces/node_base_interface.hpp>
45+
#include <rclcpp/node_interfaces/node_topics_interface.hpp>
4446
#include <fkie_iop_component/iop_component.hpp>
4547
#include <fkie_iop_ocu_slavelib/SlaveHandlerInterface.h>
4648
#include <fkie_iop_events/EventHandlerInterface.h>
4749
#include <nav_msgs/msg/occupancy_grid.hpp>
48-
#include <tf2_ros/transform_broadcaster.h>
50+
#include <tf2_ros/transform_broadcaster.hpp>
4951
#include <geometry_msgs/msg/transform_stamped.hpp>
5052

5153

@@ -96,7 +98,7 @@ class DllExport CostMap2DClient_ReceiveFSM : public JTS::StateMachine, public io
9698
bool p_send_inverse_trafo;
9799
double p_hz;
98100

99-
tf2_ros::TransformBroadcaster p_tf_broadcaster;
101+
std::unique_ptr<tf2_ros::TransformBroadcaster> p_tf_broadcaster;
100102
rclcpp::Publisher<nav_msgs::msg::OccupancyGrid>::SharedPtr p_pub_costmap;
101103

102104
urn_jaus_jss_iop_CostMap2DClient::QueryCostMap2D p_query_costmap2d_msg;

fkie_iop_client_costmap2d/src/urn_jaus_jss_iop_CostMap2DClient/CostMap2DClient_ReceiveFSM.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ along with this program; or you can read the full license at
2323

2424
#include "urn_jaus_jss_iop_CostMap2DClient/CostMap2DClient_ReceiveFSM.h"
2525
#include <fkie_iop_component/iop_config.hpp>
26-
#include <tf2/LinearMath/Quaternion.h>
27-
#include <tf2/LinearMath/Transform.h>
26+
#include <tf2/LinearMath/Quaternion.hpp>
27+
#include <tf2/LinearMath/Transform.hpp>
2828

2929
#include <fkie_iop_builder/util.h>
3030

@@ -39,8 +39,7 @@ namespace urn_jaus_jss_iop_CostMap2DClient
3939

4040
CostMap2DClient_ReceiveFSM::CostMap2DClient_ReceiveFSM(std::shared_ptr<iop::Component> cmp, urn_jaus_jss_core_AccessControlClient::AccessControlClient_ReceiveFSM* pAccessControlClient_ReceiveFSM, urn_jaus_jss_core_EventsClient::EventsClient_ReceiveFSM* pEventsClient_ReceiveFSM, urn_jaus_jss_core_Transport::Transport_ReceiveFSM* pTransport_ReceiveFSM)
4141
: SlaveHandlerInterface(cmp, "CostMap2DClient", 10.0),
42-
logger(cmp->get_logger().get_child("CostMap2DClient")),
43-
p_tf_broadcaster(cmp)
42+
logger(cmp->get_logger().get_child("CostMap2DClient"))
4443
{
4544

4645
/*
@@ -50,6 +49,10 @@ CostMap2DClient_ReceiveFSM::CostMap2DClient_ReceiveFSM(std::shared_ptr<iop::Comp
5049
*/
5150
context = new CostMap2DClient_ReceiveFSMContext(*this);
5251

52+
this->p_tf_broadcaster = std::make_unique<tf2_ros::TransformBroadcaster>(
53+
cmp->get_node_parameters_interface(),
54+
cmp->get_node_topics_interface()
55+
);
5356
this->pAccessControlClient_ReceiveFSM = pAccessControlClient_ReceiveFSM;
5457
this->pEventsClient_ReceiveFSM = pEventsClient_ReceiveFSM;
5558
this->pTransport_ReceiveFSM = pTransport_ReceiveFSM;
@@ -191,7 +194,7 @@ void CostMap2DClient_ReceiveFSM::handleReportCostMap2DAction(ReportCostMap2D msg
191194
tf_msg.child_frame_id = this->p_tf_frame_costmap;
192195
}
193196
if (! tf_msg.child_frame_id.empty() && !tf_msg.header.frame_id.empty()) {
194-
p_tf_broadcaster.sendTransform(tf_msg);
197+
p_tf_broadcaster->sendTransform(tf_msg);
195198
RCLCPP_DEBUG(logger, " tf %s -> %s (%.2f, %.2f), stamp: %d.%d", tf_msg.header.frame_id.c_str(), tf_msg.child_frame_id.c_str(), tf_msg.transform.translation.x, tf_msg.transform.translation.y, tf_msg.header.stamp.sec, tf_msg.header.stamp.nanosec);
196199
}
197200

fkie_iop_client_path_reporter/src/urn_jaus_jss_iop_PathReporterClient/PathReporterClient_ReceiveFSM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ along with this program; or you can read the full license at
2727
#include <fkie_iop_component/iop_config.hpp>
2828
#include <fkie_iop_component/gps_conversions.h>
2929

30-
#include <tf2/LinearMath/Quaternion.h>
31-
#include <tf2/LinearMath/Matrix3x3.h>
30+
#include <tf2/LinearMath/Quaternion.hpp>
31+
#include <tf2/LinearMath/Matrix3x3.hpp>
3232

3333

3434
using namespace JTS;

0 commit comments

Comments
 (0)