Ask Your Question
0

Question about custom-made message

asked 2019-11-11 08:02:34 -0600

kane_choigo gravatar image

updated 2019-11-11 08:02:56 -0600

Hello! I'm using ROS kinetic on ubuntu 16.04.

And I'm going to make my own message consisting of many sub-custom messages.

The sub-messages are in the right directory where any other messages are defined.

Below is a sample of the messages.

my_msgs/StateError          stateError              # error for state
my_msgs/EvalCovariance      evalCovariance          # validate covariance

and my_msgs is the name of the directory. (In other words, StateErrormessages and EvalCovariance messages are all in the my_msgs directory.)

In this case, is it mandatory to drop my_msgstags because they're all in the same directory?? (like this)

EvalCovariance      evalCovariance          # validate covariance
StateError          stateError              # error for state

Thanks in advance :)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-11-12 04:41:05 -0600

mali gravatar image

to define a message based on different messages (sub-messages) that are defined in same package you have two options:

  1. you drop the package name before these messages because the sub-messages are defined in same package
StateError         stateError
EvalCovariance     evalCovariance
  1. you indicate the package_name before these sub-messages (not the directory_name) :
package_name/StateError         stateError
package_name/EvalCovariance     evalCovariance

so, if my_msgs is your package_name, both samples you wrote in the question are valid. But, if my_msgs is just a directory_name then you need to use the second sample without attaching my_msgs/

edit flag offensive delete link more

Comments

Thank you so much for your short and clear advice. I really appreciate it.

kane_choigo gravatar imagekane_choigo ( 2019-11-12 18:01:46 -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

1 follower

Stats

Asked: 2019-11-11 08:02:34 -0600

Seen: 27 times

Last updated: Nov 12