GithubHelp home page GithubHelp logo

ros-perception / perception_open3d Goto Github PK

View Code? Open in Web Editor NEW
157.0 157.0 29.0 2.2 MB

Open3D analog to perception_pcl, containing conversion functions from Open3D to/from ROS types

License: Apache License 2.0

CMake 6.70% C++ 93.30%

perception_open3d's People

Contributors

matnay avatar nkhedekar avatar stevemacenski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

perception_open3d's Issues

Undefined refrence to ros::

When building the examples via catkin build. open3d_conversions builds fine. Running on ros-melodic "official" docker container

EDIT: same happens when running catkin_make

image
image

rosToOpen3d for tensor pointclouds does not handle custom fields correctly

There are a few problems with this function in terms of custom fields:

  • the output field type in the open3d structure is float32, regardless of the ros field type
  • custom fields are entered as triplets into the open3d structure, where the triplet contains 3 copies of the same data entry
  • only uint8/int8/float32 ros field types are handled in the iterator

This is a code snippet from the rosToOpen3d function:

        sensor_msgs::PointCloud2ConstIterator<float> ros_pc2_fx(*ros_pc2, ros_pc2->fields[num_fields].name);
        sensor_msgs::PointCloud2ConstIterator<float> ros_pc2_fy(*ros_pc2, ros_pc2->fields[num_fields].name);
        sensor_msgs::PointCloud2ConstIterator<float> ros_pc2_fz(*ros_pc2, ros_pc2->fields[num_fields].name);
        std::vector<Eigen::Vector3d> o3d_TensorList_fields;

        for (size_t i = 0; i < ros_pc2->height * ros_pc2->width; ++i, ++ros_pc2_fx, ++ros_pc2_fy, ++ros_pc2_fz)
        {
          o3d_TensorList_fields.push_back(Eigen::Vector3d(*ros_pc2_fx, *ros_pc2_fy, *ros_pc2_fz));
        }
        open3d::core::Tensor o3d_tpc_fields =
          open3d::core::eigen_converter::EigenVector3dVectorToTensor(o3d_TensorList_fields, dtype_f, device_type);
        o3d_tpc.SetPointAttr(ros_pc2->fields[num_fields].name, o3d_tpc_fields);

Non-Variadic Function for open3d::t::geometry::PointCloud to sensor_msgs::PointCloud2

Currently the available method is variadic, whereby the user passes arguments like "xyz", "float" and , which (as far as i'm aware) requires knowledge of the fields at compile-time. By replacing the variadic structure with a std::vector<std::pair<std::string,std::string>> or similar, the fields could be determined at run-time. Alternatively, 2 functions could be provided for the open3dToRos function for converting tensor types, since the variadic one is convenient if you know the fields.

The example application where I have run into this issue is very simple:

  1. Receive a pointcloud in ROS with fields I don't know about in advance (e.g. intensity, ring, ambience, x, y, z, r, g, b), which is common if dealing with lidars from different sensor drivers
  2. Perform some operation on this pointcloud, e.g. filter out all points beyond a certain range, with the assumption that there are x, y, z points
  3. Publish the resultant pointcloud with all the fields (this is not possible with open3d::geometry::PointCloud but is with the tensor versoin)

Python bindings

A pure python solution takes above 100ms to convert pointclouds ROS<->Open3d. It would be good to have python bindings using pybind11 for this to be faster.

No support for multiple types of fields per point cloud point

Thank you very much for writing this package and sharing it with the community.

I wanted to point out that the current implementation makes very strong assumptions on the fields of the input point clouds in format sensor_msgs/PointCloud2. While the ROS msgs is quite flexible and compatible with any type of point cloud data, the conversion and Open3D itself are not:

https://github.com/ros-perception/perception_open3d/blob/main/open3d_conversions/src/open3d_conversions.cpp#L81

This means that for example, you automatically discard curvature, reflectivity, ambient noise, and anything that goes beyond RGB or normals.

Would it be possible to implement both in this package and in the Open3D side a more flexible type? Libpointmatcher is a really good example, which is also light in memory (everything is represented as Eigen matrices), and intrinsically handles aspects like memory alignment.

Thank you in advance.

Release to ROS2 Rolling / Galactic

Hi,

The deadline for projects to get into the first cut of Galactic is today! You don't have to do it right now, but it would be good to get this released in the next week or two so that it gets in by the first sync.

For rolling, you should create a new ros2 branch that all ROS2 PRs are against (the "master" for ros2) and then cut distributions off of it. That way if you update rolling, it'll get pulled into the next distribution automatically (assuming no new changes were made requiring a new release)

Open3D API Change

I am not really sure when the API change happened but lined 159-161 and 252 need to change to accommodate new Open3D API.

Update:

v0.13.0 tag offers GetPoints()
v0.14.1 tag offers GetPointPositions() convenience function for GetPointAttr("positions")

I haven't tested if this change brakes the behavior and results but it compiles successfully.

# 159-161
const open3d::core::Tensor& o3d_TensorList_points = pointcloud.GetPointAttr("positions");
modifier.resize(pointcloud.GetPointAttr("positions").GetShape()[0]);
ros_pc2.data.reserve(pointcloud.GetPointAttr("positions").GetShape()[0]);
----
# 252
o3d_tpc.SetPointAttr("positions",o3d_tpc_points);

Check isl-org/Open3D#4093 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.