Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all 670 articles
Browse latest View live

rosrun autocomplete show all src files.

$
0
0
when i try autocomplete at rosrun with tab key, uesr@pc:~$ rosrun name-of-pkg [tab] CMakeLists.txt [executable_name] main.cpp package.xml what i expect is to see only the executable_name on autocomplete, but what i see is whole files in package folder in src another happening : i created 2 catkin workspace with a pkg 1. create ws1/src/ws1_pkg, do $ catkin_make 2. then create ws2/src/ws2_pkg, do $ catkin_make 3. $ source ws1/devel/setup.bash -> can't autocomplete ws2_pkg 4. new terminal $ source ws2/devel/setup.bash -> rosrun ws1_pkg shows up. ws1_pkg shows up even if i sourced ws2 setup.bash What's happening to me? ubuntu 16.04, kinetic, reinstalled today

Is there a way to undo workspace chaining?

$
0
0
From my $ROS_PACKAGE_PATH, I realised my workspaces have been chained together. Is there a way to undo it?

Generate srvs from directory using catkin build

$
0
0
For srv generation, I've taken to using `add_service_files(DIRECTORY srv)` instead of listing each file individually, since it's more compact and I don't ever put srvs in that directory that I don't want generated. However, one downside is, since you don't have to edit the `CMakeLists.txt` file when you add a new srv to that directory, it doesn't generate them unless I do a `catkin clean` or I make some edit to `CMakeLists.txt`. What I want to know, is there a way to force it to generate the srvs with a `catkin build` without having to do a clean, and without making bogus edits to `CMakeLists.txt`?

Unable to run a specific node in node manager

$
0
0
There is this camera node I can't run in node manager. It keeps crashing and unable to detect any cameras. However, I am able to run it smoothly from the terminal. Also, I am able to run other nodes (camera or others) smoothly from the node manager.

How can I generate pkg-config files for my package?

$
0
0
I have a Catkin package that generates several binaries and libraries, but unlike some other packages, pkg-config can't find them. ROS seems to have set the path to both my Kinetic installation, as well as my workspace. echo $PKG_CONFIG_PATH somelocation/workspace/devel/lib/pkgconfig:somelocation/ros_catkin_ws/install_isolated/lib/pkgconfig When I ask ` pkg-config --list-all` about it, it does know about all of the ROS libraries, and also about things I installed in my own workspace, like `joy` and `uuid`. But it does not find the libraries I wrote myself. I went over to the `CMakeLists.txt` of `joy` to see if I could find anything obvious that has to be done to generate the correct files, but can't see anything. There is no `.pc` file in the repo either. I also tried to google around, but all results are about using external packages inside ROS, not about using ROS package outside it. Currently I'm just doing this, but that apparently does not get you any `pkg-config` files. add_library(Skill $ $ $ $ $ ) add_dependencies(Skill ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ) When I run this, there is no output $ pkg-config --list-all | grep -i skill So what is the correct way to tell `pkg-config` about my library, just like `joy` and `uuid`?

Best practice to handle data files

$
0
0
Hello, I have a node that needs to load a binary firmware file in order to execute. I'm wondering what's the best way to handle this in ROS. I've seen options pointing to adding a file/configure_file line in CMakeLists and then using a relative path from my .cpp; others seem to use install(); others yet say it's best to let the executable point directly to the file path in the package's source folder, using ros::package::getPath perhaps. So, what's the best way? Thanks in advance. EDIT: I'm sceptical of the last option because I'm following recommendations to implement base functionalities independent from ROS and then have the ROS nodes act as wrappers. Therefore, my firmware loading happens in a base class in which I don't want to include "ros/package.h"

Adding a package to the ROS distro with third party dependencies

