Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Cannot build custom action ROS2

I am following this answer https://answers.ros.org/question/323429/how-to-create-custom-action-interface-definition-in-ros2/ in order to create a pkg for a custom action. My package looks like this:

action_interface
      action
            PlanAid.action
      CMakeLists.txt
      package.xml

My files are: PlanAid.action

#goal definition
string request
string problem
 ---
#result definition
string data
string event
---
#feedback
string feedback

CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)

project(action_interface)

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  # we dont use add_compile_options with pedantic in message packages
  # because the Python C extensions dont comply with it
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
endif()

find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)
find_package(action_msgs REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
  action/PlanAid.action
  DEPENDENCIES std_msgs action_msgs
)

ament_export_dependencies(rosidl_default_runtime)
ament_package()

package.xml:

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>action_interface</name>
  <version>0.0.1</version>
  <description>ros action custom action interface</description>
  <maintainer email="skanda.naglapur-ramamurthy@man.eu">Skanda Naglapur Ramamurthy</maintainer>
  <license>MIT</license>

  <buildtool_depend>ament_cmake</buildtool_depend>
  <buildtool_depend>rosidl_default_generators</buildtool_depend>

  <build_depend>std_msgs</build_depend>
  <build_depend>action_msgs</build_depend>

  <exec_depend>rosidl_default_runtime</exec_depend>
  <exec_depend>std_msgs</exec_depend>
  <exec_depend>action_msgs</exec_depend>

  <member_of_group>rosidl_interface_packages</member_of_group>

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

And I am having the following error when colcon build --symlink-install

[Processing: action_interface]                                     
--- stderr: action_interface                                         
/usr/bin/ld: /usr/local/lib/libpython3.6m.a(ceval.o): relocation R_X86_64_PC32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [rosidl_generator_py/action_interface/libaction_interface__python.so] Error 1
make[1]: *** [CMakeFiles/action_interface__python.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< action_interface   [ Exited with code 2 ]

Cannot build custom action ROS2

I am following this answer https://answers.ros.org/question/323429/how-to-create-custom-action-interface-definition-in-ros2/ in order to create a pkg for a custom action. My package looks like this:

action_interface
      action
            PlanAid.action
      CMakeLists.txt
      package.xml

My files are: PlanAid.action

#goal definition
string request
string problem
 ---
#result definition
string data
string event
---
#feedback
string feedback

CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)

project(action_interface)

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  # we dont use add_compile_options with pedantic in message packages
  # because the Python C extensions dont comply with it
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
endif()

find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)
find_package(action_msgs REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
  action/PlanAid.action
  DEPENDENCIES std_msgs action_msgs
)

ament_export_dependencies(rosidl_default_runtime)
ament_package()

package.xml:

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>action_interface</name>
  <version>0.0.1</version>
  <description>ros action custom action interface</description>
  <maintainer email="skanda.naglapur-ramamurthy@man.eu">Skanda Naglapur Ramamurthy</maintainer>
  <license>MIT</license>

  <buildtool_depend>ament_cmake</buildtool_depend>
  <buildtool_depend>rosidl_default_generators</buildtool_depend>

  <build_depend>std_msgs</build_depend>
  <build_depend>action_msgs</build_depend>

  <exec_depend>rosidl_default_runtime</exec_depend>
  <exec_depend>std_msgs</exec_depend>
  <exec_depend>action_msgs</exec_depend>

  <member_of_group>rosidl_interface_packages</member_of_group>

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

And I am having the following error when colcon build --symlink-install

[Processing: action_interface]                                     
--- stderr: action_interface                                         
/usr/bin/ld: /usr/local/lib/libpython3.6m.a(ceval.o): relocation R_X86_64_PC32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [rosidl_generator_py/action_interface/libaction_interface__python.so] Error 1
make[1]: *** [CMakeFiles/action_interface__python.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< action_interface   [ Exited with code 2 ]

Cannot build custom action ROS2

I am following this answer https://answers.ros.org/question/323429/how-to-create-custom-action-interface-definition-in-ros2/ in order to create a pkg for a custom action. My package looks like this:

 action_interface
      action
            PlanAid.action
      CMakeLists.txt
      package.xml

My files are: PlanAid.action

#goal definition
string request
string problem
 ---
#result definition
string data
string event
---
#feedback
string feedback

CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)

project(action_interface)

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  # we dont use add_compile_options with pedantic in message packages
  # because the Python C extensions dont comply with it
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
endif()

find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)
find_package(action_msgs REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
  action/PlanAid.action
  DEPENDENCIES std_msgs action_msgs
)

