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

Port point_cloud_transport_plugins to ROS2 #1

Merged
merged 13 commits into from
Aug 24, 2023
Merged

Port point_cloud_transport_plugins to ROS2 #1

merged 13 commits into from
Aug 24, 2023

Conversation

john-maidbot
Copy link
Collaborator

Sister PR to ros-perception/point_cloud_transport#1

See there for commentary and reports on progress.

@ahcorde
Copy link
Collaborator

ahcorde commented Jun 23, 2023

I'm getting some errors like this one:

/home/ahcorde/ros2_rolling/src/point_cloud_transport_plugins/draco_point_cloud_transport/src/draco_publisher.cpp: In member function ‘tl::expected<std::unique_ptr<draco::PointCloud>, std::__cxx11::basic_string<char> > draco_point_cloud_transport::DracoPublisher::convertPC2toDraco(const PointCloud2&, const string&, bool, bool) const’:
/home/ahcorde/ros2_rolling/src/point_cloud_transport_plugins/draco_point_cloud_transport/src/draco_publisher.cpp:155:43: error: could not convert ‘tl::make_unexpected<const char (&)[53]>("Invalid data type in PointCloud2 to Draco conversion")’ from ‘tl::unexpected<const char*>’ to ‘tl::expected<std::unique_ptr<draco::PointCloud>, std::__cxx11::basic_string<char> >’
  155 |       default:return cras::make_unexpected("Invalid data type in PointCloud2 to Draco conversion");
      |                      ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                           |
      |                                           tl::unexpected<const char*>

@john-maidbot
Copy link
Collaborator Author

Hrmmm, if you don’t mind me asking, what is your setup? (OS version / ROS version / g++ compiler version) This seems like it could be compiler related, as I do not see that error.
I.e. you compiler is interpreting that text as a const char* but mine sees it as a std::string (or ignoring that line for some reason).

We could maybe fix it by explicitly passing an std::string rather than something that is open to interpretation?
E.g.

cras::make_unexpected(std::string("Invalid data type in PointCloud2 to Draco conversion"));

Or we could refactor the behavior to return a nullptr rather than using the expected<> mechanism.

@peci1
Copy link

peci1 commented Jun 25, 2023

You can also try updating the https://raw.githubusercontent.com/TartanLlama/expected library. There were a few releases since I pulled it into cras_cpp_common.

We could maybe fix it by explicitly passing an std::string rather than something that is open to interpretation? E.g.

cras::make_unexpected(std::string("Invalid data type in PointCloud2 to Draco conversion"));

This would most probably fix it, but it is ugly.

It's weird a compiler for a ROS 2 system would not understand this. I tested this on C++14-only compilers and they work with the library.

@john-maidbot
Copy link
Collaborator Author

john-maidbot commented Jun 25, 2023

You can also try updating the https://raw.githubusercontent.com/TartanLlama/expected library.

I tried this, but the only diff is that they altered the version number. the code seems unaltered according to git.

This would most probably fix it, but it is ugly.

fair point 😅

i will wait to hear back about @ahcorde 's build setup before making any changes.

rn I am building with
Ubuntu 22.04
humble ros2
CMAKE_CXX_STANDARD 17
gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04.1)

and see no build errors/warnings.

@john-maidbot
Copy link
Collaborator Author

@ahcorde i assume you found a way around this issue?

ahcorde and others added 9 commits July 10, 2023 13:02
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
* Add compression format field

* Update
@ahcorde ahcorde marked this pull request as ready for review August 24, 2023 14:20
@ahcorde ahcorde merged commit 21ea68d into rolling Aug 24, 2023
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants