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

Compatible Library Versions #14

Closed
peterdavidfagan opened this issue Jan 23, 2023 · 5 comments
Closed

Compatible Library Versions #14

peterdavidfagan opened this issue Jan 23, 2023 · 5 comments

Comments

@peterdavidfagan
Copy link

peterdavidfagan commented Jan 23, 2023

The following document only outlines version compatibility for franka_ros.

I have updated my FER to 4.2.2 and wished to check what the recommended libfranka and associated submodule versions were for interfacing with the robot using franka_ros2.

Error Message

moveit_1  | [ros2_control_node-4] [FATAL] [1674486353.275366943] [FrankaHardwareInterface]: libfranka: Incompatible library version (server version: 5, library version: 4). Please check https://frankaemika.github.io for Panda system updates or use a different version of libfranka.

Environment
ROS Version: Foxy
libfranka: 0.9.0 - 0.10.0 (tested against multiple releases)

Note: I am recursively cloning libfranka so have also cloned associated libfranka-common repository.

Thanks in advance for any clarity you can provide. My workspace is built as a Docker image so I am happy to share further technical details where required.

@andrejpan does this fall under no ROS2 support as mentioned here?

FYI @Kzernobog.

@marcbone
Copy link

marcbone commented Feb 3, 2023

libfranka 0.9.x will work for your robot. So installing 0.9.0 will work. I guess you still have a libfranka 0.8 somewhere on your system which shadows your 0.9 installation.

My random guess is that if you run:
sudo apt remove ros-foxy-libfranka
your problem will be solved. Feel free to reopen if this does not fix your issue.

In general all current libfranka versions should work with franka_ros2

@marcbone marcbone closed this as completed Feb 3, 2023
@peterdavidfagan
Copy link
Author

peterdavidfagan commented Feb 10, 2023

Hi @marcbone,

I retested today with 0.9.0 again and I am still facing the above error. I am building libfranka from source and have run sudo apt remove ros-foxy-libfranka as suggested above.

Here is a Dockerfile to recreate the issue:

ARG ROS_DISTRO=foxy
FROM ros:${ROS_DISTRO}-ros-base
MAINTAINER Peter David Fagan "peterdavidfagan@gmail.com"

# set default DDS to Cyclone
ENV RMW_IMPLEMENTATION rmw_cyclonedds_cpp

# install libfranka
RUN apt update && \
    apt install -y libpoco-dev libeigen3-dev && \
    git clone --branch 0.9.0 https://github.com/frankaemika/libfranka.git --recursive && \
    cd libfranka && \
    mkdir build && cd build && \
    cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF  .. && \
    cmake --build . -j$(nproc) && \
    cpack -G DEB && \
    sudo dpkg -i libfranka-*.deb

# set up workspace
ENV ROS_UNDERLAY /root/panda_ws/install
WORKDIR $ROS_UNDERLAY/..
COPY . .

# import dependent libraries
RUN vcs import --skip-existing src < src/moveit2_tutorials/moveit2_tutorials.repos 

# install ros dependencies
RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \
    apt-get -q update && \
    apt-get install -y ros-${ROS_DISTRO}-rmw-cyclonedds-cpp && \
    apt-get install -y \
    ros-foxy-control-msgs \
    ros-foxy-xacro \
    ros-foxy-angles \
    ros-foxy-ros2-control \
    ros-foxy-realtime-tools \
    ros-foxy-control-toolbox \
    ros-foxy-moveit \
    ros-foxy-ros2-controllers \
    ros-foxy-joint-state-publisher \
    ros-foxy-joint-state-publisher-gui \
    ros-foxy-ament-cmake-clang-format && \
    rosdep update && \
    DEBIAN_FRONTEND=noninteractive \
    rosdep install --from-paths src --ignore-src -r -y --rosdistro ${ROS_DISTRO} --as-root=apt:false && \ 
    colcon build --mixin debug && \
    # Clear apt-cache to reduce image size
    rm -rf /var/lib/apt/lists/* && \
    # Update /ros_entrypoint.sh to source our new workspace
    sed -i "s#/opt/ros/\$ROS_DISTRO/setup.bash#$ROS_UNDERLAY/setup.sh#g" /ros_entrypoint.sh

@marcbone
Copy link

I can assure you that you still have 0.8.0 somewhere on your system. Otherwise the error would not show that you have library version 4. You can verify this by putting

message("libfranka version: ${Franka_VERSION}")

into your CMakeLists.txt.

@peterdavidfagan
Copy link
Author

peterdavidfagan commented Feb 13, 2023

Thanks for getting back to me on this @marcbone.

From the above Dockerfile it seems surprising that this version of libfranka is getting installed within the container.

I think the issue may be due to how ros dependencies are being installed. I'll fix this and report back here. At the very least hopefully this issue thread will help someone else who made the same mistake I did.

@peterdavidfagan
Copy link
Author

The following builds and runs as expected. As @marcbone outlined I was still installing 0.8.0 via rosdep.

ARG ROS_DISTRO=foxy
FROM ros:${ROS_DISTRO}-ros-base
MAINTAINER Peter David Fagan "peterdavidfagan@gmail.com"

# set default DDS to Cyclone
ENV RMW_IMPLEMENTATION rmw_cyclonedds_cpp

# install libfranka
RUN apt update && apt upgrade -y && \
    apt install -y  build-essential cmake git libpoco-dev libeigen3-dev && \
    git clone --recursive https://github.com/frankaemika/libfranka.git --branch 0.9.0 && \
    cd libfranka && \
    mkdir build && cd build && \
    cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF  .. && \
    cmake --build . -j$(nproc) && \
    cpack -G DEB && \
    sudo dpkg -i libfranka-*.deb

# set up workspace
ENV ROS_UNDERLAY /root/panda_ws/install
WORKDIR $ROS_UNDERLAY/..
COPY . .

# import dependent libraries
RUN vcs import --skip-existing src < src/moveit2_tutorials/moveit2_tutorials.repos 

# install ros dependencies
RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \
    apt-get -q update && \
    apt-get install -y ros-${ROS_DISTRO}-rmw-cyclonedds-cpp && \
    apt-get install -y \
    ros-foxy-control-msgs \
    ros-foxy-xacro \
    ros-foxy-angles \
    ros-foxy-ros2-control \
    ros-foxy-realtime-tools \
    ros-foxy-control-toolbox \
    ros-foxy-moveit \
    ros-foxy-ros2-controllers \
    ros-foxy-joint-state-publisher \
    ros-foxy-joint-state-publisher-gui \
    ros-foxy-ament-cmake-clang-format && \
    rosdep update && \
    DEBIAN_FRONTEND=noninteractive \
    rosdep install --from-paths src --ignore-src -r -y --skip-keys "libfranka" --rosdistro ${ROS_DISTRO} && \ 
    colcon build --mixin debug && \
    # Clear apt-cache to reduce image size
    rm -rf /var/lib/apt/lists/* && \
    # Update /ros_entrypoint.sh to source our new workspace
    sed -i "s#/opt/ros/\$ROS_DISTRO/setup.bash#$ROS_UNDERLAY/setup.sh#g" /ros_entrypoint.sh

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

No branches or pull requests

2 participants