ament_export_dependencies(rosidl_default_runtime)
ament_package()

package.xml:

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>action_interface</name>
  <version>0.0.1</version>
  <description>ros action custom action interface</description>
  <maintainer email="skanda.naglapur-ramamurthy@man.eu">Skanda Naglapur Ramamurthy</maintainer>
  <license>MIT</license>

  <buildtool_depend>ament_cmake</buildtool_depend>
  <buildtool_depend>rosidl_default_generators</buildtool_depend>

  <build_depend>std_msgs</build_depend>
  <build_depend>action_msgs</build_depend>

  <exec_depend>rosidl_default_runtime</exec_depend>
  <exec_depend>std_msgs</exec_depend>
  <exec_depend>action_msgs</exec_depend>

  <member_of_group>rosidl_interface_packages</member_of_group>

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

And I am having the following error when colcon build --symlink-install

[Processing: action_interface]                                     
--- stderr: action_interface                                         
/usr/bin/ld: /usr/local/lib/libpython3.6m.a(ceval.o): relocation R_X86_64_PC32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [rosidl_generator_py/action_interface/libaction_interface__python.so] Error 1
make[1]: *** [CMakeFiles/action_interface__python.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< action_interface   [ Exited with code 2 ]

Cannot build custom action ROS2

I am following this answer https://answers.ros.org/question/323429/how-to-create-custom-action-interface-definition-in-ros2/ in order to create a pkg for a custom action. action. My system is Ubuntu 18.04 with ROS2 dashing. My package looks like this:

 action_interface
      action
            PlanAid.action
      CMakeLists.txt
      package.xml

My files are: PlanAid.action

#goal definition
string request
string problem
 ---
#result definition
string data
string event
---
#feedback
string feedback

CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)

project(action_interface)

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  # we dont use add_compile_options with pedantic in message packages
  # because the Python C extensions dont comply with it
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
endif()

find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)
find_package(action_msgs REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
  action/PlanAid.action
  DEPENDENCIES std_msgs action_msgs
)

ament_export_dependencies(rosidl_default_runtime)
ament_package()

package.xml:

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>action_interface</name>
  <version>0.0.1</version>
  <description>ros action custom action interface</description>
  <maintainer email="skanda.naglapur-ramamurthy@man.eu">Skanda Naglapur Ramamurthy</maintainer>
  <license>MIT</license>

  <buildtool_depend>ament_cmake</buildtool_depend>
  <buildtool_depend>rosidl_default_generators</buildtool_depend>

  <build_depend>std_msgs</build_depend>
  <build_depend>action_msgs</build_depend>

  <exec_depend>rosidl_default_runtime</exec_depend>
  <exec_depend>std_msgs</exec_depend>
  <exec_depend>action_msgs</exec_depend>

  <member_of_group>rosidl_interface_packages</member_of_group>

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

And I am having the following error when colcon build --symlink-install

