ros2 / rmw_iceoryx

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

Build Fails for ROS2 foxy #78

Closed javad123javad closed 2 years ago

javad123javad commented 2 years ago

Hi, I want to build rmw_iceoryx for ROS2 Foxy. I followed the instruction provided in the README file. For master branch following error is shown: --- stderr: rmw_iceoryx_cpp /home/javad/iceoryx_ws/src/rmw_iceoryx/rmw_iceoryx_cpp/src/rmw_event.cpp:53:3: error: ‘rmw_event_callback_t’ has not been declared 53 | rmw_event_callback_t callback, | ^~~~~~~~~~~~~~~~~~~~ In file included from /home/javad/iceoryx_ws/src/rmw_iceoryx/rmw_iceoryx_cpp/src/rmw_event.cpp:16: /home/javad/iceoryx_ws/src/rmw_iceoryx/rmw_iceoryx_cpp/src/rmw_event.cpp: In function ‘rmw_ret_t rmw_event_set_callback(rmw_event_t*, int, const void*)’: /home/javad/iceoryx_ws/src/rmw_iceoryx/rmw_iceoryx_cpp/src/rmw_event.cpp:57:35: warning: NULL used in arithmetic [-Wpointer-arith] 57 | RCUTILS_CHECK_ARGUMENT_FOR_NULL(callback, RMW_RET_INVALID_ARGUMENT);

Then I switch to foxy branch and try to build. Following error is generated. --- stderr: rmw_iceoryx_cpp In file included from /home/javad/iceoryx_ws/src/rmw_iceoryx/rmw_iceoryx_cpp/src/internal/iceoryx_name_conversion.cpp:35: /home/javad/iceoryx_ws/src/rmw_iceoryx/rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_name_conversion.hpp:23:10: fatal error: iceoryx_utils/cxx/string.hpp: No such file or directory 23 | #include "iceoryx_utils/cxx/string.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.

mossmaurice commented 2 years ago

Hi @javad123javad thanks for reporting this issue!

I couldn't reproduce the problems. The master branch is only working together with ROS 2 Rolling. I tried the following successfully:

# Created ADE ros2_gfoxyenvironment based on public image: https://gitlab.apex.ai/apex.ai-public/ros2-ade
mkdir -p ~/ade-home/ros2_foxy
cd ~/ade-home/ros2_foxy
wget https://gitlab.apex.ai/apex.ai-public/ros2-ade/-/raw/master/.aderc-foxy -O .aderc
ade start --update --enter

# Install dependencies for iceoryx inside ADE/Docker
sudo apt install libacl1-dev libncurses5-dev

# Build steps inside ADE/Docker
source /opt/ros/foxy/setup.bash
cd ~/ros2_foxy
mkdir src
wget https://raw.githubusercontent.com/ros2/ros2/foxy/ros2.repos
vcs import src < ros2.repos
cd ~/ros2_foxy/src/
git clone --branch v1.0.1-foxy https://github.com/ros2/rmw_iceoryx.git
git clone --branch v1.0.1 https://github.com/eclipse-iceoryx/iceoryx.git
cd ~/ros2_foxy
colcon build --symlink-install --merge-install

Can you copy & paste the commands than you ran to this issue?

javad123javad commented 2 years ago

Hi @mossmaurice Thanks so much for your response. I followed your instructions. However, As I'm using Nvidia Jetson (aarch64) Device. It shows the following error.

~/ade-home/ros2_foxy$ ade start --update --enter
foxy: Pulling from apex.ai-public/ros2-ade/base_image
7b1a6ab2e44d: Pull complete 
b5c1a9a9217b: Pull complete 
d3466212f8c5: Pull complete 
19a1bfd0d4fe: Pull complete 
3a7469b40723: Pull complete 
f48ecf251de6: Pull complete 
12a85295dc64: Pull complete 
4fe40adebd3b: Pull complete 
a605020c5f8d: Pull complete 
3acabb133601: Pull complete 
Digest: sha256:a8bf4094796d4fb1131d0d275180803cff5a8c03ff658f8803b20f5936aa574a
Status: Downloaded newer image for registry.apex.ai/apex.ai-public/ros2-ade/base_image:foxy
registry.apex.ai/apex.ai-public/ros2-ade/base_image:foxy
Creating volume container for registry.apex.ai/apex.ai-public/ros2-ade/base_image:foxy
foxy: Pulling from apex.ai-public/ros2-ade/binary
59bf1c3509f3: Pull complete 
3f2e5dcc771c: Pull complete 
Digest: sha256:dd772fb4e136239d67dc3beff83ae5a3909b14710c38eca3e54cb6289b90a9de
Status: Downloaded newer image for registry.apex.ai/apex.ai-public/ros2-ade/binary:foxy
registry.apex.ai/apex.ai-public/ros2-ade/binary:foxy
Creating volume container for registry.apex.ai/apex.ai-public/ros2-ade/binary:foxy
Starting ros2_foxy with the following images:
base_image | n/a          | foxy | registry.apex.ai/apex.ai-public/ros2-ade/base_image:foxy
binary     | a52a95460cfc | foxy | registry.apex.ai/apex.ai-public/ros2-ade/binary:foxy    
ros2_foxy_registry.apex.ai_apex.ai-public_ros2-ade_binary_foxy
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
standard_init_linux.go:228: exec user process caused: exec format error
ERROR: Failed to start ade. To debug use, ``ade start -- --env DEBUG=1``.

