ros2 / rmw_iceoryx

rmw implementation for iceoryx
Apache License 2.0
158 stars 27 forks source link

failure to build for ros2 #81

Closed xlla closed 1 year ago

xlla commented 2 years ago

I was encounter many errors while use ros2 colcon build.

iceoryx_hoofs , iceoryx_posh and iceoryx_binding_c was built by colcon.

branch: galactic os: mac osx 10.13.6

error 1

/Users/xlla/ros2_foxy/src/ros2/rmw_iceoryx/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_name_conversion.hpp:23:10: fatal error: 'iceoryx_utils/cxx/string.hpp' file not found
#include "iceoryx_utils/cxx/string.hpp"

change to iceoryx_hoofs/cxx/string.hpp to fix it.

error 2

[ 17%] Linking CXX shared library librmw_iceoryx_serialization.dylib
Undefined symbols for architecture x86_64:
  "rmw_iceoryx_cpp::get_type_support(rosidl_message_type_support_t const*)", referenced from:
      rmw_iceoryx_cpp::deserialize(char const*, rosidl_message_type_support_t const*, void*) in iceoryx_deserialize.cpp.o
      rmw_iceoryx_cpp::serialize(void const*, rosidl_message_type_support_t const*, std::__1::vector >&) in iceoryx_serialize.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [CMakeFiles/rmw_iceoryx_serialization.dir/build.make:117: librmw_iceoryx_serialization.dylib] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:141: CMakeFiles/rmw_iceoryx_serialization.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

manual add iceoryx_type_info_introspection.cpp.o to link.txt fix it.

error 3

/Users/xlla/ros2_foxy/src/ros2/rmw_iceoryx/rmw_iceoryx_cpp/src/internal/iceoryx_generate_gid.cpp:28:21: error: use of undeclared identifier 'typed_uid'; did you mean 'typeid'?
  iox::UniquePortId typed_uid = publisher->getUid();
                    ^~~~~~~~~
                    typeid
/Users/xlla/ros2_foxy/src/ros2/rmw_iceoryx/rmw_iceoryx_cpp/src/internal/iceoryx_generate_gid.cpp:28:20: error: expected ';' after expression
  iox::UniquePortId typed_uid = publisher->getUid();
                   ^
                   ;
/Users/xlla/ros2_foxy/src/ros2/rmw_iceoryx/rmw_iceoryx_cpp/src/internal/iceoryx_generate_gid.cpp:28:8: error: no member named 'UniquePortId' in namespace 'iox'
  iox::UniquePortId typed_uid = publisher->getUid();
  ~~~~~^
/Users/xlla/ros2_foxy/src/ros2/rmw_iceoryx/rmw_iceoryx_cpp/src/internal/iceoryx_generate_gid.cpp:28:30: error: expected '(' after 'typeid'
  iox::UniquePortId typed_uid = publisher->getUid();

change to iox::popo::UniquePortId fix it.

error 4

/Users/xlla/ros2_foxy/src/ros2/rmw_iceoryx/rmw_iceoryx_cpp/src/rmw_publisher.cpp:134:26: error: destructor type 'iox::popo::UntypedPublisherImpl >' in object destruction expression does not match the type 'iox::popo::UntypedPublisher' of the object being destroyed
        iceoryx_sender->~UntypedPublisherImpl(), iox::popo::UntypedPublisher)
                         ^
/Users/xlla/ros2_foxy/install/iceoryx_posh/include/iceoryx/v2.90.0/iceoryx_posh/internal/popo/untyped_publisher_impl.hpp:31:7: note: type 'iox::popo::UntypedPublisherImpl >' is declared here
class UntypedPublisherImpl : public BasePublisherType
      ^
/Users/xlla/ros2_foxy/src/ros2/rmw_iceoryx/rmw_iceoryx_cpp/src/rmw_publisher.cpp:201:46: error: destructor type 'iox::popo::UntypedPublisherImpl >' in object destruction expression does not match the type 'iox::popo::UntypedPublisher' of the object being destroyed
        iceoryx_publisher->iceoryx_sender_->~UntypedPublisherImpl(),
                                             ^