$
0
0
Hello, I am quite new to the ROS packaging stuff so please advise me if I am heading in the wrong direction. I do want to add the ROS driver of our 3D Time of Flight cameras to the ROS distribution. At the moment I am working on Ubuntu 16.04 and ROS kinetic. The ROS node for the cameras is hosted here: [https://github.com/lovepark/ifm3d-ros](https://github.com/lovepark/ifm3d-ros) this node depends on the Open Source library [ifm3d library](https://github.com/lovepark/ifm3d). To add the [ifm3d library](https://github.com/lovepark/ifm3d) I followed the [Bloom Releasing a Third Party Package](http://wiki.ros.org/action/fullsearch/bloom/Tutorials/ReleaseThirdParty) tutorial. Due to the fact that the [ifm3d library](https://github.com/lovepark/ifm3d) depends on multiple packages I am struggling with the following dependencies at the moment: - libgoogle-glog-dev (Ubuntu) [Google logging module](https://github.com/google/glog) - libxmlrpc-c++8-dev (Ubuntu) [XML-RPC for C and C++](http://xmlrpc-c.sourceforge.net/) Those dependencies are not available in the [rosdep/base.yaml](https://github.com/ros/rosdistro/blob/master/rosdep/base.yaml) and therefore I do get the following error message when running ``git-bloom-release kinetic`` Could not resolve rosdep key 'glog' Failed to resolve glog on ubuntu:xenial with: Error running generator: Failed to resolve rosdep key 'glog', aborting. glog is depended on by these packages: ['ifm3d-core'] <== Failed Could not resolve rosdep key 'xmlrpc-c++' Failed to resolve xmlrpc-c++ on ubuntu:xenial with: Error running generator: Failed to resolve rosdep key 'xmlrpc-c++', aborting. xmlrpc-c++ is depended on by these packages: ['ifm3d-core'] <== Failed Some of the dependencies for packages in this repository could not be resolved by rosdep. You can try to address the issues which appear above and try again if you wish. Would you like to try again? [Y/n]? n User aborted after rosdep keys were not resolved. <== The following generator action reported that it is missing one or more rosdep keys, but that the key exists in other platforms: '['/usr/bin/git-bloom-generate', '-y', 'rosdebian', '--prefix', 'release/kinetic', 'kinetic', '-i', '1', '--os-name', 'ubuntu']' As far I do understand the way to proceed is by adding those dependencies to [rosdep/base.yaml](https://github.com/ros/rosdistro/blob/master/rosdep/base.yaml) which will provide ``rosdep`` the ability to resolve all the dependencies on all supported platforms. Is there a recommended way to check all the package names for all *inux Platforms or is is legal to add the dependency graph only for my usecase which is tested by me? I am sure I've mixed up a lot, so please be kind and advise me how to proceed in a correct way.

Errors

$
0
0
Hi, I am trying to build the bebop_driver, but whenever I try to run ' catkin build ' in the workspace, I get the following error: david@uno:~/bebop_ws$ catkin build Profile: default Extending: [env] /opt/ros/kinetic Workspace: /home/david/bebop_ws Source Space: [exists] /home/david/bebop_ws/src Log Space: [missing] /home/david/bebop_ws/logs Build Space: [exists] /home/david/bebop_ws/build Devel Space: [exists] /home/david/bebop_ws/devel Install Space: [unused] /home/david/bebop_ws/install DESTDIR: [unused] None Devel Space Layout: linked Install Space Layout: None Additional CMake Args: None Additional Make Args: None Additional catkin Make Args: None Internal Make Job Server: True Cache Job Environments: False Whitelisted Packages: None Blacklisted Packages: None Workspace configuration appears valid. NOTE: Forcing CMake to run for each package. [build] Found '5' packages in 0.0 seconds. [build] Updating package table. Starting >>> catkin_tools_prebuild Finished <<< catkin_tools_prebuild [ 1.5 seconds ] Starting >>> bebop_description Starting >>> bebop_msgs Finished <<< bebop_description [ 1.5 seconds ] Finished <<< bebop_msgs [ 8.7 seconds ] Starting >>> bebop_driver ____________________________________________________________________________________________________ Warnings << bebop_driver:cmake /home/david/bebop_ws/logs/bebop_driver/build.cmake.000.log CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message): catkin_package() DEPENDS on 'system_lib' but neither 'system_lib_INCLUDE_DIRS' nor 'system_lib_LIBRARIES' is defined. Call Stack (most recent call first): /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package) CMakeLists.txt:40 (catkin_package) CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message): catkin_package() DEPENDS on 'libavcodec' but neither 'libavcodec_INCLUDE_DIRS' nor 'libavcodec_LIBRARIES' is defined. Call Stack (most recent call first): /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package) CMakeLists.txt:40 (catkin_package) CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message): catkin_package() DEPENDS on 'libavformat' but neither 'libavformat_INCLUDE_DIRS' nor 'libavformat_LIBRARIES' is defined. Call Stack (most recent call first): /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package) CMakeLists.txt:40 (catkin_package) CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message): catkin_package() DEPENDS on 'libswscale' but neither 'libswscale_INCLUDE_DIRS' nor 'libswscale_LIBRARIES' is defined. Call Stack (most recent call first): /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package) CMakeLists.txt:40 (catkin_package) cd /home/david/bebop_ws/build/bebop_driver; catkin build --get-env bebop_driver | catkin env -si /usr/local/bin/cmake /home/david/bebop_ws/src/bebop_autonomy/bebop_driver --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/david/bebop_ws/devel/.private/bebop_driver -DCMAKE_INSTALL_PREFIX=/home/david/bebop_ws/install; cd - ____________________________________________________________________________________________________ Errors << bebop_driver:make /home/david/bebop_ws/logs/bebop_driver/build.make.000.log CMakeFiles/bebop_driver_node.dir/src/bebop_driver_node.cpp.o: In function `main': bebop_driver_node.cpp:(.text+0x6a): undefined reference to `ros::init(int&, char**, std::string const&, unsigned int)' bebop_driver_node.cpp:(.text+0x9b): undefined reference to `ros::names::getRemappings()' bebop_driver_node.cpp:(.text+0xc1): undefined reference to `ros::this_node::getName()' bebop_driver_node.cpp:(.text+0x128): undefined reference to `nodelet::Loader::load(std::string const&, std::string const&, std::map, std::allocator>> const&, std::vector> const&)' bebop_driver_node.cpp:(.text+0x15c): undefined reference to `nodelet::Loader::listLoadedNodelets()' bebop_driver_node.cpp:(.text+0x24d): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' bebop_driver_node.cpp:(.text+0x364): undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' collect2: error: ld returned 1 exit status make[2]: *** [/home/david/bebop_ws/devel/.private/bebop_driver/lib/bebop_driver/bebop_driver_node] Error 1 make[1]: *** [CMakeFiles/bebop_driver_node.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... make: *** [all] Error 2 cd /home/david/bebop_ws/build/bebop_driver; catkin build --get-env bebop_driver | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd - Failed << bebop_driver:make [ Exited with code 2 ] Failed <<< bebop_driver [ 19.7 seconds ] Abandoned <<< bebop_tools [ Unrelated job failed ] [build] Summary: 3 of 5 packages succeeded. [build] Ignored: 1 packages were skipped or are blacklisted. [build] Warnings: 1 packages succeeded with warnings. [build] Abandoned: 1 packages were abandoned. [build] Failed: 1 packages failed. [build] Runtime: 29.9 seconds total. [build] Note: Workspace packages have changed, please re-source setup files to use them. I need some help please!!

Problem in installing ros indigo in chroot

$
0
0
Hi everyone, I followed [this](http://wiki.ros.org/ROS/Tutorials/InstallingIndigoInChroot) tutorial step by step in a fresh installed ubuntu16.04 and everything goes fine. but the command sudo apt-get install python-rosdep caused to the following error: The following packages have unmet dependencies: python-rosdep : Depends: python-catkin-pkg but it is not installed python-rosdistro-modules : Depends: python-catkin-pkg-modules but it is not installed I really searched but no solution found ... so any help is really appreciated.

How to separate bloom-generate'd debian package into variants (release, -dev, -dbg)

$
0
0
I'd like to separate binary debian packages I can produce with `bloom-generate` and `debuild` into variants: - release (only libraries and executables) - -dev (headers, symlinks) - -dbg (debugging symbols) To give a more specific example - this is a toy workspace with 3 interdependent packages: https://github.com/aurzenligl/study/tree/master/ros-distro When using Ubuntu 16.04.4 LTS and ros-kinetic, I can produce debian binary packages with `package_workspace.bash` script (installing rosdep rules by `install_rosdep_rules.bash` first), but I don't know how to separate -dev and -dbg parts from these packages. I have: - `ros-kinetic-arx_0.1.2-0xenial_amd64.deb` - `ros-kinetic-bar_1.2.4-0xenial_amd64.deb` - `ros-kinetic-foo_3.4.5-0xenial_amd64.deb` I aim for: - `ros-kinetic-arx-dbg_0.1.2-0xenial_amd64.deb` - `ros-kinetic-arx-dev_0.1.2-0xenial_amd64.deb` - `ros-kinetic-arx_0.1.2-0xenial_amd64.deb` - `ros-kinetic-bar-dbg_1.2.4-0xenial_amd64.deb` - `ros-kinetic-bar-dev_1.2.4-0xenial_amd64.deb` - `ros-kinetic-bar_1.2.4-0xenial_amd64.deb` - `ros-kinetic-foo-dbg_3.4.5-0xenial_amd64.deb` - `ros-kinetic-foo-dev_3.4.5-0xenial_amd64.deb` - `ros-kinetic-foo_3.4.5-0xenial_amd64.deb` with correct dependencies among each other, so that all kinds of users: - interested only in running, - only in compiling/linking and - only in debugging would be satisfied. How can I achieve that?

catkin debug subset of packages

$
0
0
How do I use `catkin_tools` to build only a subset of packages from the current workspace in debug mode? To build the whole workspace in debug mode, you would call `catkin build --cmake-args -DCMAKE_BUILD_TYPE=Debug` which sets the cmake variable `CMAKE_BUILD_TYPE` for all packages. But how can I set different variable values for different packages in the same workspace?

CMake cannot find source file

$
0
0
Hi guys, I'm using ROS kinetic on a Navio2 board, and I've been working on a project in a catkin workspace. I edited the CMakeLists.txt file to add an executable, but every time I attempt to run catkin_make, I get the following error: CMake Error at link/CMakeLists.txt:201 (add_executable): Cannot find sourcefile: link/src/roscomm.cpp Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx CMake Error: CMake can not determine linker language for target: roscomm CMake Error: Cannot determine link language for target "roscomm". -- Generating done -- Build files have been written to: /home/pi/ros_ws/build Invoking "cmake" failed I know for sure that this file exists, and I've tried using just roscomm.cpp instead of link/src/roscomm.cpp. --- Edit: The full path is `~/ros_ws/src/link/src/roscomm.cpp` The CMakeLists.txt is as follows: cmake_minimum_required(VERSION ) project(link) find_package(catkin REQUIRED COMPONENTS roscpp rospy sensor_msgs std_msgs ) catkin_package() include_directories( ${catkin_INCLUDE_DIRS} ) add_executable(roscomm link/src/roscomm.cpp) target_link_libraries(roscomm ${catkin_INCLUDE_DIRS}) Any help would be great, thanks

roscd can't find newly created packages

$
0
0
I've already read half the internet, here's what's wrong: Packages created with catkin_create_pkg in a catkin workspace can't be found by roscd, therefore roslaunch etc. don't work either. I already found out that the path to the workspace is missing in the ROS_PACKAGE_PATH, that might be the problem. Here's what I already tried: - Setting up a new workspace on the same level as the old one. Result: Nothing better. - manipulating the .bashrc and ROS_PACKAGE_PATH. Result: Spaces in the path to the workspace are deleted, although I used them with escape characters. So the path is incorrect and I get the adequate error. - Creating a new plain package in the workspace/src, problem as described - I've sourced the devel/setup.bash a million times, that doesn't fix it. - Restarting the console permanently (always sourcing setup.bash afterwards) Also, when trying to launch something (that worked in the exact same workspace before!), I get the error "[] is neither a launch file in package [] nor is [] a launch file name". My setup is kind of complicated: My workspace is in a OneDrive-synced folder (Win10 file system), which is then mounted using WSL to have a Linux environment for ROS development.

Integrating ROS with an existing C++ code base

$
0
0
I have an existing C++ code base building in Eclipse and running under Ubuntu 16.04 and I would like to incorporate some ROS (melodic) functionality (nodes, services, etc, for starters). I've been reading the tutorials and documentation about catkin and such, and also done some searching, but I'm still unsure of the best way to make this happen. For example, is there a way that I can add the ROS build constructs to the existing Eclipse project? Or do I need to create a new project, and import the source? In the latter case, do I need to add lines for all the cpp files to CMakeLists.txt manually? I've also found this: http://wiki.ros.org/IDEs , which is surely relevant, but doesn't quite describe my situation. If someone could point me in the right direction, I'd appreciate it. Thanks!

Integrating ROS with an existing cpp code base

$
0
0
I have an existing C++ code base building in Eclipse and running under Ubuntu 16.04 and I would like to incorporate some ROS (melodic) functionality (nodes, services, etc, for starters). I've been reading the tutorials and documentation about catkin and such, and also done some searching, but I'm still unsure of the best way to make this happen. For example, is there a way that I can add the ROS build constructs to the existing Eclipse project? Or do I need to create a new project, and import the existing source? In the latter case, do I need to add lines for all the cpp files to CMakeLists.txt manually? I've also found this: http://wiki.ros.org/IDEs , which is surely relevant, but doesn't quite describe my situation. If someone could point me in the right direction, I'd appreciate it. Thanks!

Workspace correct build?

$
0
0
Hello I am new to ROS. I have read and tried various tutorials on wiki.ros.org. My current try is to install a ROS with the [ur_modern_drivers](https://github.com/ThomasTimm/ur_modern_driver) on my Raspberry Pi 3B. First i tried to install it on a RPi 3b+, but due to the problem, that a suitable OS cannot be installed yet on the RPI 3B+ i downgraded to the RPi 3B. I tried it with Raspbian Jessie and Stretch, and it worked almost perfect, but the ur drives made several different problems. Then i tried it with Ubuntu Mate Xenial 16.04 as suggested in the wiki. But now I stuck again with the ur_modern_drivers. When i want to install it with catkin_make, i get following error: `The specified base path "path/ur_modern_driver" contains a package but "catkin_make" must be invoked in the root of workspace` I googeled the problem and yeah i can read the problem. I tried to build it in `user@pi:/opt/ros/kinetic/etc/catkin` - folder woth only profile.d `user@pi:/catkin_ws/` - i created the workspace and cloned the repository ` user@pi:/opt/ros/kinetic/etc/catkin_ws` - i created the workspace and cloned the repository I was not able to locate catkin_ws, and in my catkin folder there is no `devel` nor `build` nor `src`. I am aware of that: [Wiki Answers](https://answers.ros.org/question/221538/the-specified-base-path-homeruicatkin_ws-contains-a-package-but-catkin_make-must-be-invoked-in-the-root-of-workspace-how-can-i-fix-it/) and followed that possible fix. Now to my question: Is my workspace built correctly? If not, how can i do that? Or do you know how i can fix "catkin_make" must be invoked in the root of workspace problem? And yeah i tried to (re)install the whole system, and nothing changed. Thanks in advance

gtest not found by Catkin

$
0
0
Hi all, Since yesterday none of my packages containin tests build. Catkin complains it cannot find gtest when using catkin_add_gtests(), since GTEST_FOUND is FALSE. You can see this in the error msg below, with the custom output I added to my CMakeLists. Up to yesterday, GTEST_FOUND was TRUE when catkin_add_gtests() was called. This is the error I always get. In this case I'm trying to build a mockup package on a clean catkin workspace: Errors << silly_pkg:cmake /home/paco/catkin_ws2/logs/silly_pkg/build.cmake.002.log Not searching for unused variables given on the command line. Re-run cmake no build system arguments -- Using CATKIN_DEVEL_PREFIX: /home/paco/catkin_ws2/devel/.private/silly_pkg -- Using CMAKE_PREFIX_PATH: /home/paco/catkin_ws2/devel;/opt/ros/kinetic -- This workspace overlays: /home/paco/catkin_ws2/devel;/opt/ros/kinetic -- Using PYTHON_EXECUTABLE: /usr/bin/python -- Using Debian Python package layout -- Using empy: /usr/bin/empy -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/paco/catkin_ws2/build/silly_pkg/test_results -- Using Python nosetests: /usr/bin/nosetests-2.7 -- catkin 0.7.11 -- GTEST_FOUND: FALSE CMake Warning at /opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:149 (message): skipping gtest 'test_silly_pkg' in project 'silly_pkg' because gtest was not found Call Stack (most recent call first): /opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:79 (_catkin_add_executable_with_google_test) /opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:28 (_catkin_add_google_test) CMakeLists.txt:28 (catkin_add_gtest) CMake Error at /home/paco/catkin_ws2/src/silly_pkg/CMakeLists.txt:33 (target_link_libraries): Cannot specify link libraries for target "test_silly_pkg" which is not built by this project. -- Configuring incomplete, errors occurred! See also "/home/paco/catkin_ws2/build/silly_pkg/CMakeFiles/CMakeOutput.log". See also "/home/paco/catkin_ws2/build/silly_pkg/CMakeFiles/CMakeError.log". cd /home/paco/catkin_ws2/build/silly_pkg; catkin build --get-env silly_pkg | catkin env -si /usr/bin/cmake /home/paco/catkin_ws2/src/silly_pkg --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/paco/catkin_ws2/devel/.private/silly_pkg -DCMAKE_INSTALL_PREFIX=/home/paco/catkin_ws2/install; cd - I am using catkin 0.7.11, libgtest-dev 1.7.0 and cmake 3.5.1. I use ROS Kinetic with Ubuntu 16.04. The only thing I did yesterday was reinstalling ROS Kinetic, but the package versions are exactly the same. Did anybody have this problem? Do you have any ideas on what could be happening? Thank you very much, Paco

How to link `devel` directory for using library with pre-made custom library.

$
0
0
Hello, ROS experts. I referenced below two link. - [link1](https://answers.ros.org/question/231199/using-catkin-to-install-pre-made-libraries/) - [link2](https://github.com/ros-drivers/prosilica_gige_sdk/blob/32aea9be0de7e40c647166d5f54de09948635b9f/CMakeLists.txt#L149) On my project, there are two packages. For our convenience, I'll call these A and B project. - A project: This project have a general library, a pre-made library. (there are two library) - B project: This project will use two library from A project. --> There project placed on same catkin_workspace. > The problem is that I can't not use **pre-made library** on **B project**. detail: I succeed it to install the pre-made library on `catkin_ws/devel/lib`. But, when I build the project B, It can not find pre-made library. How can I fix this issue? There is more detail on below description. --- ProjectA, CMakeLists.txt find_library(PreMade NAMES "caffe" PATHS "${PreMade_DIR}") message(STATUS "${PreMade}") find_package(catkin REQUIRED COMPONENTS roscpp roslib std_msgs interface_model ) catkin_package( CATKIN_DEPENDS roscpp std_msgs LIBRARIES ${PROJECT_NAME}_lib PreMade INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/include ${PreMade_INCLUDEDIR} ) ... add_library(PreMade EXCLUDE_FROM_ALL ${PreMade} ) add_custom_command(TARGET PreMade POST_BUILD COMMAND cp ${PreMade} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/ ) set_target_properties(PreMade PROPERTIES LINKER_LANGUAGE CXX ``` ) install( FILES ${PreMade} DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}) ProjectA, CMakeLists.txt find_package(catkin REQUIRED COMPONENTS roscpp std_msgs ProjectA ) ... add_executable(${PROJECT_NAME}_node ${SOURCES}) target_link_libraries(${PROJECT_NAME}_node ${catkin_LIBRARIES} ${OpenCV_LIBRARIES} PreMade ) --- **Build Log**(Catkin_make) -- Configuring done -- Generating done -- Build files have been written to: /catkin_ws/build #### #### Running command: "make -j8 -l8" in "/catkin_ws/build" #### [ 6%] Built target Caffe [ 26%] Built target interface_model_lib [ 40%] Built target refine_det_lib [ 93%] Linking CXX executable /catkin_ws/devel/lib/ProjectB/ProjectB_node /usr/bin/ld: cannot find -lProejctA_premade_lib collect2: error: ld returned 1 exit status ProjectB/CMakeFiles/ProjectB_node.dir/build.make:199: recipe for target '/catkin_ws/devel/lib/ProjectB/ProjectB_node' failed make[2]: *** [/catkin_ws/devel/lib/ProjectB/ProjectB_node] Error 1 CMakeFiles/Makefile2:1536: recipe for target 'ProjectB/CMakeFiles/ProjectB_node.dir/all' failed make[1]: *** [ProjectB/CMakeFiles/ProjectB_node.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j8 -l8" failed --- * In catkin_ws/devel/lib - [ProjectB] - libGeneralForProejctA.so - libPremade.so

Run-time dependencies.

$
0
0
Could anyone clarify for me please what packages should be specified as run-time dependencies defined in `package.xml` via `` or ``? How do they differ from build dependencies(sure, they are required at the runtime but what does it mean)? Good example is appreciated,

how can I use the Xenomai functions in ROS?

$
0
0
Hi there, I trying to use Xenomai functions in a C++ file in a ROS(1) package. The hardware plataform used is a Raspberry Pi 3 The goal is to create a Xenomai task with ROS functions inside. As a entry point, I download the example from Xenomai website. The makefile for a simple task program, outside catkin workspace, is: SKIN=alchemy MAIN_SRC=ex01 TARGET=ex01 LM=-lm CFLAGS := $(shell xeno-config --skin=alchemy --cflags) LDFLAGS := $(LM) $(shell xeno-config --skin=alchemy --ldflags) CC := $(shell xeno-config --cc) $(TARGET): $(MAIN_SRC).c $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) The `xeno-config --skin=alchemy --cflags` returns `arm-linux-gnueabihf-gcc`. In the catkin workspace I create a simple package named `beginner_tutorials` based in the example from: http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29. The program files are located in "src" subdirectory from package: talker.cpp and listener.cpp. In this sources was added the Xenomai include files to use its functions. In "CMakeLists.txt" located in "beginner_tutorials", was added this commands to make possible compile and link the Xenomai lib to my executable: execute_process(COMMAND xeno-config --skin=alchemy --cflags OUTPUT_VARIABLE XENO_CFLAGS) execute_process(COMMAND xeno-config --skin=alchemy --ldflags OUTPUT_VARIABLE XENO_LDFLAGS) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${XENO_CFLAGS}") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${XENO_LDFLAGS}") add_executable(talker src/talker.cpp) target_link_libraries(talker ${catkin_LIBRARIES}) add_executable(listener src/listener.cpp) target_link_libraries(listener ${catkin_LIBRARIES}) message(STATUS "C COMPILER") # too see compiler and used and flags message(STATUS ${CMAKE_CXX_COMPILER}) message(STATUS "XENOMAI CFLAGS") message(STATUS ${XENO_CFLAGS}) message(STATUS "XENOMAI LDFLAGS") message(STATUS ${XENO_LDFLAGS}) When I go to "~/catkin_ws" and tip `catkin_make`, the results are as folow: Base path: /root/catkin_ws Source space: /root/catkin_ws/src Build space: /root/catkin_ws/build Devel space: /root/catkin_ws/devel Install space: /root/catkin_ws/install #### #### Running command: "make cmake_check_build_system" in "/root/catkin_ws/build" #### -- Using CATKIN_DEVEL_PREFIX: /root/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic -- This workspace overlays: /opt/ros/kinetic -- Using PYTHON_EXECUTABLE: /usr/bin/python -- Using Debian Python package layout -- Using empy: /usr/bin/empy -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /root/catkin_ws/build/test_results -- Found gmock sources under '/usr/src/gmock': gmock will be built -- Found gtest sources under '/usr/src/gmock': gtests will be built -- Using Python nosetests: /usr/bin/nosetests-2.7 -- catkin 0.7.11 -- BUILD_SHARED_LIBS is on -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ~~ traversing 1 packages in topological order: -- ~~ - beginner_tutorials -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- +++ processing catkin package: 'beginner_tutorials' -- ==> add_subdirectory(beginner_tutorials) -- C COMPILER -- /usr/bin/c++ -- XENOMAI CFLAGS -- -I/usr/xenomai/include/cobalt -I/usr/xenomai/include -march=armv7-a -mfloat-abi=hard -mfpu=neon -ffast-math -D_GNU_SOURCE -D_REENTRANT -D__COBALT__ -I/usr/xenomai/include/alchemy -- XENOMAI LDFLAGS -- -Wl,--no-as-needed -Wl,@/usr/xenomai/lib/modechk.wrappers -lalchemy -lcopperplate /usr/xenomai/lib/xenomai/bootstrap.o -Wl,--wrap=main -Wl,--dynamic-list=/usr/xenomai/lib/dynlist.ld -L/usr/xenomai/lib -lcobalt -lmodechk -lpthread -lrt -- Configuring done -- Generating done -- Build files have been written to: /root/catkin_ws/build #### #### Running command: "make -j4 -l4" in "/root/catkin_ws/build" #### [ 50%] Linking CXX executable /root/catkin_ws/devel/lib/beginner_tutorials/listener [ 50%] Linking CXX executable /root/catkin_ws/devel/lib/beginner_tutorials/talker c++: fatal error: no input files compilation terminated. c++: fatal error: no input files compilation terminated. beginner_tutorials/CMakeFiles/listener.dir/build.make:115: recipe for target '/root/catkin_ws/devel/lib/beginner_tutorials/listener' failed make[2]: *** [/root/catkin_ws/devel/lib/beginner_tutorials/listener] Error 4 CMakeFiles/Makefile2:946: recipe for target 'beginner_tutorials/CMakeFiles/listener.dir/all' failed make[1]: *** [beginner_tutorials/CMakeFiles/listener.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... beginner_tutorials/CMakeFiles/talker.dir/build.make:115: recipe for target '/root/catkin_ws/devel/lib/beginner_tutorials/talker' failed make[2]: *** [/root/catkin_ws/devel/lib/beginner_tutorials/talker] Error 4 CMakeFiles/Makefile2:909: recipe for target 'beginner_tutorials/CMakeFiles/talker.dir/all' failed make[1]: *** [beginner_tutorials/CMakeFiles/talker.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j4 -l4" failed From what I could understand, the catkin did not find the Xenomai files needed for linking. That's right? Another thing is that catkin uses g++ for compile, but this is a problem? What I can do to solve this? Thanks.
Viewing all 670 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>