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

frpunzalan's profile - activity

2022-12-21 15:42:38 -0500 received badge  Nice Question (source)
2022-08-26 09:17:07 -0500 received badge  Famous Question (source)
2021-06-16 13:28:41 -0500 received badge  Student (source)
2021-06-16 13:26:45 -0500 received badge  Notable Question (source)
2021-06-16 13:26:45 -0500 received badge  Popular Question (source)
2021-02-17 01:18:42 -0500 commented question Rostest not showing existing failures and errors

Same issue here. Running both catkin runtests and rostest both says SUCCESS but looking at the rosunit xml result shows

2021-02-17 01:18:32 -0500 commented question Rostest not showing existing failures and errors

Same issue here. Running both catkin runtests and rostest both says SUCCESS but looking at the rosunit xml result shows

2021-02-17 01:12:48 -0500 commented question Rostest not showing existing failures and errors

Same issue here. Running both catkin runtests and rostest both says SUCCESS but looking at the rosunit xml result shows

2021-02-17 01:12:48 -0500 received badge  Commentator
2021-02-03 20:14:08 -0500 asked a question creating publisher in private nodehandle gives bad_alloc error

creating publisher in private nodehandle gives bad_alloc error Hi everyone, I encountered a weird error while using a pr

2020-08-31 13:49:33 -0500 received badge  Famous Question (source)
2020-08-31 13:49:33 -0500 received badge  Notable Question (source)
2020-03-27 14:15:48 -0500 received badge  Famous Question (source)
2020-03-23 22:09:02 -0500 answered a question ROS2 lifecycle node - how to shut down cleanly?

I am also looking for the answer to this question. Anyone has any idea to kill a node?

2020-03-23 10:24:48 -0500 received badge  Famous Question (source)
2020-03-23 10:24:48 -0500 received badge  Notable Question (source)
2020-03-10 23:32:40 -0500 commented answer Whats the proper way to use a proprietary software license according to ament_copyright?

@Dirk Thomas You are absolutely right. Thanks. I didn't notice it earlier but the default package created by ROS2 create

2020-03-10 22:39:51 -0500 commented answer Whats the proper way to use a proprietary software license according to ament_copyright?

@Dirk Thomas Can you give an example on how to exclude copyright linting in a python package. I was able to do it in a c

2020-02-06 19:13:01 -0500 received badge  Enthusiast
2020-02-05 00:31:33 -0500 edited question Using asio but link error in pthread

Using asio but link error in pthread Hi guys, I am trying to compile a simple UDP server in ROS 2. I am using the async

2020-02-05 00:28:30 -0500 commented question Using asio but link error in pthread

I got the error for undefined reference to 'main'. I put the main function inside a namespace declaration. sorry, newbi

2020-02-04 20:32:15 -0500 commented question Using asio but link error in pthread

@gvdhoorn Thanks for the reply. Would I still need to add the find_package(..) part even if the Asio library is all-hea

2020-02-04 20:24:26 -0500 received badge  Popular Question (source)
2020-02-03 23:51:40 -0500 received badge  Supporter (source)
2020-02-03 22:39:05 -0500 asked a question Using asio but link error in pthread

Using asio but link error in pthread Hi guys, I am trying to compile a simple UDP server in ROS 2. I am using the async

2020-01-30 08:35:12 -0500 received badge  Notable Question (source)
2020-01-08 19:35:26 -0500 marked best answer [ROS2] correct way to link to created library in gtest

Hi,

I am trying to create some sample unit tests for the package library I am creating. It looks like the library is being created but I get an undefined reference error. it looks like the test code couldn't link to the library.

CMakeFiles/configurator-test.dir/test/test_configurator.cpp.o: In function `ConfiguratorTest::SetUp()':
test_configurator.cpp:(.text._ZN16ConfiguratorTest5SetUpEv[_ZN16ConfiguratorTest5SetUpEv]+0x35): undefined reference to `object_analysis::Configurator::Configurator()'
CMakeFiles/configurator-test.dir/test/test_configurator.cpp.o: In function `ConfiguratorTest::TearDown()':
test_configurator.cpp:(.text._ZN16ConfiguratorTest8TearDownEv[_ZN16ConfiguratorTest8TearDownEv]+0x3b): undefined reference to `object_analysis::Configurator::~Configurator()'
CMakeFiles/configurator-test.dir/test/test_configurator.cpp.o: In function `ConfiguratorTest::MatchString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
test_configurator.cpp:(.text._ZN16ConfiguratorTest11MatchStringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN16ConfiguratorTest11MatchStringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x33): undefined reference to `object_analysis::Configurator::get_string[abi:cxx11]()'
collect2: error: ld returned 1 exit status

I have a near empty class that has a function that returns a string and a test that checks the value of the returned string. The cmakelist file and package file are shown below:

CMakeList

cmake_minimum_required(VERSION 3.5)
project(configurator)

# 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(rclcpp REQUIRED)

include_directories(include)

set(CONFIGURATOR_LIB_SRC
    src/configurator.cpp
)

set(CONFIGURATOR_LIB_HEADERS
    include/configurator/configurator.hpp)

add_library(
${PROJECT_NAME} SHARED
        ${CONFIGURATOR_LIB_SRC}
        ${CONFIGURATOR_LIB_HEADERS}
)

