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

ros custom message in custom folder [closed]

asked 2020-04-05 12:59:19 -0600

manuaatitya gravatar image

Hi guys, I have created a custom message and I wish to access it from a folder (not the default msg folder in the root directory).

When I build using catkin_make, I get a log that there is a message file within the directory but when I try to search for the message using rosmsg show the message file doesn't show up. (I have also sourced the setup.bash file before trying out the rosmsg command).

Any help to solve the problem is appreciated.

I have the following setup:

A folder named my_app in which there is a folder named msg

1) CMakeLists.txt:

cmake_minimum_required(VERSION 2.8.3)


find_package(catkin REQUIRED COMPONENTS roscpp message_generation )

include_directories( ${catkin_INCLUDE_DIRS} my_app )

add_message_files( DIRECTORY my_app/msg FILES test.msg )

catkin_package( CATKIN_DEPENDS roscpp message_runtime )

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by manuaatitya
close date 2020-04-08 12:37:01.472492

1 Answer

Sort by ยป oldest newest most voted

answered 2020-04-07 15:13:41 -0600

Weasfas gravatar image

updated 2020-04-07 15:13:58 -0600

Hi @manuaatitya,

Your CMake file is almost correct, you missed the generate_message task:


Also remember to add the dependency to your nodes later:

add_dependencies(my_node my_package_gencpp)
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-04-05 12:59:19 -0600

Seen: 488 times

Last updated: Apr 07 '20