[Processing: action_interface]                                     
--- stderr: action_interface                                         
/usr/bin/ld: /usr/local/lib/libpython3.6m.a(ceval.o): relocation R_X86_64_PC32 against symbol `_Py_NoneStruct' can CMake Error at CMakeLists.txt:15 (find_package):
  By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "ament_cmake", but CMake did not find one.

  Could not find a package configuration file provided by "ament_cmake" with
  any of the following names:

    ament_cmakeConfig.cmake
    ament_cmake-config.cmake

  Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
  "ament_cmake_DIR" to a directory containing one of the above files.  If
  "ament_cmake" provides a separate development package or SDK, be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [rosidl_generator_py/action_interface/libaction_interface__python.so] Error 1
make[1]: *** [CMakeFiles/action_interface__python.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< action_interface   [ Exited with code 2 ]
sure it
  has been installed.

Cannot build custom action ROS2

I am following this answer https://answers.ros.org/question/323429/how-to-create-custom-action-interface-definition-in-ros2/ in order to create a pkg for a custom action. My system is Ubuntu 18.04 with ROS2 dashing. My package looks like this:

 action_interface
      action
            PlanAid.action
      CMakeLists.txt
      package.xml

My files are: PlanAid.action

#goal definition
string request
string problem
 ---
#result definition
string data
string event
---
#feedback
string feedback

CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)

project(action_interface)

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  # we dont use add_compile_options with pedantic in message packages
  # because the Python C extensions dont comply with it
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
endif()

find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)
find_package(action_msgs REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
  action/PlanAid.action
  DEPENDENCIES std_msgs action_msgs
)

ament_export_dependencies(rosidl_default_runtime)
ament_package()

package.xml:

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>action_interface</name>
  <version>0.0.1</version>
  <description>ros action custom action interface</description>
  <maintainer email="skanda.naglapur-ramamurthy@man.eu">Skanda Naglapur Ramamurthy</maintainer>
  <license>MIT</license>

  <buildtool_depend>ament_cmake</buildtool_depend>
  <buildtool_depend>rosidl_default_generators</buildtool_depend>

  <build_depend>std_msgs</build_depend>
  <build_depend>action_msgs</build_depend>

  <exec_depend>rosidl_default_runtime</exec_depend>
  <exec_depend>std_msgs</exec_depend>
  <exec_depend>action_msgs</exec_depend>

  <member_of_group>rosidl_interface_packages</member_of_group>

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

And I am having the following error when colcon build --symlink-install

CMake Error at CMakeLists.txt:15 (find_package):
  By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "ament_cmake", but CMake did not find one.

  Could not find a package configuration file provided by "ament_cmake" with
  any of the following names:

    ament_cmakeConfig.cmake
    ament_cmake-config.cmake

  Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
  "ament_cmake_DIR" to a directory containing one of the above files.  If
  "ament_cmake" provides a separate development package or SDK, be sure it
  has been installed.

I have already tried solution in https://answers.ros.org/question/312557/ros-2-crystal-in-1604-fails-to-build-ros2_overlay_ws/ recomending to souce the local_setup.bash

Cannot build custom action ROS2

I am following this answer https://answers.ros.org/question/323429/how-to-create-custom-action-interface-definition-in-ros2/ in order to create a pkg for a custom action. My system is Ubuntu 18.04 with ROS2 dashing. My package looks like this:

 action_interface
      action
            PlanAid.action
      CMakeLists.txt
      package.xml

My files are: PlanAid.action

#goal definition
string request
string problem
 ---
#result definition
string data
string event
---
#feedback
string feedback

CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)

project(action_interface)

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  # we dont use add_compile_options with pedantic in message packages
  # because the Python C extensions dont comply with it
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
endif()

find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)
find_package(action_msgs REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
  action/PlanAid.action
  DEPENDENCIES std_msgs action_msgs
)

ament_export_dependencies(rosidl_default_runtime)
ament_package()

package.xml:

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>action_interface</name>
  <version>0.0.1</version>
  <description>ros action custom action interface</description>
  <maintainer email="skanda.naglapur-ramamurthy@man.eu">Skanda Naglapur Ramamurthy</maintainer>
  <license>MIT</license>

  <buildtool_depend>ament_cmake</buildtool_depend>
  <buildtool_depend>rosidl_default_generators</buildtool_depend>

  <build_depend>std_msgs</build_depend>
  <build_depend>action_msgs</build_depend>

  <exec_depend>rosidl_default_runtime</exec_depend>
  <exec_depend>std_msgs</exec_depend>
  <exec_depend>action_msgs</exec_depend>

  <member_of_group>rosidl_interface_packages</member_of_group>

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

And I am having the following error when colcon build --symlink-install

CMake     --- stderr: action_interface                               
    /home/developer/task-manager/ros2_ws/build/action_interface/rosidl_generator_py/action_interface/action/_plan_aid_s.c:11:10: fatal error: numpy/ndarrayobject.h: No such file or directory
     #include "numpy/ndarrayobject.h"
              ^~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    make[2]: *** [CMakeFiles/action_interface__python.dir/rosidl_generator_py/action_interface/action/_plan_aid_s.c.o] Error at CMakeLists.txt:15 (find_package):
  By 1
    make[1]: *** [CMakeFiles/action_interface__python.dir/all] Error 2
    make: *** [all] Error 2
    ---
    Failed   <<< action_interface   [ Exited with code 2 ]

    Summary: 2 packages finished [14.0s]
      1 package failed: action_interface
      1 package had stderr output: action_interface
      5 packages not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "ament_cmake", but CMake did not find one.

  Could not find a package configuration file provided by "ament_cmake" with
  any of the following names:

    ament_cmakeConfig.cmake
    ament_cmake-config.cmake

  Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
  "ament_cmake_DIR" to a directory containing one of the above files.  If
  "ament_cmake" provides a separate development package or SDK, be sure it
  has been installed.
processed

What is strange is that if I have already tried solution in https://answers.ros.org/question/312557/ros-2-crystal-in-1604-fails-to-build-ros2_overlay_ws/ recomending to souce the local_setup.bashconda deactivate it compiles