-
Notifications
You must be signed in to change notification settings - Fork 84
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
Python API - How can I combine multiple message/segments/objects into one scan? #271
Comments
Thanks for your feedback. You can use the segment index of a pointcloud message (i.e. msg.segment_idx) to separate segment and fullframe pointclouds. A fullframe pointcloud has segment index -1 and contains all scan points of one 360 degree fullframe. Segment pointclouds have segment_idx >= 0, e.g. 0 to 11 for multiScan lidars. An example for a typical sequence of multiScan pointcloud messages looks like this:
The first line (segment -1) is displayed in the callback for a fullframe pointcloud, the other messages are from segment pointclouds (segment >= 0). This sequence repeats for each full scan. To make segment and fullframe pointclouds more transparent, we added the topic in pointcloud messages in a new branch https://github.com/SICKAG/sick_scan_xd/tree/feature/picoscan_single_echo. This is the ros topic, which is used to publish pointcloud messages under ROS. Using the default launchfile settings, the topic is "/cloud_unstructured_fullframe" for fullframe pointclouds and "/cloud_unstructured_segments" for segment pointclouds. Thus the sequence of pointcloud messages looks like:
Using the update in branch feature/picoscan_single_echo, you can either use segment_idx < 0 or the topic "/cloud_unstructured_fullframe" to identify the fullframe pointclouds with all scan points of a 360 degree fullframe combined in one message. Note that the new branch is a collective update incl. adaptations for the new picoScan 150 series w/o addons. It also corrects property timestamp_nsec. |
Dear rostest. -------------------- output of our program ----------------------------- |
Thanks for following up. It looks like the application does not receive all point cloud messages. Did you or your customer use one of the WaitNext...PointCloudMsg-functions to receive the point cloud messages? The WaitNext-functions of the API just return the next message received by sick_scan_xd. For multiScan and picoScan, this can be a scan segment (i.e. a part of the full point cloud) or a fullframe scan (i.e. all scan points of a 360 degree scan). Depending on the timing, the calling application may not receive all messages. We therefore recommend to register a message callback instead of polling with a WaitNext-function. By using a registered message callback, the application is notified with all fullframe and segment point cloud messages. If WaitNext-functions are used to receive point cloud messages from a multiScan, please exchange them with SickScanApiRegisterCartesianPointCloudMsg resp. SickScanApiRegisterPolarPointCloudMsg. See the usage example, #270 (comment) and #274 (comment) for further details and examples. If you are using SickScanApiRegisterCartesianPointCloudMsg or SickScanApiRegisterPolarPointCloudMsg, please run the python example sick_scan_xd_api_test.py as described in the complete usage example in python. Use branch https://github.com/SICKAG/sick_scan_xd/blob/feature/api_logging for the latest update based on the feature/picoscan_single_echo branch. Using this example, you should receive all point cloud messages incl. fullframe scans. Please post a complete logfile, if segment or fullframe point cloud messages are still missing. |
We have been utilizing the 'SickScanApiRegisterCartesianPointCloudMsg' in our implementation. However, upon comparing our code with the provided example (which functioned correctly), I realied we used performance consuming functions inbetween the messages, which caused the data loss. Thanks for your help! |
Hello,
We do not work with ROS, but use the sensor via the driver or the Python API.
During the first tests, we read the SickScanPointCloudMsg object and saved the x,y,z coordinates. What we have not yet understood or have not found in the documentation is that such a received object does not contain a complete scan in the data object (msg.data). This means that several message objects must be processed/combined into one scan. How can we make this happen? We suspect that there is some object meta info that we can use for this (e.g. frame_id from the message header?).
I have attributes in the header of each PointCloudMsg, but unfortunately, I can't do much with them. The attributes are:
Sequence ID (seq): is always 0
timestamp_sec: I get this timestamp, but
timestamp_nsec: is always 0, so I have several messages within a second, but I can't assign them to each other
frame_id: this string is also constant 'world'
In the PointCloudMsg there is still the segment ID, which changes. But I have the problem that several messages with the same segment ID arrive within a second and I cannot link them correctly (without the timestamp_nsec - see above).
How can I combine multiple message objects into one scan?
The text was updated successfully, but these errors were encountered: