ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

ROS on Raspberry PI

asked 2018-06-07 06:34:45 -0500

Fresh gravatar image

Hi. I want to run my own ros node on a raspberry pi which is running a Ubiquity distro . I have a ubuntu here to cross compile my ros node. I am able to cross compile a hello world example without any problems. But when i try to integrate a ros part i always got an error. I use cmake and the following CMakeLIsts.txt file

cmake_minimum_required(VERSION 2.8.3)
project(hello_world)

set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)


## Find catkin and any catkin packages
find_package(catkin REQUIRED COMPONENTS 
        roscpp)

## Declare ROS messages and services
##add_message_files(DIRECTORY msg FILES Num.msg)
##add_service_files(DIRECTORY srv FILES AddTwoInts.srv)

## Generate added messages and services
##generate_messages(DEPENDENCIES std_msgs)

## Declare a catkin package
catkin_package(CATKIN_DEPENDS roscpp)

##set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror -pthread")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
include_directories(include ${catkin_INCLUDE_DIRS})

add_executable(hello_world ../src/main.cpp)
target_link_libraries(hello_world ${catkin_LIBRARIES})
##target_link_libraries(hello_world)

But i always got the following error:

-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
CMake Error at /opt/ros/kinetic/share/catkin/cmake/assert.cmake:17 (message):


  Assertion failed: check for file existence, but filename
  (RT_LIBRARY-NOTFOUND) unset.  Message: RT Library

Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/tools/rt.cmake:42 (assert_file_exists)
  /opt/ros/kinetic/share/catkin/cmake/all.cmake:147 (include)
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:8 (find_package)


-- Configuring incomplete, errors occurred!

Does anybody knows what to do?

edit retag flag offensive close merge delete

Comments

What is your linx distro on raspberry ? Why do you need to cross compile on your desktop for the raspberry ?

Vincent R gravatar image Vincent R  ( 2018-06-22 17:22:36 -0500 )edit

@Vincent R : It can be useful when your compilation takes a lot of time on your raspberry (in my case sometimes the compilation even fails one time out of two so it's a really good alternative)

Delb gravatar image Delb  ( 2018-06-28 01:25:07 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-06-28 01:21:37 -0500

Delb gravatar image

I also struggled with the RT_LIBRARY-NOTFOUND issue and managed to solved it thanks to @duviros 's answer from #q207608 (check it out his little tutorial helped me a lot).

In ordrer to solve the RT_LIBRARY you have to add this line in your toolchain.cmake file :

# Set the target architecture
set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf)

Replace arm-linux-gnueabihf with your compiler (but it should be the same if you are cross compiling for raspberry) and you shouldn't get the error anymore.

edit flag offensive delete link more

Comments

thanks, helped me as well!

r7vme gravatar image r7vme  ( 2020-03-12 18:38:16 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-06-07 06:34:45 -0500

Seen: 556 times

Last updated: Jun 28 '18