Ask Your Question

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


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



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

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
#  catkin_add_nosetests(test/

#find_package(catkin REQUIRED COMPONENTS
#  sensor_msgs
#  rostest
#  tf2_ros
#  tf2
#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)

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


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

Your Answer

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

Add Answer

Question Tools



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

Seen: 22 times

Last updated: Jan 12