Code Monkey home page Code Monkey logo

Comments (3)

jdlangs avatar jdlangs commented on July 30, 2024 1

Yes, the fix is simple enough so I'll go ahead with a PR. It will probably be sometime next week.

from common_interfaces.

jdlangs avatar jdlangs commented on July 30, 2024

So I originally thought this was just a relatively harmless swapping of axes, but now I'm seeing it's creating issues with the point order in organized clouds. Specifically, I'm trying to read point clouds with the following structure:

PointCloud2:
  height:  1544
  width:  2064
  fields:
     sensor_msgs.msg.PointField(name='x', offset=0, datatype=7, count=1)
     sensor_msgs.msg.PointField(name='y', offset=4, datatype=7, count=1)
     sensor_msgs.msg.PointField(name='z', offset=8, datatype=7, count=1)
     sensor_msgs.msg.PointField(name='normal_x', offset=16, datatype=7, count=1)
     sensor_msgs.msg.PointField(name='normal_y', offset=20, datatype=7, count=1)
     sensor_msgs.msg.PointField(name='normal_z', offset=24, datatype=7, count=1)
     sensor_msgs.msg.PointField(name='curvature', offset=32, datatype=7, count=1)
  is_bigend:  False
  is_dense:  True
  point_step:  48
  row_step:  99072
  num_bytes:  152967168

When I call read_points, I get an array of shape (2064,1544) as expected. However, when I try to index the points in a 2D region, I find they are out of order. Switch the argument order in the call to reshape inside read_points fixes this and lets me access a contiguous region of the organized cloud.

from common_interfaces.

mjcarroll avatar mjcarroll commented on July 30, 2024

I agree that it seems transposed. Would you be able to open a PR with the fix and maybe a unit test so that we can prevent regression in the future?

from common_interfaces.

Related Issues (20)

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.