Kinovarobotics / matlab_kortex

MATLAB Adaptor packages for KINOVA® KORTEX™ robotic arms
Other
10 stars 4 forks source link

Build error for autogenerated custom ROS2 package #9

Open deepparikh opened 3 years ago

deepparikh commented 3 years ago

Hi,

I am trying to control Kinova Gen 3 robot using NVIDIA Xavier NX via autogenerated ROS2 node. I followed instructions mentioned here.

I am able to generate the ROS package from MATLAB and transfer it to Xavier board. However during the build (on Xavier) I am facing the following error.

Starting >>> example_model --- stderr: example_model /usr/bin/ld: skipping incompatible /home/ubuntu/dev_ws/src/example_model/./lib/libSimplifiedApi.a when searching for -lSimplifiedApi /usr/bin/ld: cannot find -lSimplifiedApi collect2: error: ld returned 1 exit status make[2]: [example_model] Error 1 make[1]: [CMakeFiles/example_model.dir/all] Error 2 make: *** [all] Error 2--- Failed <<< example_model [0.68s, exited with code 2] Summary: 0 packages finished [1.19s] 1 package failed: example_model 1 package had stderr output: example_model

The system details are as following: OS : Ubuntu 18.04 ROS : Dashing

It will be great if you can provide some more information on the source of this issue and solution to enable a successful build.

polthergeist commented 3 years ago

Hi @deepparikh , I think this is because the lib you are using is not built in the correct architecture. Could you confirm the architecture of the SimplifiedApi.a? One way to chieve that is to use the command readelf.

deepparikh commented 3 years ago

Hello @polthergeist , I agree with your intuition. I used _objdump -f FILENAME command to get the information about the architecture. The auto generated package is building successfully in the VM provided by MathWorks. A partial output of objdump command for the SimplifiedApi.a is following :

I have also used gcc -dumpmachine command to get the architecture of the system and the output is following :

It will be really great if you share instructions to generate the library file for suitable architecture. I did some primary investigation of the current workflow provided by Kinova to generate the ROS2 node and deploy it to the Jetson and it seems the library file is already part of the API and we are just linking it in the kortexPostGeneration function.

polthergeist commented 3 years ago

Hi @deepparikh Ok I will look into it. I was under the impression that the aarch64 api was a part of the package. I'll verify a few things on my end and get back to you with the correct API.