Ask Your Question
0

Packages roscpp and std_msgs

asked 2019-09-22 14:02:56 -0500

gktg1514 gravatar image

updated 2019-09-22 15:41:29 -0500

gvdhoorn gravatar image

In tutorials of wikiros, roscpp, rospy and std_msgs become dependencies of our newly-created package. What I am wondering is what they provide for us.

  • For example, I am writing a node, and in this node, we create publisher and send messages to a topic. The messages are are in type of String.msg. In other words, by using std_msgs::String type, I define an msg variable and publish it via in the node. In this case, which dependency provide std_msgs::String type for us ?

Someone told me that all headers defined for messages are provided by roscpp. Dependency of std_msgs package takes role in creating a custom message. If you do not create user-defined message, you do not make std_msgs a dependency for your package. All the headers for the messages are given to you by roscpp.

Is this correct ? I cannot find a resource what these dependencies are for.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-09-22 15:45:04 -0500

gvdhoorn gravatar image

by using std_msgs::String type, I define an msg variable and publish it via in the node. In this case, which dependency provide std_msgs::String type for us ?

std_msgs::String is defined in a header part of the std_msgs package.

Someone told me that all headers defined for messages are provided by roscpp. Dependency of std_msgs package takes role in creating a custom message. If you do not create user-defined message, you do not make std_msgs a dependency for your package. All the headers for the messages are given to you by roscpp.

Is this correct ?

No. This is not correct.

For your example already we require std_msgs as a dependency, as that package provides the String message type.

It also provides a number of other message types, see the index.

roscpp itself (ie: the package) only provides a few services and messages, but those are not typically used as parts of other (ie: custom) messages. See the index again.

edit flag offensive delete link more

Comments

Thank you so much. I examined your "index" links; everything is senseful right now.

gktg1514 gravatar imagegktg1514 ( 2019-09-23 04:08:56 -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: 2019-09-22 14:02:56 -0500

Seen: 8 times

Last updated: Sep 22