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

Error when using pypcd with Python 3.8 #9

Open
RaviBeagle opened this issue Jun 23, 2022 · 3 comments
Open

Error when using pypcd with Python 3.8 #9

RaviBeagle opened this issue Jun 23, 2022 · 3 comments

Comments

@RaviBeagle
Copy link

RaviBeagle commented Jun 23, 2022

Hi @DanielPollithy
I am using your python pypcd package as per your suggestion in the tutorial.

But I am getting this error:

[ERROR] [1655964681.574969]: bad callback: <bound method Subscriber.callback of <message_filters.Subscriber object at 0x7f16ddc51760>>
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/opt/ros/noetic/lib/python3/dist-packages/message_filters/__init__.py", line 76, in callback
    self.signalMessage(msg)
  File "/opt/ros/noetic/lib/python3/dist-packages/message_filters/__init__.py", line 58, in signalMessage
    cb(*(msg + args))
  File "/opt/ros/noetic/lib/python3/dist-packages/message_filters/__init__.py", line 330, in add
    self.signalMessage(*msgs)
  File "/opt/ros/noetic/lib/python3/dist-packages/message_filters/__init__.py", line 58, in signalMessage
    cb(*(msg + args))
  File "/home/sxv1kor/rospy_tutorial_ws/src/message_synchrozier/src/rosBagMessageSynchronizer.py", line 57, in callback
    pc = pypcd.PointCloud.from_msg(pointcloud)
  File "/home/sxv1kor/.local/lib/python3.8/site-packages/pypcd/pypcd.py", line 807, in from_msg
    raise NotImplementedError('ROS sensor_msgs not found')
NotImplementedError: ROS sensor_msgs not found

This should not happen as the numpy_pc2 is alredy there:

 ll
total 84
drwxrwxr-x  3 sxv1kor sxv1kor  4096 Jun 23 10:47 ./
drwx------ 74 sxv1kor sxv1kor  4096 Jun 23 10:47 ../
-rw-rw-r--  1 sxv1kor sxv1kor    43 Jun 23 10:47 __init__.py
-rw-rw-r--  1 sxv1kor sxv1kor 10113 Jun 23 10:47 nea_pc_format.py
-rw-rw-r--  1 sxv1kor sxv1kor 13802 Jun 23 10:47 numpy_pc2.py
-rw-rw-r--  1 sxv1kor sxv1kor  1133 Jun 23 10:47 pdutil.py
drwxrwxr-x  2 sxv1kor sxv1kor  4096 Jun 23 10:47 __pycache__/
-rw-rw-r--  1 sxv1kor sxv1kor 28920 Jun 23 10:47 pypcd.py
-rw-rw-r--  1 sxv1kor sxv1kor  2506 Jun 23 10:47 sautil.py
@DanielPollithy
Copy link
Owner

Hi there!

Can you import the following requirements without error?

import numpy.lib.recfunctions as recfuncs
from sensor_msgs.msg import PointField
from sensor_msgs.msg import PointCloud2

@AbhiKhoyani
Copy link

AbhiKhoyani commented Feb 4, 2023

@DanielPollithy Hi I'm also facing the same problem and can also import above dependencies.

However, my traceback is different than above issue.!!

`

NotImplementedError Traceback (most recent call last)
Cell In[5], line 1
----> 1 pc = pypcd.PointCloud.from_msg(velodyne_data)

File ~/venv/lib/python3.8/site-packages/pypcd-0.1.3-py3.8.egg/pypcd/pypcd.py:807, in PointCloud.from_msg(msg, squeeze)
803 """ from pointcloud2 msg
804 squeeze: fix when clouds get 1 as first dim
805 """
806 if not HAS_SENSOR_MSGS:
--> 807 raise NotImplementedError('ROS sensor_msgs not found')
808 md = {'version': .7,
809 'fields': [],
810 'size': [],
(...)
816 'type': [],
817 'data': 'binary_compressed'}
818 for field in msg.fields:

NotImplementedError: ROS sensor_msgs not found
`

@Merwanski
Copy link

Hey @RaviBeagle
Try the following script to extract the point cloud data
https://gist.github.com/Merwanski/bef218ff3b7472d5ac787e1392116fd7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants