Ask Your Question
0

How to add custom message types in rosmatlab

asked 2014-03-10 04:19:34 -0500

bnm-rc gravatar image

updated 2014-03-12 23:49:50 -0500

Hi everyone,
what do I have to do to add custom message types for use with rosmatlab by TU Darmstadt?

I tried to add a new directory called msg in workspace/src/rosmatlab/rosmatlab and placed a file called Num.msg inside of it. But examining the appropriate CMakeLists.txt file, I noticed all message being included with the function add_mex_messages followed by the message name in paranthesis.

So does anybody know how to solve this?

[Edit 2014-03-12]
Okay I now created a new package outside of the rosmatlab workspace and defined a new message type there. Then I compiled it to make it accessible by the ROS system itself. Then I added a add_mex_messages() statement to the CMakeLists.txt in the rosmatlab workspace and a <build_depend /> tag in the package.xml to refer to that package containing the new message type. When I compiled the rosmatlab workspace with these settings everything went well, until cmake claimed a non-existent header file referred to by the C-MEX file of my message type. In fact the header file doesn't exist at all and I'm wondering why it hasn't been generated by rosmatlab or whatever if everything else has been generated. I'm sorry, if it is obvious to all of you, but it is neither documented nor obvious to me, so if anyone has anything to say about this topic, please let me know! Thanks in advance.

Greets,
Roberto

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-03-12 23:45:58 -0500

bnm-rc gravatar image

The problem was that when compiling the workspace, cmake first tried to build all mex-files. Also the mex files for the message types. Unfortunately, the message at that point wasn't compiled for ROS, thus not usable for the cpp_introspection routine.
Compiling a custom message type from another package accessible by ROS seemed to be a problem because of the paths. I didn't go too far into that.
All in all, I succeeded building my message type by first compiling the workspace without adding the add_mex_messages() statement for the message type be compiled in ROS and afterwards recompiling the workspace with the add_mex_messages() statement added.
Now everything works fine. One should change the order of building, but I am not very familiar with that.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-03-10 04:19:34 -0500

Seen: 804 times

Last updated: Mar 12 '14