Skip to content

Build Guidance SDK pkg for ARM64 architecture (Jetson Nano) #48

@agchatzik

Description

@agchatzik

Hello, I have installed ROS on Jetson Nano following the instructions given at https://github.com/jetsonhacks/installROS Running DJI on board SDK works fine although i cant build Guidance SDK on ARM64. Up to this point, i needed to install arm-linux-gnueabi-g++ compiler in order to recognize libDJI_guidance.so. I also needed to cross compile opencv3. Right now i'm facing the following error when building guidance pkg.

Base path: /home/jetsonvvr/catkin_ws
Source space: /home/jetsonvvr/catkin_ws/src
Build space: /home/jetsonvvr/catkin_ws/build
Devel space: /home/jetsonvvr/catkin_ws/devel
Install space: /home/jetsonvvr/catkin_ws/install
Whitelisted packages: guidance

Running command: "make cmake_check_build_system" in "/home/jetsonvvr/catkin_ws/build"

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

[ 12%] Linking CXX executable /home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNode
[ 25%] Linking CXX executable /home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNodeTest
[ 37%] Linking CXX executable /home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNodeCalibration

/opt/ros/melodic/lib/libroscpp.so: file not recognized: File format not recognized
/opt/ros/melodic/lib/libroscpp.so: file not recognized: File format not recognized
/opt/ros/melodic/lib/libroscpp.so: file not recognized: File format not recognized

collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status

Guidance-SDK-ROS/CMakeFiles/guidanceNode.dir/build.make:149: recipe for target '/home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNode' failed
make[2]: * [/home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNode] Error 1
Guidance-SDK-ROS/CMakeFiles/guidanceNodeCalibration.dir/build.make:149: recipe for target '/home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNodeCalibration' failed
make[2]: * [/home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNodeCalibration] Error 1
CMakeFiles/Makefile2:1269: recipe for target 'Guidance-SDK-ROS/CMakeFiles/guidanceNode.dir/all' failed
make[1]: * [Guidance-SDK-ROS/CMakeFiles/guidanceNode.dir/all] Error 2
make[1]: * Waiting for unfinished jobs....
CMakeFiles/Makefile2:459: recipe for target 'Guidance-SDK-ROS/CMakeFiles/guidanceNodeCalibration.dir/all' failed
make[1]: * [Guidance-SDK-ROS/CMakeFiles/guidanceNodeCalibration.dir/all] Error 2
Guidance-SDK-ROS/CMakeFiles/guidanceNodeTest.dir/build.make:123: recipe for target '/home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNodeTest' failed
make[2]: * [/home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNodeTest] Error 1
CMakeFiles/Makefile2:496: recipe for target 'Guidance-SDK-ROS/CMakeFiles/guidanceNodeTest.dir/all' failed
make[1]: * [Guidance-SDK-ROS/CMakeFiles/guidanceNodeTest.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: * [all] Error 2

### ### ### ### ### ### ### ###

My cmake list if the following:

cmake_minimum_required(VERSION 2.8.3)
project(guidance)

SET ( CMAKE_CROSSCOMPILING TRUE)
SET ( CMAKE_C_COMPILER "arm-linux-gnueabi-g++" )
SET ( CMAKE_CXX_COMPILER "arm-linux-gnueabi-g++" )

#SET(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabi-gcc)
#SET(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabi-g++)
SET(CMAKE_FIND_ROOT_PATH /usr/arm-linux-gnueabi)

SET (CMAKE_PREFIX_PATH "/home/jetsonvvr/Documents/Libraries/opencv3/opencv/build/install/share/OpenCV")
SET (OpenCV_INCLUDE_DIRS "/home/jetsonvvr/Documents/Libraries/opencv3/opencv/build/install/include")
SET (OpenCV_LIBS "/home/jetsonvvr/Documents/Libraries/opencv3/opencv/build/install/lib")

find_package(catkin REQUIRED COMPONENTS
roscpp
cv_bridge
std_msgs
sensor_msgs
geometry_msgs
)
find_package(OpenCV 3 REQUIRED core highgui)

catkin_package(
)

include_directories(
${OpenCV_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
include
)

message("System is: " ${CMAKE_SYSTEM_PROCESSOR})
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
message("-- 32bit detected")
link_directories(lib/x86)
elseif (CMAKE_SIZEOF_VOID_P EQUAL 😎
message("-- 64bit detected")
link_directories(lib/x64)
endif ()
else()
message("-- Non-linux platform detected but sorry we do not support 😀")
endif ()

if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l" )
message("-- " ${CMAKE_SYSTEM_PROCESSOR} " detected")
link_directories(lib/XU3)
else ()
endif ()

link_libraries(
${OpenCV_LIBS}
${catkin_LIBRARIES}
DJI_guidance
usb-1.0
yaml-cpp)

link_libraries(

    ${SOLUTIONTITLE}

    -lopencv_core

    -lopencv_highgui

    -lopencv_imgproc

    -lopencv_imgcodecs

    -lopencv_calib3d

    -lopencv_ximgproc

)

add_executable(guidanceNode
src/GuidanceNode.cpp
src/DJI_utility.cpp)

add_executable(guidanceNodeTest
src/GuidanceNodeTest.cpp)

add_executable(guidanceNodeCalibration
src/GuidanceNodeCalibration.cpp
src/DJI_utility.cpp)

### ###

Do I need to crosscompile ROS and the dependencies from source?
If that's the case can anyone provide me with some brief instructions.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions