vstoneofficial/scara_ros_samples

Silab USBXpressHostのArmv8-A互性

Closed this issue · 1 comments

(解決方法を見つけたので、次のポストで説明します)
(I will explain the solution to this issue in the following post)

以下のシステムを使って、ドキュメント通りにROSをインストールしました。
With the specs below, I installed ROS following the documentation.


HW: Jetson Nano Developer Kit(ARM Cortex-A57)
OS: Ubuntu 20.04
Doc: https://www.vstone.co.jp/products/scara_robot/download/VSASR_ROS_Manual.pdf


サンプルパッケージをビルドするときに、以下のエラーが出ます:
When building the current package, I got the following error:
/usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhiddevice.so when searching for -lslabhiddevice /usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhiddevice.a when searching for -lslabhiddevice

------エラー詳細/Detailed error---------------------------------------------------------------------------------------

$ catkin_make -DCATKIN_BLACKLIST_PACKAGES=""
Base path: /home/mystery/catkin_ws
Source space: /home/mystery/catkin_ws/src
Build space: /home/mystery/catkin_ws/build
Devel space: /home/mystery/catkin_ws/devel
Install space: /home/mystery/catkin_ws/install

Running command: "cmake /home/mystery/catkin_ws/src -DCATKIN_BLACKLIST_PACKAGES= -DCATKIN_DEVEL_PREFIX=/home/mystery/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/mystery/catkin_ws/install -G Unix Makefiles" in "/home/mystery/catkin_ws/build"

-- Using CATKIN_DEVEL_PREFIX: /home/mystery/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2")
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/mystery/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17")
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 4 packages in topological order:
-- ~~ - scara_robot_msgs
-- ~~ - scara_robot_samples
-- ~~ - scara_robot_moveit
-- ~~ - roboticsgroup_gazebo_plugins
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'scara_robot_msgs'
-- ==> add_subdirectory(scara_ros_samples/scara_robot_msgs)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- scara_robot_msgs: 1 messages, 0 services
-- +++ processing catkin package: 'scara_robot_samples'
-- ==> add_subdirectory(scara_ros_samples/scara_robot_samples)
-- +++ processing catkin package: 'scara_robot_moveit'
-- ==> add_subdirectory(scara_ros_samples/scara_robot_moveit)
-- +++ processing catkin package: 'roboticsgroup_gazebo_plugins'
-- ==> add_subdirectory(roboticsgroup_gazebo_plugins)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Boost version: 1.65.1
-- Found the following Boost libraries:
-- thread
-- signals
-- system
-- filesystem
-- program_options
-- regex
-- iostreams
-- date_time
-- chrono
-- atomic
-- Found Protobuf: /usr/lib/aarch64-linux-gnu/libprotobuf.so;-lpthread (found version "3.0.0")
-- Boost version: 1.65.1
-- Looking for OGRE...
-- Found Ogre Ghadamon (1.9.0)
-- Found OGRE: optimized;/usr/lib/aarch64-linux-gnu/libOgreMain.so;debug;/usr/lib/aarch64-linux-gnu/libOgreMain.so
-- Looking for OGRE_Paging...
-- Found OGRE_Paging: optimized;/usr/lib/aarch64-linux-gnu/libOgrePaging.so;debug;/usr/lib/aarch64-linux-gnu/libOgrePaging.so
-- Looking for OGRE_Terrain...
-- Found OGRE_Terrain: optimized;/usr/lib/aarch64-linux-gnu/libOgreTerrain.so;debug;/usr/lib/aarch64-linux-gnu/libOgreTerrain.so
-- Looking for OGRE_Property...
-- Found OGRE_Property: optimized;/usr/lib/aarch64-linux-gnu/libOgreProperty.so;debug;/usr/lib/aarch64-linux-gnu/libOgreProperty.so
-- Looking for OGRE_RTShaderSystem...
-- Found OGRE_RTShaderSystem: optimized;/usr/lib/aarch64-linux-gnu/libOgreRTShaderSystem.so;debug;/usr/lib/aarch64-linux-gnu/libOgreRTShaderSystem.so
-- Looking for OGRE_Volume...
-- Found OGRE_Volume: optimized;/usr/lib/aarch64-linux-gnu/libOgreVolume.so;debug;/usr/lib/aarch64-linux-gnu/libOgreVolume.so
-- Looking for OGRE_Overlay...
-- Found OGRE_Overlay: optimized;/usr/lib/aarch64-linux-gnu/libOgreOverlay.so;debug;/usr/lib/aarch64-linux-gnu/libOgreOverlay.so
-- Found Protobuf: /usr/lib/aarch64-linux-gnu/libprotobuf.so;-lpthread;-lpthread (found suitable version "3.0.0", minimum required is "2.3.0")
-- Config-file not installed for ZeroMQ -- checking for pkg-config
-- Checking for module 'libzmq >= 4'
-- Found libzmq , version 4.2.5
-- Checking for module 'uuid'
-- Found uuid, version 2.31.1
-- Checking for module 'tinyxml2'
-- Found tinyxml2, version 6.0.0
-- Looking for dlfcn.h - found
-- Looking for libdl - found
-- FreeImage.pc not found, we will search for FreeImage_INCLUDE_DIRS and FreeImage_LIBRARIES
-- Checking for module 'gts'
-- Found gts, version 0.7.6
-- Checking for module 'libswscale'
-- Found libswscale, version 4.8.100
-- Checking for module 'libavdevice >= 56.4.100'
-- Found libavdevice , version 57.10.100
-- Checking for module 'libavformat'
-- Found libavformat, version 57.83.100
-- Checking for module 'libavcodec'
-- Found libavcodec, version 57.107.100
-- Checking for module 'libavutil'
-- Found libavutil, version 55.78.100
-- Checking for module 'jsoncpp'
-- Found jsoncpp, version 1.7.4
-- Checking for module 'yaml-0.1'
-- Found yaml-0.1, version 0.1.7
-- Checking for module 'libzip'
-- Found libzip, version 1.1.2
-- Boost version: 1.65.1
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mystery/catkin_ws/build

