Ask Your Question
0

rosserial_arduino Create custom messages from custom messages

asked 2015-01-12 15:54:05 -0500

pnyholm gravatar image

updated 2015-01-13 15:16:55 -0500

I have a messages package that defines several custom messages based on ROS messages. I then have messages that use my custom messages to make other message types. For example:

# Base.msg
float64 data

And then I use Base to make another message type

# BaseVector.msg
Base[] vector_of_data

I find that when I run

$ rosrun rosserial_arduino make_libraries .

Headers cannot be made for messages that are made of custom messages, like BaseVector.msg. I get the following error:

*** Warning, failed to generate libraries for the following packages: ***
    my_custom_messages

Can this problem be fixed or do I need to remake all my messages without using custom messages to define them?

Thank you for your help!

EDIT: My message package CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(relative_nav_msgs)

find_package(catkin REQUIRED COMPONENTS std_msgs sensor_msgs geometry_msgs nav_msgs message_generation)

## Generate messages in the 'msg' folder
add_message_files(
  FILES
  FilterState.msg
  DesiredVector.msg
  DesiredState.msg
  Edge.msg
  NodeInfo.msg
  VOUpdate.msg
  Keyframe.msg
  Command.msg
  Waypoint.msg
  Path.msg
  Voltage.msg
  Goal.msg

#Optional
  DEBUG_Controller.msg
  Snapshot.msg
)

## Generate added messages and services with any dependencies listed here
generate_messages(
  DEPENDENCIES
  std_msgs
  sensor_msgs
  geometry_msgs
  nav_msgs
)

catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES relative_nav_msgs
#  CATKIN_DEPENDS geometry_msgs nav_msgs std_msgs
#  DEPENDS system_lib
)

include_directories(
  ${catkin_INCLUDE_DIRS}
)
edit retag flag offensive close merge delete

Comments

Could you please post your CMake file?

allenh1 gravatar imageallenh1 ( 2015-01-12 18:29:05 -0500 )edit

I edited the original post to include the CMake file

pnyholm gravatar imagepnyholm ( 2015-01-13 15:16:12 -0500 )edit

What happen if you try at first to compile only with Base.msg and if everything ok then try to make the vector???

Andromeda gravatar imageAndromeda ( 2015-01-13 15:50:59 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-01-14 10:34:49 -0500

pnyholm gravatar image

It turns out that I was chasing down the wrong problem. After further investigation it appears that headers are being properly constructed for custom messages based on custom messages. My problem was that one of the messages (that happened to be one of these kind of messages) was not in the CMakeLists.txt and so was not being processed by catkin_make. When make_libraries was being called, it couldn't find the appropriate catkin generated files.

Thank you for your comments and suggestions, especially @allenh1 for pointing me to the CMake file.

edit flag offensive delete link more
0

answered 2015-01-13 14:44:26 -0500

Wolf gravatar image

you need to run

rosrun rosserial_arduino make_libraries .

rather than rosserial_client

edit flag offensive delete link more

Comments

1

rosserial_arduino seems to have the same problem, I modified the original post to incorporate your correction

pnyholm gravatar imagepnyholm ( 2015-01-13 15:08:33 -0500 )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

1 follower

Stats

Asked: 2015-01-12 15:54:05 -0500

Seen: 1,149 times

Last updated: Jan 14 '15