Open gipaq1950 opened 1 year ago
I think you might be missing libi2c-dev from the host environment. Either that or the dependency hasn't been explicitly declared on the ROS Node.
Here's a repo with a dockerfile which shows how it can be consumed - https://github.com/polyhobbyist/jetbot
Thank you for quick replay.
I have libi2c-dev installed on Jetson. I added manually i2c.h on the include folder and now I get this error:
Finished <<< ros_qwiic_icm_20948 [13.6s]
Summary: 1 package finished [14.6s] 1 package had stderr output: ros_qwiic_icm_20948
I'll take a look in a couple days - i'm not near my Jetson at the moment. I committed a fix to the icm_20948 which explicitly adds a dependency to libi2c. This should correct the original build error.
The warning manifests on the jetson - I haven't root caused it. However, you can work around it by using --cmake-args -j1 I believe.
which forces the build to use a single thread.
Did you have a look on this issue? Your last suggestion did not solve it. Thanks.
Thanks for checking in - I'll look at it tonight.
Working on this now - can you tell me more about how you are using this library? Are you using it in a container or on bare metal?
I have Ubuntu 20.04 installed on Jetson nano and ros2 foxy.
Can you post the full build log? (either from the logs folder, or colcon build --event-handlers=console_direct+)
I'm unable to reproduce this.
the i2c/i2c.h comes from an external cmake project:
find_program(MAKE_EXECUTABLE
NAMES gmake mingw32-make make
NAMES_PER_DIR
DOC "GNU Make")
if(NOT MSVC)
include(ExternalProject)
ExternalProject_Add(libi2c
GIT_REPOSITORY https://github.com/amaork/libi2c.git
UPDATE_DISCONNECTED true
BUILD_IN_SOURCE true
CONFIGURE_COMMAND ""
BUILD_COMMAND ${MAKE_EXECUTABLE}
INSTALL_COMMAND ""
)
ExternalProject_Get_property(libi2c SOURCE_DIR)
message (STATUS "*** libi2c installed to ${SOURCE_DIR}")
target_link_libraries(${PROJECT_NAME} ${SOURCE_DIR}/libi2c.so)
add_dependencies(${PROJECT_NAME} libi2c)
else()
endif()
I suspect that this isn't being included. Maybe because make isn't found? or the network is blocked?
Thanks for the logs. It looks like a build order problem - wiring.cpp is getting built before libi2c is getting built.
un ros_qwiic_icm_20948 do you have the following line in the makefile?
add_dependencies(${PROJECT_NAME} libi2c)
which happens after these lines?
message (STATUS "*** libi2c installed to ${SOURCE_DIR}")
target_link_libraries(${PROJECT_NAME} ${SOURCE_DIR}/libi2c.so)
[35m[1mScanning dependencies of target libi2c[0m
[35m[1mScanning dependencies of target ros_qwiic_icm_20948[0m
[ 6%] [34m[1mCreating directories for 'libi2c'[0m
[ 13%] [34m[1mPerforming download step (git clone) for 'libi2c'[0m
[ 26%] [32mBuilding CXX object CMakeFiles/ros_qwiic_icm_20948.dir/src/wiring_for_ros/Wire.cpp.o[0m
[ 26%] [32mBuilding CXX object CMakeFiles/ros_qwiic_icm_20948.dir/src/wiring_for_ros/SPI.cpp.o[0m
[ 33%] [32mBuilding CXX object CMakeFiles/ros_qwiic_icm_20948.dir/src/main.cpp.o[0m
[ 40%] [32mBuilding CXX object CMakeFiles/ros_qwiic_icm_20948.dir/src/wiring_for_ros/Arduino.cpp.o[0m
Your branch is up to date with 'origin/master'.
[ 53%] [34m[1mSkipping update step for 'libi2c'[0m
[ 53%] [34m[1mNo patch step for 'libi2c'[0m
[ 60%] [34m[1mNo configure step for 'libi2c'[0m
[ 66%] [34m[1mPerforming build step for 'libi2c'[0m
I added add_dependencies(${PROJECT_NAME} libi2c) to cmakelist.txt file and now I don't have error i2c/i2c.h but now I get error:
Finished <<< ros_qwiic_icm_20948 [25.4s]
Summary: 1 package finished [26.7s] 1 package had stderr output: ros_qwiic_icm_20948
Finished <<< ros_qwiic_icm_20948 [2.80s]
Summary: 1 package finished [3.77s] 1 package had stderr output: ros_qwiic_icm_20948
jetson@nano:~/dev_ws$ ros2 launch ros_qwiic_icm_20948 qwiic.launch.py [INFO] [launch]: All log files can be found below /home/jetson/.ros/log/2023-05-01-03-04-54-778640-nano-19167 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [ros_qwiic_icm_20948-1]: process started with pid [19169] [ros_qwiic_icm_20948-1] /home/jetson/dev_ws/install/ros_qwiic_icm_20948/lib/ros_qwiic_icm_20948/ros_qwiic_icm_20948: symbol lookup error: /home/jetson/dev_ws/install/ros_qwiic_icm_20948/lib/ros_qwiic_icm_20948/ros_qwiic_icm_20948: undefined symbol: i2c_init_device [ERROR] [ros_qwiic_icm_20948-1]: process has died [pid 19169, exit code 127, cmd '/home/jetson/dev_ws/install/ros_qwiic_icm_20948/lib/ros_qwiic_icm_20948/ros_qwiic_icm_20948 --ros-args -r __node:=ros_qwiic_icm_20948'].
hmmm... it looks like the --package-select causes the issue. Not quite sure why.
I got error i2c/i2c.h missing when I try to build the ICM 20948 ros node package on jetson nano with ros2 foxy . How to fix it? Thanks