Ask Your Question
0

CMake error in ROS2

asked 2018-05-02 06:29:12 -0500

aks gravatar image

updated 2018-05-02 06:36:37 -0500

I am trying to create a ROS2 package from scratch, named testpackagecpp and have this CMakeLists.txt :

cmake_minimum_required(VERSION 2.8.3)

project(testpackagecpp)

if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra")
endif()

find_package(ament_cmake REQUIRED)
find_package(example_interfaces REQUIRED)
find_package(rcl REQUIRED)
find_package(rmw REQUIRED)
#find_package(rmw_implementation REQUIRED)
#force opensplice implementation
find_package(rmw_opensplice_cpp REQUIRED)
#find_package(rmw_fastrtps_cpp REQUIRED)

ament_package()

and this as the package.xml file :

<?xml version="1.0"?>
<package format="2">
<name>testpackagecpp</name>
<version>0.0.0</version>
<description>Package containing examples of how to use the rcl API.</description>
<maintainer email="ahcorde@erlerobot.org">Alejandro Hernandez</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<buildtool_depend>rosidl_default_generators</buildtool_depend>

<build_depend>example_interfaces</build_depend>
<build_depend>rcl</build_depend>
<build_depend>rmw_implementation</build_depend>

<exec_depend>example_interfaces</exec_depend>
<exec_depend>rcl</exec_depend>
<exec_depend>rmw_implementation</exec_depend>
<exec_depend>rosidl_default_runtime</exec_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>

When I try to build this using ament build --symlink-install --only-package testpackagecpp, I get an error as "NOT" "element" "IN_LIST" "rcl_RECURSIVE_DEPENDENCIES". error

Any Idea where am I going wrong ?

edit retag flag offensive close merge delete

Comments

2

Please don't use an image to display text. Images are not searchable and people cannot copy and paste the text from the image. Please update your question with a copy and paste of the error. See our support guidelines

jayess gravatar imagejayess ( 2018-05-02 11:11:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-05-02 10:18:39 -0500

Karsten gravatar image

I believe CMake 3.5 is required. You are currently using 2.8.3

edit flag offensive delete link more

Comments

@aakash_sehgal were you following this wiki page? It incorrectly listed 2.8.3 as the ros2 minimum, which I've updated now. If you saw it somewhere else, please let us know so we can try to correct it there also.

dhood gravatar imagedhood ( 2018-05-02 15:57:50 -0500 )edit

I took it from this source. Does it mean replacing 2.8.3 with 3.5 will do the trick ?

aks gravatar imageaks ( 2018-05-04 05:41:40 -0500 )edit

Yes it should do the trick. Feel free to mark the issue as resolved if it works for you or to update your question if changing the minimum CMake version didnt fix your problem

marguedas gravatar imagemarguedas ( 2018-05-07 18:06:01 -0500 )edit

@marguedas@Karsten this definitely does the trick but when i try to run the package it says no executable found. strange as it is building.

aks gravatar imageaks ( 2018-05-14 04:37:28 -0500 )edit

From the extract of your CMakeLists.txt it is not visible which executable you are trying to create and install. You can have a look at the examples repo for some code snippets: https://github.com/ros2/examples/blob...

Karsten gravatar imageKarsten ( 2018-05-14 10:16:02 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-05-02 06:29:12 -0500

Seen: 399 times

Last updated: May 02 '18