When I tried with DEBUG=1:

foxy: Pulling from apex.ai-public/ros2-ade/base_image
Digest: sha256:a8bf4094796d4fb1131d0d275180803cff5a8c03ff658f8803b20f5936aa574a
Status: Image is up to date for registry.apex.ai/apex.ai-public/ros2-ade/base_image:foxy
registry.apex.ai/apex.ai-public/ros2-ade/base_image:foxy
foxy: Pulling from apex.ai-public/ros2-ade/binary
Digest: sha256:dd772fb4e136239d67dc3beff83ae5a3909b14710c38eca3e54cb6289b90a9de
Status: Image is up to date for registry.apex.ai/apex.ai-public/ros2-ade/binary:foxy
registry.apex.ai/apex.ai-public/ros2-ade/binary:foxy
Starting ros2_foxy with the following images:
base_image | n/a          | foxy | registry.apex.ai/apex.ai-public/ros2-ade/base_image:foxy
binary     | a52a95460cfc | foxy | registry.apex.ai/apex.ai-public/ros2-ade/binary:foxy    
ros2_foxy_registry.apex.ai_apex.ai-public_ros2-ade_binary_foxy
docker: invalid reference format: repository name must be lowercase.
See 'docker run --help'.
ERROR: Command return non-zero exit code (see above): 125
  docker run -h ros2_foxy --detach --name ros2_foxy --env COLORFGBG --env COLORTERM --env EMAIL --env GIT_AUTHOR_EMAIL --env GIT_AUTHOR_NAME --env GIT_COMMITTER_EMAIL --env GIT_COMMITTER_NAME --env SSH_AUTH_SOCK --env TERM --env TIMEZONE=Europe/Berlin --env USER=imperiumdrive --env GROUP=imperiumdrive --env USER_ID=1000 --env GROUP_ID=1000 -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/imperiumdrive/ade-home:/home/imperiumdrive --env ADE_CLI_VERSION=4.4.0 --env ADE_HOME_HOSTPATH=/home/imperiumdrive/ade-home --label ade_version=4.4.0 --label ade_base_image --env DISPLAY --env VIDEO_GROUP_ID=44 -v /dev/dri:/dev/dri -v /home/imperiumdrive/.ssh:/home/imperiumdrive/.ssh --volumes-from ros2_foxy_registry.apex.ai_apex.ai-public_ros2-ade_binary_foxy:ro --label 'ade_volumes_from=["ros2_foxy_registry.apex.ai_apex.ai-public_ros2-ade_binary_foxy"]' DEBUG=1 --cap-add=SYS_PTRACE --cap-add=SYS_ADMIN --cap-add=NET_ADMIN --ulimit rtprio=100:100 --ulimit memlock=-1:-1 --shm-size 4G --env ADE_IMAGE_BASE_IMAGE_FQN=registry.apex.ai/apex.ai-public/ros2-ade/base_image:foxy --env ADE_IMAGE_BASE_IMAGE_COMMIT_SHA= --env ADE_IMAGE_BASE_IMAGE_COMMIT_TAG= --env ADE_IMAGE_BINARY_FQN=registry.apex.ai/apex.ai-public/ros2-ade/binary:foxy --env ADE_IMAGE_BINARY_COMMIT_SHA=a52a95460cfcc565f1cb576eeb085b40ee807139 --env ADE_IMAGE_BINARY_COMMIT_TAG= --label 'ade_images=[{"fqn": "registry.apex.ai/apex.ai-public/ros2-ade/base_image:foxy", "commit_sha": "", "commit_tag": ""}, {"fqn": "registry.apex.ai/apex.ai-public/ros2-ade/binary:foxy", "commit_sha": "a52a95460cfcc565f1cb576eeb085b40ee807139", "commit_tag": ""}]' registry.apex.ai/apex.ai-public/ros2-ade/base_image:foxy

Is there any change to use it on aarch64 or it should be X86 compatible device?

javad123javad commented 2 years ago

@mossmaurice I followed your instruction on X86 host. it build successfully. But when running demo it shows bellow error:

$ RMW_IMPLEMENTATION=rmw_iceoryx_cpp ros2 run demo_nodes_cpp talker
Log level set to: [Warning]
2022-04-20 11:02:16.346 [Warning]: RouDi not found - waiting ...
2022-04-20 11:03:16.404 [ Fatal ]: Timeout registering at RouDi. Is RouDi running?
2022-04-20 11:03:16.404 [ Error ]: ICEORYX error! IPC_INTERFACE__REG_ROUDI_NOT_AVAILABLE
mossmaurice commented 2 years ago

@javad123javad Great to hear that you got the build working!

Is there any change to use it on aarch64 or it should be X86 compatible device?

These ADE images are only for x86. I don't know how much effort adding aarch64 would be. Maybe @LanderU can give an estimate. If you want to compile on aarch64 I would advise to build the traditional way without ade.

[ Fatal ]: Timeout registering at RouDi. Is RouDi running?

The daemon RouDi needs to be running to setup shared memory and the data structures, see here for a overview over iceoryx. Making yourself familar with the hello world might also be a good idea.

LanderU commented 2 years ago

@mossmaurice, yeah, I've this on my backlog for ros2-ade. I'll try to implement something for aarch64.

If you'd like to use foxy. The image for aarch64 is already available:

javad123javad commented 2 years ago

@mossmaurice @LanderU Thanks a lot. It works good on both platforms !