Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added point_cloud_transport_py #26

Merged
merged 2 commits into from Sep 6, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
File renamed without changes.
33 changes: 0 additions & 33 deletions CMakeLists.txt → point_cloud_transport/CMakeLists.txt
Expand Up @@ -13,17 +13,11 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()

find_package(ament_cmake_ros REQUIRED)
find_package(ament_cmake_python REQUIRED)

find_package(message_filters REQUIRED)
find_package(pluginlib REQUIRED)
find_package(pybind11 REQUIRED)
find_package(pybind11_vendor REQUIRED)
find_package(python_cmake_module REQUIRED)
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(rclpy REQUIRED)
find_package(sensor_msgs REQUIRED)

include_directories(
Expand Down Expand Up @@ -105,33 +99,6 @@ target_link_libraries(list_transports
${PROJECT_NAME}
pluginlib::pluginlib)


# Install Python modules
ament_python_install_package(${PROJECT_NAME})

# Python bindings
pybind11_add_module(_codec SHARED
src/pybind_codec.cpp
)
target_link_libraries(_codec PRIVATE
${PROJECT_NAME}
pluginlib::pluginlib
)

# Install cython modules as sub-modules of the project
install(
TARGETS
_codec
DESTINATION "${PYTHON_INSTALL_DIR}/${PROJECT_NAME}"
)

# Install Python executables
install(PROGRAMS
point_cloud_transport/publisher.py
point_cloud_transport/subscriber.py
DESTINATION lib/${PROJECT_NAME}
)

# Install plugin descriptions
pluginlib_export_plugin_description_file(${PROJECT_NAME} default_plugins.xml)

Expand Down
Empty file removed point_cloud_transport/__init__.py
Empty file.
File renamed without changes.
Expand Up @@ -151,12 +151,24 @@ class PointCloudTransport : public PointCloudTransportLoader
return ret;
}

//! Advertise a PointCloud2 topic, simple version.
POINT_CLOUD_TRANSPORT_PUBLIC
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary, considering the existing definition of advertise on line 167 below?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah is this to make the python binding easier?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's to simplify things

Publisher advertise(
const std::string & base_topic,
uint32_t queue_size)
{
rclcpp::PublisherOptions options = rclcpp::PublisherOptions();
rmw_qos_profile_t custom_qos = rmw_qos_profile_sensor_data;
custom_qos.depth = queue_size;
return Publisher(node_, base_topic, pub_loader_, custom_qos, options);
}

//! Advertise a PointCloud2 topic, simple version.
POINT_CLOUD_TRANSPORT_PUBLIC
Publisher advertise(
const std::string & base_topic,
uint32_t queue_size,
const rclcpp::PublisherOptions & options = rclcpp::PublisherOptions())
const rclcpp::PublisherOptions & options)
{
rmw_qos_profile_t custom_qos = rmw_qos_profile_sensor_data;
custom_qos.depth = queue_size;
Expand All @@ -172,6 +184,19 @@ class PointCloudTransport : public PointCloudTransportLoader
return Publisher(node_, base_topic, pub_loader_, custom_qos, options);
}

// //! Subscribe to a point cloud topic, version for arbitrary std::function object.
// POINT_CLOUD_TRANSPORT_PUBLIC
// point_cloud_transport::Subscriber subscribe(
// const std::string & base_topic,
// uint32_t queue_size,
// const std::function<void(const sensor_msgs::msg::PointCloud2::ConstSharedPtr &)> & callback)
// {
// rmw_qos_profile_t custom_qos = rmw_qos_profile_sensor_data;
// custom_qos.depth = queue_size;
// return subscribe(
// base_topic, custom_qos, callback, {}, nullptr);
// }

//! Advertise an PointCloud2 topic with subscriber status callbacks.
// TODO(ros2) Implement when SubscriberStatusCallback is available
// point_cloud_transport::Publisher advertise(const std::string& base_topic, uint32_t queue_size,
Expand Down
9 changes: 2 additions & 7 deletions package.xml → point_cloud_transport/package.xml
Expand Up @@ -14,21 +14,16 @@

<license>BSD</license>

<url type="repository">https://github.com/ctu-vras/point_cloud_transport</url>
<url type="bugtracker">https://github.com/ctu-vras/point_cloud_transport/issues</url>
<url type="repository">https://github.com/ros-perception/point_cloud_transport</url>
<url type="bugtracker">https://github.com/ros-perception/point_cloud_transport/issues</url>

<buildtool_depend>ament_cmake_ros</buildtool_depend>
<buildtool_depend>ament_cmake_python</buildtool_depend>

<depend>message_filters</depend>
<depend>pybind11</depend>
<depend>pybind11_vendor</depend>
<depend>pluginlib</depend>
<depend>rclcpp_components</depend>
<depend>rclcpp</depend>
<depend>rclpy</depend>
<depend>sensor_msgs</depend>
<depend>git</depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_copyright</test_depend>
Expand Down
116 changes: 0 additions & 116 deletions point_cloud_transport/publisher.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
105 changes: 0 additions & 105 deletions point_cloud_transport/subscriber.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.