forked from ctu-vras/point_cloud_transport_plugins
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
520 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<package format="3"> | ||
<name>point_cloud_transport_plugins</name> | ||
<version>1.0.5</version> | ||
<version>0.0.0</version> | ||
<description>Metapackage with common point_cloud_transport plugins</description> | ||
<author>Jakub Paplham</author> | ||
<maintainer email="[email protected]">Martin Pecka</maintainer> | ||
|
@@ -15,6 +15,7 @@ | |
<exec_depend>draco_point_cloud_transport</exec_depend> | ||
<exec_depend>point_cloud_interfaces</exec_depend> | ||
<exec_depend>zlib_point_cloud_transport</exec_depend> | ||
<exec_depend>zstd_point_cloud_transport</exec_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
cmake_minimum_required(VERSION 3.10.2) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
project(zstd_point_cloud_transport) | ||
|
||
find_package(ament_cmake REQUIRED) | ||
find_package(pluginlib REQUIRED) | ||
find_package(point_cloud_interfaces REQUIRED) | ||
find_package(point_cloud_transport REQUIRED) | ||
find_package(rclcpp REQUIRED) | ||
|
||
set(dependencies | ||
pluginlib | ||
point_cloud_interfaces | ||
point_cloud_transport | ||
rclcpp | ||
) | ||
|
||
include_directories(include) | ||
|
||
add_library(${PROJECT_NAME} | ||
SHARED | ||
src/zstd_publisher.cpp | ||
src/zstd_subscriber.cpp | ||
src/manifest.cpp | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} zstd) | ||
|
||
ament_target_dependencies(${PROJECT_NAME} ${dependencies}) | ||
|
||
install(TARGETS ${PROJECT_NAME} | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
RUNTIME DESTINATION lib/${PROJECT_NAME} | ||
) | ||
|
||
install( | ||
DIRECTORY include/${PROJECT_NAME}/ | ||
DESTINATION include/${PROJECT_NAME} | ||
) | ||
|
||
pluginlib_export_plugin_description_file(point_cloud_transport zstd_plugins.xml) | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
ament_lint_auto_find_test_dependencies() | ||
endif() | ||
|
||
ament_export_include_directories(include) | ||
ament_export_libraries(${PROJECT_NAME}) | ||
ament_export_dependencies(${dependencies}) | ||
ament_package() |
67 changes: 67 additions & 0 deletions
67
zstd_point_cloud_transport/include/zstd_point_cloud_transport/zstd_publisher.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright (c) 2023, 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 ZSTD_POINT_CLOUD_TRANSPORT__ZSTD_PUBLISHER_HPP_ | ||
#define ZSTD_POINT_CLOUD_TRANSPORT__ZSTD_PUBLISHER_HPP_ | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
#include <sensor_msgs/msg/point_cloud2.hpp> | ||
|
||
#include <point_cloud_transport/point_cloud_transport.hpp> | ||
|
||
#include <point_cloud_transport/simple_publisher_plugin.hpp> | ||
#include <point_cloud_interfaces/msg/compressed_point_cloud2.hpp> | ||
|
||
|
||
namespace zstd_point_cloud_transport | ||
{ | ||
|
||
class ZstdPublisher | ||
: public point_cloud_transport::SimplePublisherPlugin< | ||
point_cloud_interfaces::msg::CompressedPointCloud2> | ||
{ | ||
public: | ||
std::string getTransportName() const override; | ||
|
||
void declareParameters(const std::string & base_topic) override; | ||
|
||
std::string getDataType() const override; | ||
|
||
TypedEncodeResult encodeTyped(const sensor_msgs::msg::PointCloud2 & raw) const override; | ||
|
||
private: | ||
int encode_level_{7}; | ||
}; | ||
} // namespace zstd_point_cloud_transport | ||
|
||
#endif // ZSTD_POINT_CLOUD_TRANSPORT__ZSTD_PUBLISHER_HPP_ |
61 changes: 61 additions & 0 deletions
61
zstd_point_cloud_transport/include/zstd_point_cloud_transport/zstd_subscriber.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright (c) 2023, 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 ZSTD_POINT_CLOUD_TRANSPORT__ZSTD_SUBSCRIBER_HPP_ | ||
#define ZSTD_POINT_CLOUD_TRANSPORT__ZSTD_SUBSCRIBER_HPP_ | ||
|
||
#include <string> | ||
|
||
#include <point_cloud_interfaces/msg/compressed_point_cloud2.hpp> | ||
|
||
#include <point_cloud_transport/simple_subscriber_plugin.hpp> | ||
#include <point_cloud_transport/transport_hints.hpp> | ||
|
||
namespace zstd_point_cloud_transport | ||
{ | ||
|
||
class ZstdSubscriber | ||
: public point_cloud_transport::SimpleSubscriberPlugin< | ||
point_cloud_interfaces::msg::CompressedPointCloud2> | ||
{ | ||
public: | ||
std::string getTransportName() const override; | ||
|
||
void declareParameters() override; | ||
|
||
std::string getDataType() const override; | ||
|
||
DecodeResult decodeTyped(const point_cloud_interfaces::msg::CompressedPointCloud2 & compressed) | ||
const override; | ||
}; | ||
} // namespace zstd_point_cloud_transport | ||
|
||
#endif // ZSTD_POINT_CLOUD_TRANSPORT__ZSTD_SUBSCRIBER_HPP_ |
Oops, something went wrong.