diff --git a/camera_calibration_parsers/CMakeLists.txt b/camera_calibration_parsers/CMakeLists.txt index 1cc2c3b4..71a7ed78 100644 --- a/camera_calibration_parsers/CMakeLists.txt +++ b/camera_calibration_parsers/CMakeLists.txt @@ -46,22 +46,6 @@ endif() ament_export_targets(export_${PROJECT_NAME}) -# TODO: Reenable Python Wrapper with new serialization technique. -#find_package(PythonLibs REQUIRED) -#if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3) -# find_package(Boost REQUIRED COMPONENTS python) -#else() -# find_package(Boost REQUIRED COMPONENTS python3) -#endif() -#add_library(${PROJECT_NAME}_wrapper -# src/parse_wrapper.cpp) -#target_link_libraries(${PROJECT_NAME}_wrapper -# rclcpp::rclcpp -# sensor_msgs::sensor_msgs -#) -#target_include_directories(${PROJECT_NAME}_wrapper PUBLIC ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}) -#target_link_libraries(${PROJECT_NAME}_wrapper ${PROJECT_NAME} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${YAML_CPP_LIBRARIES}) - # define the exe to convert add_executable(convert src/convert.cpp) target_link_libraries(convert PRIVATE diff --git a/camera_calibration_parsers/src/camera_calibration_parsers/__init__.py b/camera_calibration_parsers/src/camera_calibration_parsers/__init__.py deleted file mode 100644 index f6cbd7c7..00000000 --- a/camera_calibration_parsers/src/camera_calibration_parsers/__init__.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2016 -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -from camera_calibration_parsers.camera_calibration_parsers_wrapper import __readCalibrationWrapper -from sensor_msgs.msg import CameraInfo - - -def readCalibration(file_name): - """ - Read .ini or .yaml calibration file and return (camera name and cameraInfo message). - - @param file_name: camera calibration file name - @type file_name: str - @return: (camera name, cameraInfo message) or None on Error - @rtype: tuple(str, sensor_msgs.msg.CameraInfo | None - """ - ret, cn, ci = __readCalibrationWrapper(file_name) - if not ret: - return None - c = CameraInfo() - c.deserialize(ci) - return cn, c diff --git a/camera_calibration_parsers/src/parse_ini.cpp b/camera_calibration_parsers/src/parse_ini.cpp index e6f0e7a0..fc0350b9 100644 --- a/camera_calibration_parsers/src/parse_ini.cpp +++ b/camera_calibration_parsers/src/parse_ini.cpp @@ -31,7 +31,6 @@ #include "camera_calibration_parsers/parse_ini.hpp" -#include #include #include diff --git a/camera_calibration_parsers/src/parse_wrapper.cpp b/camera_calibration_parsers/src/parse_wrapper.cpp deleted file mode 100644 index adb7d446..00000000 --- a/camera_calibration_parsers/src/parse_wrapper.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2024 -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -#include "camera_calibration_parsers/parse_wrapper.hpp" - -#include - -#include "camera_calibration_parsers/parse.hpp" -#include "boost/python.hpp" -#include "ros/serialization.h" - -namespace camera_calibration_parsers -{ - -/* Write a ROS message into a serialized string. - * @from https://github.com/galou/python_bindings_tutorial/blob/master/src/add_two_ints_wrapper.cpp#L27 -*/ -template -std::string to_python(const M & msg) -{ - size_t serial_size = ros::serialization::serializationLength(msg); - boost::shared_array buffer(new uint8_t[serial_size]); - ros::serialization::OStream stream(buffer.get(), serial_size); - ros::serialization::serialize(stream, msg); - std::string str_msg; - str_msg.reserve(serial_size); - for (size_t i = 0; i < serial_size; ++i) { - str_msg.push_back(buffer[i]); - } - return str_msg; -} - -// Wrapper for readCalibration() -boost::python::tuple readCalibrationWrapper(const std::string & file_name) -{ - std::string camera_name; - sensor_msgs::CameraInfo camera_info; - bool result = readCalibration(file_name, camera_name, camera_info); - std::string cam_info = to_python(camera_info); - return boost::python::make_tuple(result, camera_name, cam_info); -} - -// cppcheck-suppress syntaxError -BOOST_PYTHON_MODULE(camera_calibration_parsers_wrapper) -{ - boost::python::def( - "__readCalibrationWrapper", readCalibrationWrapper, - boost::python::args("file_name"), ""); -} - -} // namespace camera_calibration_parsers diff --git a/camera_calibration_parsers/src/parse_yml.cpp b/camera_calibration_parsers/src/parse_yml.cpp index 36c3617c..f830294e 100644 --- a/camera_calibration_parsers/src/parse_yml.cpp +++ b/camera_calibration_parsers/src/parse_yml.cpp @@ -30,8 +30,6 @@ #include "camera_calibration_parsers/parse_yml.hpp" #include -#include -#include #include #include @@ -132,15 +130,6 @@ bool writeCalibrationYml( YAML::Emitter emitter; emitter << YAML::BeginMap; -#if 0 - // Calibration time - /// @todo Emitting the time breaks yaml-cpp on reading for some reason - time_t raw_time; - time(&raw_time); - emitter << YAML::Key << "calibration_time"; - emitter << YAML::Value << asctime_r(localtime_r(&raw_time)); -#endif - // Image dimensions emitter << YAML::Key << WIDTH_YML_NAME << YAML::Value << static_cast(cam_info.width); emitter << YAML::Key << HEIGHT_YML_NAME << YAML::Value << static_cast(cam_info.height); diff --git a/camera_info_manager/src/camera_info_manager.cpp b/camera_info_manager/src/camera_info_manager.cpp index e4bf638f..c34e1906 100644 --- a/camera_info_manager/src/camera_info_manager.cpp +++ b/camera_info_manager/src/camera_info_manager.cpp @@ -30,9 +30,7 @@ #include "camera_info_manager/camera_info_manager.hpp" #include -#include #include -#include #include #include diff --git a/camera_info_manager/src/split.hpp b/camera_info_manager/src/split.hpp deleted file mode 100644 index 80003123..00000000 --- a/camera_info_manager/src/split.hpp +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2018, Open Source Robotics Foundation, Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -#ifndef SPLIT_HPP_ -#define SPLIT_HPP_ - -#include -#include -#include - -namespace camera_info_manager -{ -namespace impl -{ - -inline std::vector -split(const std::string & input, const std::string & regex) -{ - std::regex re(regex); - // the -1 will cause this to return the stuff between the matches, see the submatch argument: - // http://en.cppreference.com/w/cpp/regex/regex_token_iterator/regex_token_iterator - std::sregex_token_iterator first(input.begin(), input.end(), re, -1); - std::sregex_token_iterator last; - return {first, last}; // vector will copy from first to last -} - -} // namespace impl -} // namespace camera_info_manager - -#endif // SPLIT_HPP_ diff --git a/camera_info_manager_py/camera_info_manager/camera_info_manager.py b/camera_info_manager_py/camera_info_manager/camera_info_manager.py index 1360e289..962fb330 100644 --- a/camera_info_manager_py/camera_info_manager/camera_info_manager.py +++ b/camera_info_manager_py/camera_info_manager/camera_info_manager.py @@ -221,7 +221,7 @@ def __str__(self): :returns: Return string representation of :class:CameraInfoManager. """ - return '[' + self.cname + ']' + str(self.utm) + return '[' + self.cname + ']' + str(self.url) def getCameraInfo(self): """ diff --git a/image_transport/include/image_transport/camera_publisher.hpp b/image_transport/include/image_transport/camera_publisher.hpp index 8eb9e04c..418fb4fc 100644 --- a/image_transport/include/image_transport/camera_publisher.hpp +++ b/image_transport/include/image_transport/camera_publisher.hpp @@ -45,8 +45,6 @@ namespace image_transport { -class ImageTransport; - /** * \brief Manages advertisements for publishing camera images. * diff --git a/image_transport/include/image_transport/camera_subscriber.hpp b/image_transport/include/image_transport/camera_subscriber.hpp index 4e4ed57c..230e19af 100644 --- a/image_transport/include/image_transport/camera_subscriber.hpp +++ b/image_transport/include/image_transport/camera_subscriber.hpp @@ -44,8 +44,6 @@ namespace image_transport { -class ImageTransport; - /** * \brief Manages a subscription callback on synchronized Image and CameraInfo topics. * diff --git a/image_transport/include/image_transport/simple_publisher_plugin.hpp b/image_transport/include/image_transport/simple_publisher_plugin.hpp index e65d94a1..d7cb4515 100644 --- a/image_transport/include/image_transport/simple_publisher_plugin.hpp +++ b/image_transport/include/image_transport/simple_publisher_plugin.hpp @@ -198,23 +198,6 @@ class SimplePublisherPlugin : public PublisherPlugin }; std::unique_ptr simple_impl_; - - typedef std::function ImagePublishFn; - - /** - * Returns a function object for publishing the transport-specific message type - * through some ROS publisher type. - * - * @param pub An object with method void publish(const M&) - */ - template - PublishFn bindInternalPublisher(PubT * pub) const - { - // Bind PubT::publish(const Message&) as PublishFn - typedef void (PubT::* InternalPublishMemFn)(const M &); - InternalPublishMemFn internal_pub_mem_fn = &PubT::publish; - return std::bind(internal_pub_mem_fn, pub, std::placeholders::_1); - } }; } // namespace image_transport diff --git a/image_transport/include/image_transport/simple_subscriber_plugin.hpp b/image_transport/include/image_transport/simple_subscriber_plugin.hpp index ad25dc57..b32c06cd 100644 --- a/image_transport/include/image_transport/simple_subscriber_plugin.hpp +++ b/image_transport/include/image_transport/simple_subscriber_plugin.hpp @@ -129,9 +129,6 @@ class SimpleSubscriberPlugin : public SubscriberPlugin rclcpp::SubscriptionOptions options) override { impl_ = std::make_unique(); - // Push each group of transport-specific parameters into a separate sub-namespace - // ros::NodeHandle param_nh(transport_hints.getParameterNH(), getTransportName()); - // auto parameters_interface = node_interfaces.get_node_parameters_interface(); auto topics_interface = node_interfaces.get_node_topics_interface(); impl_->sub_ = rclcpp::create_subscription( diff --git a/image_transport/src/subscriber.cpp b/image_transport/src/subscriber.cpp index b3462462..4966fdcf 100644 --- a/image_transport/src/subscriber.cpp +++ b/image_transport/src/subscriber.cpp @@ -78,7 +78,6 @@ struct Subscriber::Impl SubLoaderPtr loader_; std::shared_ptr subscriber_; bool unsubscribed_; - // double constructed_; }; Subscriber::Subscriber( diff --git a/image_transport_py/src/image_transport_py/pybind_image_transport.cpp b/image_transport_py/src/image_transport_py/pybind_image_transport.cpp index a9cdab47..b149020e 100644 --- a/image_transport_py/src/image_transport_py/pybind_image_transport.cpp +++ b/image_transport_py/src/image_transport_py/pybind_image_transport.cpp @@ -27,14 +27,9 @@ #include #include -using namespace std::chrono_literals; - namespace image_transport_python { -template -using SubscriberMap = std::unordered_map>; - // Bindings for the image_transport classes PYBIND11_MODULE(_image_transport, m) {