Running command: "make -j4 -l4" in "/home/mystery/catkin_ws/build"

[ 0%] Built target std_msgs_generate_messages_py
[ 0%] Built target std_msgs_generate_messages_eus
[ 0%] Built target std_msgs_generate_messages_nodejs
[ 0%] Built target std_msgs_generate_messages_lisp
[ 0%] Built target std_msgs_generate_messages_cpp
[ 0%] Built target _scara_robot_msgs_generate_messages_check_deps_Axes
[ 4%] Linking CXX executable /home/mystery/catkin_ws/devel/lib/scara_robot_samples/scarasubscriber
[ 12%] Built target jointstatebridge
[ 16%] Linking CXX executable /home/mystery/catkin_ws/devel/lib/scara_robot_samples/scarasubscriber_gazebo
[ 25%] Built target teaching
[ 29%] Linking CXX executable /home/mystery/catkin_ws/devel/lib/scara_robot_samples/scarapublisher_gazebo
/usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhiddevice.so when searching for -lslabhiddevice
/usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhiddevice.a when searching for -lslabhiddevice
/usr/bin/ld: cannot find -lslabhiddevice
/usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhidtouart.so when searching for -lslabhidtouart
/usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhidtouart.a when searching for -lslabhidtouart
/usr/bin/ld: cannot find -lslabhidtouart
collect2: error: ld returned 1 exit status
scara_ros_samples/scara_robot_samples/CMakeFiles/scarasubscriber.dir/build.make:138: recipe for target '/home/mystery/catkin_ws/devel/lib/scara_robot_samples/scarasubscriber' failed
make[2]: *** [/home/mystery/catkin_ws/devel/lib/scara_robot_samples/scarasubscriber] Error 1
CMakeFiles/Makefile2:1360: recipe for target 'scara_ros_samples/scara_robot_samples/CMakeFiles/scarasubscriber.dir/all' failed
make[1]: *** [scara_ros_samples/scara_robot_samples/CMakeFiles/scarasubscriber.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 37%] Built target roboticsgroup_gazebo_disable_link_plugin
/usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhiddevice.so when searching for -lslabhiddevice
/usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhiddevice.a when searching for -lslabhiddevice
/usr/bin/ld: cannot find -lslabhiddevice
/usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhidtouart.so when searching for -lslabhidtouart
/usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhidtouart.a when searching for -lslabhidtouart
/usr/bin/ld: cannot find -lslabhidtouart
collect2: error: ld returned 1 exit status
scara_ros_samples/scara_robot_samples/CMakeFiles/scarasubscriber_gazebo.dir/build.make:138: recipe for target '/home/mystery/catkin_ws/devel/lib/scara_robot_samples/scarasubscriber_gazebo' failed
make[2]: *** [/home/mystery/catkin_ws/devel/lib/scara_robot_samples/scarasubscriber_gazebo] Error 1
CMakeFiles/Makefile2:1471: recipe for target 'scara_ros_samples/scara_robot_samples/CMakeFiles/scarasubscriber_gazebo.dir/all' failed
make[1]: *** [scara_ros_samples/scara_robot_samples/CMakeFiles/scarasubscriber_gazebo.dir/all] Error 2
/usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhiddevice.so when searching for -lslabhiddevice
/usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhiddevice.a when searching for -lslabhiddevice
/usr/bin/ld: cannot find -lslabhiddevice
/usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhidtouart.so when searching for -lslabhidtouart
/usr/bin/ld: skipping incompatible /home/mystery/USBXpressHostSDK/CP2110_4/lib/x86_64/libslabhidtouart.a when searching for -lslabhidtouart
/usr/bin/ld: cannot find -lslabhidtouart
collect2: error: ld returned 1 exit status
scara_ros_samples/scara_robot_samples/CMakeFiles/scarapublisher_gazebo.dir/build.make:138: recipe for target '/home/mystery/catkin_ws/devel/lib/scara_robot_samples/scarapublisher_gazebo' failed
make[2]: *** [/home/mystery/catkin_ws/devel/lib/scara_robot_samples/scarapublisher_gazebo] Error 1
CMakeFiles/Makefile2:1508: recipe for target 'scara_ros_samples/scara_robot_samples/CMakeFiles/scarapublisher_gazebo.dir/all' failed
make[1]: *** [scara_ros_samples/scara_robot_samples/CMakeFiles/scarapublisher_gazebo.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

USBXpressHostSDKのソースパッケージからlslabhiddeviceライブラリとlslabhidtouartライブラリをホストからビルドすることによって解決できました。
The solution is to build the lslabhiddevice and lslabhidtouart libraries from the source package provided Silabs.

Jetson NanoのARMv8-Aを使用してSilabs CP2110(USB-UARTブリッジ)と通信できるようになりました。 コンパイラによっては、他のアーキテクチャでも同じく互性問題の解決ができる可能性あるかと思います。
This allowed me to communicate with the Silabs CP2110 (USB to UART bridge) using an ARMv8-A. This may also work with other architectures, depending on the compiler.


  1. USBXpressHostSDKのソースに移動します
    Go to the package source:
cd ~/USBXpressHostSDK/CP2110_4/srcpkg

(FYI )Check out the doc

more ./slabhiddevice/ReadMe.txt
  1. slabhiddeviceライブラリをビルドしてインストールします
    Build the slabhiddevice library & install it (default location: /usr/local):
cd ~/USBXpressHostSDK/CP2110_4/srcpkg/slabhiddevice
make
sudo make install

You can check the documentation in ./doc/ for specifics.

  1. slabhidtouartライブラリも同じく、ビルドしてインストールします
    Repeat the same process for the slabhidtouart library :
cd ~/USBXpressHostSDK/CP2110_4/srcpkg/slabhidtouart
make
sudo make install
  1. ライブラリーが正しくインストールされたかを確認します
    Check the libraries are correctly installed in /usr/local/lib :
ls /usr/local/lib
  1. そしたら、scara_ros_samplesのビルドはできるようになる:
    Now you should be able to build the scara_ros_samples package:
cd ~/catkin_ws
catkin_make -DCATKIN_BLACKLIST_PACKAGES=""