pcl_conversions: Fix compile errors caused by rosidl_buffer introduction#529
Open
wentasah wants to merge 1 commit intoros-perception:ros2from
Open
pcl_conversions: Fix compile errors caused by rosidl_buffer introduction#529wentasah wants to merge 1 commit intoros-perception:ros2from
wentasah wants to merge 1 commit intoros-perception:ros2from
Conversation
Compiling pcl_ros package in rolling results in errors like this:
In file included from
/build/perception_pcl-release-release-rolling-pcl_ros-2.8.0-1/tools/combined_pointcloud_to_pcd.cpp:47:
/ros-rolling-pcl-conversions-2.8.0-r1/include/pcl_conversions/pcl_conversions/pcl_conversions.h: In
function 'void pcl_conversions::moveFromPCL(pcl::PCLImage&, sensor_msgs::msg::Image&)':
/ros-rolling-pcl-conversions-2.8.0-r1/include/pcl_conversions/pcl_conversions/pcl_conversions.h:172:16:
error: 'using sensor_msgs::msg::Image_<std::allocator<void> >::_data_type = class
rosidl::Buffer<unsigned char, std::allocator<unsigned char> >' {aka 'class rosidl::Buffer<unsigned
char, std::allocator<unsigned char> >'} has no member named 'swap'
172 | image.data.swap(pcl_image.data);
| ^~~~
These are caused by ros2/rosidl#941 and
followup PRs, which change the type of `uint8[]` message fields from
`std::vector<uint8_t>` to `rosidl::Buffer<uint8_t>`. To maintain the
previous functionality, explicit typecasting is needed at a few
places. This causes invocation of the conversion operator [1], which
returns a reference to the underlying std::vector.
[1]: https://github.com/ros2/rosidl/blob/7c4e0f90f2979c16c906d65058fc7966360f52e1/rosidl_buffer/include/rosidl_buffer/buffer.hpp#L420
Signed-off-by: Michal Sojka <michal.sojka@cvut.cz>
Contributor
|
Thank you for the PR! @nvcyc mind taking a look? |
|
I think our |
Author
|
@nvcyc Yes, ros2/rosidl#959 allows compiling original |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Compiling
pcl_rospackage in rolling results in errors like this:These are caused by ros2/rosidl#941 and followup PRs, which change the type of
uint8[]message fields fromstd::vector<uint8_t>torosidl::Buffer<uint8_t>. To maintain the previous functionality, explicit typecasting is needed at a few places. This causes invocation of the conversion operator, which returns a reference to the underlying std::vector.