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

Revision history [back]

The first error you are getting is because you have a misspelling. You declared the function as PyLong_AsSsize_t() instead of PyLong_AsSize_t(). You essentially added as extra s to when you declared the function.

The second says that your variable rtabmap_ros__module has an incomplete type, so there is more to the type name than just PyModuleDef maybe.

The first error you are getting is because you have a misspelling. You declared the function as PyLong_AsSsize_t() instead of PyLong_AsSize_t(). You essentially added as extra s to when you declared the function.

The second says that your variable rtabmap_ros__module has an incomplete type, so there is more to the type name than just PyModuleDef maybe.

I was able to get your code to run with the following

msg/Info.msg:

int32 node_id
string node_label

string frame_id

CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)
project(test_msgs)

# Default to C99
if(NOT CMAKE_C_STANDARD)
  set(CMAKE_C_STANDARD 99)
endif()

# 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")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(std_msgs REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)

set(msg_files
  "msg/Info.msg"
)

rosidl_generate_interfaces(${PROJECT_NAME}
  ${msg_files}
  DEPENDENCIES builtin_interfaces std_msgs
  ADD_LINTER_TESTS
)

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  ament_lint_auto_find_test_dependencies()
endif()

ament_package()

and 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>test_msgs</name>
  <version>0.0.0</version>
  <description>TODO: Package description</description>
  <maintainer email="some@email.com">zmk5</maintainer>
  <license>TODO: License declaration</license>

  <buildtool_depend>ament_cmake</buildtool_depend>

  <build_depend>std_msgs</build_depend>
  <build_depend>builtin_interfaces</build_depend>
  <build_depend>rosidl_default_generators</build_depend>

  <test_depend>ament_lint_auto</test_depend>
  <test_depend>ament_lint_common</test_depend>

  <exec_depend>std_msgs</exec_depend>
  <exec_depend>builtin_interfaces</exec_depend>
  <exec_depend>rosidl_default_runtime</exec_depend>

  <member_of_group>rosidl_interface_packages</member_of_group>

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