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

ROS message subfolder

asked 2017-01-31 09:25:59 -0500

inspire gravatar image

updated 2017-03-18 08:15:33 -0500

130s gravatar image

Hi, I noticed that ROS does not correctly see message files in subfolders of the "msg" folder. The add_message_files command can take a DIRECTORY command which works partly:

add_message_files(
  DIRECTORY
  msg/subfolder1
  FILES
  testmessage.msg
)

Both catkin_make_isolated and catkin build run perfectly but after a source devel/setup.bash, the rosmsg list command does not show this testmessage. If I change the subfolder name to something different in the CMakeLists file, cmake complaints about the missing path. Hence, the folder path is recognized partly.

The only solution I found was to move all message files out of subfolders such they are directly placed at e.g., msg/testmessage.msg. Then, the rosmsg list command shows the message.

Is there another way to use subfolders for message definitions?

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2017-03-18 08:14:27 -0500

130s gravatar image

updated 2017-03-18 08:49:16 -0500

I confirmed this (my code, which modifies beginner_tutorial to add a new msg file "Num5.msg" in a sub folder). Although msg artifact is generated, the new msg doesn't appear in rosmsg list. Used catkin_make. I can, however, use the new message Num5.msg in my ROS program. E.g. rostopic pub Num5 beginner_tutorials/Num5 1 then subscribing to it can be done without problem.

More concrete commands and result:

roscd beginner_tutorials/msg
mkdir subfolder
(edit CMakeLists.txt to add subfolder to `add_message_files`)
echo "int64 num" > subfolder/Num2.msg
cd -
catkin_make
source devel/setup.bash

Then,

find ./devel -iname *Num2*    --> Generated.
rosmsg list|grep Num          --> Num2 not listed.
rostopic pub Num2 beginner_tutorials/Num2 1    --> Published.
rostopic echo /Num2    --> Printed as expected.

So maybe a specific issue with rosmsg list.

$ apt-cache policy ros-kinetic-catkin ros-kinetic-rosmsg   |grep Inst 
  Installed: 0.7.6-0xenial-20170217-212821-0800
  Installed: 1.12.7-0xenial-20170308-194441-0800
edit flag offensive delete link more

Comments

130s gravatar image 130s  ( 2017-03-18 08:50:24 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-01-31 09:25:59 -0500

Seen: 1,788 times

Last updated: Mar 18 '17