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

Build error for autogenerated custom ROS2 package #9

Open
deepparikh opened this issue Dec 22, 2020 · 3 comments
Open

Build error for autogenerated custom ROS2 package #9

deepparikh opened this issue Dec 22, 2020 · 3 comments
Assignees

Comments

@deepparikh
Copy link

deepparikh commented Dec 22, 2020

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
Copy link

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
Copy link
Author

Hello @polthergeist ,
I agree with your intuition. I used objdump -f FILE_NAME 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 :

  • For VM :
    zero_copy_stream_impl_lite.cc.o: file format elf64-x86-64
    architecture: i386:x86-64, flags 0x00000011:
    HAS_RELOC, HAS_SYMS
    start address 0x0000000000000000

  • For Jetson Xavier / Nano
    zero_copy_stream_impl_lite.cc.o: file format elf64-little
    architecture: UNKNOWN!, flags 0x00000011:
    HAS_RELOC, HAS_SYMS
    start address 0x0000000000000000

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

  • For VM : x86_64-linux-gnu
  • For Jetson Xavier / Nano : aarch64-linux-gnu.

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
Copy link

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.

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