diff --git a/source/modulo_controllers/include/modulo_controllers/BaseControllerInterface.hpp b/source/modulo_controllers/include/modulo_controllers/BaseControllerInterface.hpp index b26c19aa..5c974a81 100644 --- a/source/modulo_controllers/include/modulo_controllers/BaseControllerInterface.hpp +++ b/source/modulo_controllers/include/modulo_controllers/BaseControllerInterface.hpp @@ -534,6 +534,7 @@ class BaseControllerInterface : public controller_interface::ControllerInterface * if the lookupTransform call failed * @return If it exists, the requested transform */ + [[nodiscard]] geometry_msgs::msg::TransformStamped lookup_ros_transform( const std::string& frame, const std::string& reference_frame, const tf2::TimePoint& time_point, const tf2::Duration& duration); diff --git a/source/modulo_controllers/src/BaseControllerInterface.cpp b/source/modulo_controllers/src/BaseControllerInterface.cpp index 562d3cfc..0540f995 100644 --- a/source/modulo_controllers/src/BaseControllerInterface.cpp +++ b/source/modulo_controllers/src/BaseControllerInterface.cpp @@ -544,9 +544,16 @@ void BaseControllerInterface::add_service( } void BaseControllerInterface::add_tf_listener() { +<<<<<<< HEAD if (!is_node_initialized()) { throw modulo_core::exceptions::CoreException("Failed to add TF buffer and listener: Node is not initialized yet."); } +======= + if (this->get_node() == nullptr) { + throw modulo_core::exceptions::CoreException("Failed to add TF buffer and listener: Node is not initialized yet."); + } + +>>>>>>> ed20342 (feat(controllers): add TF listener and lookup TF helpers in BaseControllerInterface (#169)) if (this->tf_buffer_ == nullptr || this->tf_listener_ == nullptr) { RCLCPP_DEBUG(this->get_node()->get_logger(), "Adding TF buffer and listener."); console_bridge::setLogLevel(console_bridge::CONSOLE_BRIDGE_LOG_NONE);