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

Where is the binary of test_tf2_sensor_msgs ?

asked 2021-01-12 04:03:55 -0600

updated 2021-01-12 05:18:01 -0600

gvdhoorn gravatar image

The ROS package tf2_sensor_msgs (from the repo geometry2) comes with a test program

geometry2/tf2_sensor_msgs/test/test_tf2_sensor_msgs.cpp

I suppose this program can be built and executed by colcon test. It works from my docker machine:

root@9da72d8e03df:~/ros2_ws# colcon test --packages-select tf2_sensor_msgs
Starting >>> tf2_sensor_msgs
Finished <<< tf2_sensor_msgs [0.05s]

Question: Where is the binary generated from test_tf2_sensor_msgs.cpp? I would need to invoke the generated binary from the command line without using colcon directly.

edit retag flag offensive close merge delete

Comments

1

I've updated the title of your question, as you're not looking for "the generated binary of colcon test", but for test_tf2_sensor_msgs.

gvdhoorn gravatar image gvdhoorn  ( 2021-01-12 05:17:51 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-01-12 05:14:20 -0600

gvdhoorn gravatar image

updated 2021-01-12 05:17:04 -0600

I doubt that test is actually run, as tf2_sensor_msgs has everything related to testing commented out in its CMakeLists.txt (here):

# TODO enable tests
#if(BUILD_TESTING)
#  catkin_add_nosetests(test/test_tf2_sensor_msgs.py)

#find_package(catkin REQUIRED COMPONENTS
#  sensor_msgs
#  rostest
#  tf2_ros
#  tf2
#)
#include_directories(${EIGEN_INCLUDE_DIRS})
#add_executable(test_tf2_sensor_msgs_cpp EXCLUDE_FROM_ALL test/test_tf2_sensor_msgs.cpp)
#target_link_libraries(test_tf2_sensor_msgs_cpp ${catkin_LIBRARIES} ${GTEST_LIBRARIES})
#if(TARGET tests)
#  add_dependencies(tests test_tf2_sensor_msgs_cpp)
#endif()
#add_rostest(${CMAKE_CURRENT_SOURCE_DIR}/test/test.launch)
#endif()

tf2_geometry_msgs does have testing enabled, and its binary can be found in build/tf2_geometry_msgs/test_tf2_geometry_msgs (find /path/to/colcon_ws/build -executable -type f | grep test).

I suppose this program can be built and executed by colcon test. It works from my docker machine:

As far as I know, colcon test only runs tests, it does not build them.

That would be colcon build's job.

edit flag offensive delete link more

Comments

Just for the record, tf2_geometry_msgs and tf2_sensor_msgs are actually two different packages:-)

Zhoulai Fu gravatar image Zhoulai Fu  ( 2021-01-13 15:30:10 -0600 )edit

Yes, of course.

I was aware of that, but wanted to point you to a test which is being built and executed.

gvdhoorn gravatar image gvdhoorn  ( 2021-01-14 00:15:10 -0600 )edit

You will get an entry like that when it runs "all" tests for a package. If the number of tests is zero you'll still get progress that tests for that package started and finished. You can turn on more verbosity or look a the test results or reports to see what was actually run.

tfoote gravatar image tfoote  ( 2021-01-14 02:18:10 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2021-01-12 04:03:55 -0600

Seen: 134 times

Last updated: Jan 12 '21