I am not know how to fix it.

xlla commented 2 years ago

I have fixed error 4 and succession error 5

/Users/xlla/ros2_foxy/src/ros2/rmw_iceoryx/rmw_iceoryx_cpp/src/rmw_subscription.cpp:133:28: error: destructor type 'iox::popo::UntypedSubscriberImpl >' in object destruction expression does not match the type 'iox::popo::UntypedSubscriber' of the object being destroyed
        iceoryx_receiver->~UntypedSubscriberImpl(), iox::popo::UntypedSubscriber)
                           ^
/Users/xlla/ros2_foxy/install/iceoryx_posh/include/iceoryx/v2.90.0/iceoryx_posh/internal/popo/untyped_subscriber_impl.hpp:38:7: note: type 'iox::popo::UntypedSubscriberImpl >' is declared here
class UntypedSubscriberImpl : public BaseSubscriberType

here is the fix

mossmaurice commented 2 years ago

Hi @xlla

Thanks for opening this issue and for providing the fixes!

The fixes you provided are already incorporated on the master branch which works with ROS 2 Rolling. The galactic branch was not updated to iceoryx Blueberry (v2.x) as ROS 2 Galactic uses iceoryx Almond (v1.x).

A working solution would be to update to ROS 2 Humble and use it together with rwm_iceoryx's master branch. Please make sure to check out the correct branch:

git clone --branch master https://github.com/ros2/rmw_iceoryx.git

Alternatively, if you want to use ROS 2 Galactic:

git clone --branch galactic https://github.com/ros2/rmw_iceoryx.git

New features and a release for Humble like request/response aka ROS 2 services are on their way (#76).

For me to better understand your needs, are you interested in using the latest iceoryx with ROS 2 Galactic?

xlla commented 2 years ago

hi @mossmaurice , I am glad to know these errors was fixed in master branch.

I want to experiment those edge techs, so I am not stick to ROS 2 Galactic.

after upgrade to ROS 2 Humble and switch to rmw_iceoryx's master branch, the error 2, 4 & 5 are still remained.

gmake: *** [Makefile:146: all] Error 2
--- stderr: rmw_iceoryx_cpp                             
Undefined symbols for architecture x86_64:
  "rmw_iceoryx_cpp::get_type_support(rosidl_message_type_support_t const*)", referenced from:
      rmw_iceoryx_cpp::deserialize(char const*, rosidl_message_type_support_t const*, void*) in iceoryx_deserialize.cpp.o
      rmw_iceoryx_cpp::serialize(void const*, rosidl_message_type_support_t const*, std::__1::vector >&) in iceoryx_serialize.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [CMakeFiles/rmw_iceoryx_serialization.dir/build.make:117: librmw_iceoryx_serialization.dylib] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:141: CMakeFiles/rmw_iceoryx_serialization.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< rmw_iceoryx_cpp [5.28s, exited with code 2]

[ 83%] Building CXX object CMakeFiles/rmw_iceoryx_cpp.dir/src/rmw_service_server_is_available.cpp.o
/Users/xlla/ros2_foxy/src/ros2/rmw_iceoryx/rmw_iceoryx_cpp/src/rmw_publisher.cpp:134:26: error: destructor type 'iox::popo::UntypedPublisherImpl >' in object destruction expression does not match the type 'iox::popo::UntypedPublisher' of the object being destroyed
[ 85%] Building CXX object CMakeFiles/rmw_iceoryx_cpp.dir/src/rmw_subscription.cpp.o
        iceoryx_sender->~UntypedPublisherImpl(), iox::popo::UntypedPublisher)
                         ^
/opt/ros2/include/iceoryx/v2.90.0/iceoryx_posh/internal/popo/untyped_publisher_impl.hpp:31:7: note: type 'iox::popo::UntypedPublisherImpl >' is declared here
class UntypedPublisherImpl : public BasePublisherType
      ^
/Users/xlla/ros2_foxy/src/ros2/rmw_iceoryx/rmw_iceoryx_cpp/src/rmw_publisher.cpp:201:46: error: destructor type 'iox::popo::UntypedPublisherImpl >' in object destruction expression does not match the type 'iox::popo::UntypedPublisher' of the object being destroyed
        iceoryx_publisher->iceoryx_sender_->~UntypedPublisherImpl(),
                                             ^