add_executable(configurator_node src/configurator_node.cpp)
target_include_directories(configurator_node PUBLIC
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  $<INSTALL_INTERFACE:include>)

install(TARGETS configurator_node
  EXPORT export_${PROJECT_NAME}
  DESTINATION lib/${PROJECT_NAME})

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  find_package(ament_cmake_gtest REQUIRED)

  # exclude some default linters from ament_lint
  list(APPEND AMENT_LINT_AUTO_EXCLUDE
    ament_cmake_uncrustify
  )
  list(APPEND AMENT_LINT_AUTO_EXCLUDE
    ament_cmake_copyright
  )
  ament_lint_auto_find_test_dependencies()

  # Add a gtest executables
  ament_add_gtest(${PROJECT_NAME}-test
    test/test_configurator.cpp
  )
  target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})

endif()  # BUILD_TESTING

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>configurator</name>
  <version>0.0.0</version>
  <description>TODO: Package description</description>
  <maintainer email="root@todo.todo">root</maintainer>
  <license>TODO: License declaration</license>

  <buildtool_depend>ament_cmake_auto</buildtool_depend>
  <depend>rclcpp</depend>

  <test_depend>ament_cmake</test_depend>
  <test_depend>ament_cmake_gtest</test_depend>
  <test_depend>ament_lint_auto</test_depend>
  <test_depend>rclcpp</test_depend>

  <export>
    <build_type>ament_cmake</build_type>
  </export>
</package>
2020-01-08 19:35:23 -0500 commented answer [ROS2] correct way to link to created library in gtest

thanks. i will use that when i link packages.

2020-01-08 19:34:13 -0500 received badge  Popular Question (source)
2020-01-08 03:48:04 -0500 commented question [ROS2] correct way to link to created library in gtest

My bad. I actually had a mistake in the code. Forgot to put namespace in the cpp file. Sorry about that. The linking see

2020-01-08 03:19:55 -0500 asked a question [ROS2] correct way to link to created library in gtest

[ROS2] correct way to link to created library in gtest Hi, I am trying to create some sample unit tests for the package

2020-01-08 03:01:05 -0500 marked best answer [ROS2] cmake can't find ament_gtest

I am trying to create a new package and some unit tests for that package. In the cmake option, I put the find_package(ament_gtest REQUIRED) line to make sure that the system can use gtest. However, it looks like cmake can't find the ament_gtest package and I am getting the following error

--- stderr: configurator
CMake Error at CMakeLists.txt:43 (find_package):
  By not providing "Findament_gtest.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "ament_gtest", but CMake did not find one.

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

    ament_gtestConfig.cmake
    ament_gtest-config.cmake

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

the cmakelist file that i use is the following

cmake_minimum_required(VERSION 3.5)
project(configurator)

# 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)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)

add_executable(configurator_node src/configurator_node.cpp)
target_include_directories(configurator_node PUBLIC
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  $<INSTALL_INTERFACE:include>)

install(TARGETS configurator_node
  EXPORT export_${PROJECT_NAME}
  DESTINATION lib/${PROJECT_NAME})

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

  find_package(ament_gtest REQUIRED)

  # Add a gtest executables
  ament_add_gtest(${PROJECT_NAME}-test
    test/test_configurator.cpp
  )
  if(TARGET ${PROJECT_NAME}-test)
    target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
  endif()

endif() # BUILD_TESTING

ament_package()

Edit:

Here is my package.xml file

<?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>configurator</name>
  <version>0.0.0</version>
  <description>TODO: Package description</description>
  <maintainer email="root@todo.todo">root</maintainer>
  <license>TODO: License declaration</license>

  <buildtool_depend>ament_cmake</buildtool_depend>

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

  <export>
    <build_type>ament_cmake</build_type>
  </export>
</package>
2020-01-08 03:01:05 -0500 received badge  Scholar (source)
2020-01-08 03:01:01 -0500 commented answer [ROS2] cmake can't find ament_gtest

sorry I was a bit slow to pick up what your original answer meant. It now works if I change the name in the CMakeList.

2020-01-08 02:55:46 -0500 received badge  Popular Question (source)
2020-01-07 19:30:08 -0500 received badge  Organizer (source)
2020-01-07 19:23:13 -0500 edited answer [ROS2] cmake can't find ament_gtest

Hi @marguedas, thanks for the quick reply. I also thought it was the package file but I already put the ament_cmake_gtes

2020-01-07 19:23:13 -0500 received badge  Editor
2020-01-07 19:23:03 -0500 edited question [ROS2] cmake can't find ament_gtest

[ROS2] cmake can't find ament_gtest I am trying to create a new package and some unit tests for that package. In the cma

2020-01-07 19:16:21 -0500 answered a question [ROS2] cmake can't find ament_gtest

Hi @marguedas, thanks for the quick reply. I also thought it was the package file but I already put the ament_cmake_gtes

2020-01-07 19:16:21 -0500 received badge  Rapid Responder
2020-01-07 04:22:38 -0500 asked a question cmake can't find ament_gtest package

cmake can't find ament_gtest package I am trying to create a new package and some unit tests for that package. In the cm

2020-01-07 04:22:37 -0500 asked a question [ROS2] cmake can't find ament_gtest

[ROS2] cmake can't find ament_gtest I am trying to create a new package and some unit tests for that package. In the cma