/opt/ros2/include/iceoryx/v2.90.0/iceoryx_posh/internal/popo/untyped_publisher_impl.hpp:31:7: note: type 'iox::popo::UntypedPublisherImpl >' is declared here
class UntypedPublisherImpl : public BasePublisherType
      ^
[ 88%] Building CXX object CMakeFiles/rmw_iceoryx_cpp.dir/src/rmw_take.cpp.o
2 errors generated.                                     

gmake[2]: *** [CMakeFiles/rmw_iceoryx_cpp.dir/build.make:328: CMakeFiles/rmw_iceoryx_cpp.dir/src/rmw_publisher.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
/Users/xlla/ros2_foxy/src/ros2/rmw_iceoryx/rmw_iceoryx_cpp/src/rmw_subscription.cpp:133:28: error: destructor type 'iox::popo::UntypedSubscriberImpl >' in object destruction expression does not match the type 'iox::popo::UntypedSubscriber' of the object being destroyed
        iceoryx_receiver->~UntypedSubscriberImpl(), iox::popo::UntypedSubscriber)
                           ^
/opt/ros2/include/iceoryx/v2.90.0/iceoryx_posh/internal/popo/untyped_subscriber_impl.hpp:38:7: note: type 'iox::popo::UntypedSubscriberImpl >' is declared here
class UntypedSubscriberImpl : public BaseSubscriberType
      ^
/Users/xlla/ros2_foxy/src/ros2/rmw_iceoryx/rmw_iceoryx_cpp/src/rmw_subscription.cpp:219:51: error: destructor type 'iox::popo::UntypedSubscriberImpl >' in object destruction expression does not match the type 'iox::popo::UntypedSubscriber' of the object being destroyed
        iceoryx_subscription->iceoryx_receiver_->~UntypedSubscriberImpl(),
                                                  ^
/opt/ros2/include/iceoryx/v2.90.0/iceoryx_posh/internal/popo/untyped_subscriber_impl.hpp:38:7: note: type 'iox::popo::UntypedSubscriberImpl >' is declared here
class UntypedSubscriberImpl : public BaseSubscriberType
      ^
2 errors generated.                                     
gmake[2]: *** [CMakeFiles/rmw_iceoryx_cpp.dir/build.make:440: CMakeFiles/rmw_iceoryx_cpp.dir/src/rmw_subscription.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:194: CMakeFiles/rmw_iceoryx_cpp.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
--- stderr: rmw_iceoryx_cpp                             

so I create another PR #82 after built, it works.

talker

$ RMW_IMPLEMENTATION=rmw_iceoryx_cpp ros2 run demo_nodes_py listener
Log level set to: [Warning]
[INFO] [1651478880.783316470] [listener]: I heard: [Hello World: 32]
[INFO] [1651478881.756193642] [listener]: I heard: [Hello World: 33]
[INFO] [1651478882.757147905] [listener]: I heard: [Hello World: 34]

listener

$ RMW_IMPLEMENTATION=rmw_iceoryx_cpp ros2 run demo_nodes_cpp talker
Log level set to: [Warning]
2022-05-02 16:07:28.748 [Warning]: Requested queue capacity 1000 exceeds the maximum possible one for this subscriber, limiting from 1000 to 256
[INFO] [1651478849.756925932] [talker]: Publishing: 'Hello World: 1'
...
[INFO] [1651478881.755188929] [talker]: Publishing: 'Hello World: 33'
[INFO] [1651478882.756071049] [talker]: Publishing: 'Hello World: 34'
[INFO] [1651478883.753664402] [talker]: Publishing: 'Hello World: 35'
[INFO] [1651478884.757749001] [talker]: Publishing: 'Hello World: 36'
mossmaurice commented 1 year ago

Error 2, 4 and 5 still exist on the humble branch. This patch should fix the issues.

mossmaurice commented 1 year ago

Fixed with #90. Feel free to re-open if these issues persist.