Message Types Case Sensitve?
Are message types or names in ROS supposed to be case sensitive? That is, are uint64 and Uint64 the same or different? Are Std_Msgs and std_msgs the same or different? Thank you.
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Are message types or names in ROS supposed to be case sensitive? That is, are uint64 and Uint64 the same or different? Are Std_Msgs and std_msgs the same or different? Thank you.
Message types and package names are case sensitive in both C++ and Python in ROS, so each of the examples you give will be different. If you try to use different cases, you will get compile errors in C++ (saying it can't find the header file you're trying to include) and import errors in Python, so it won't let you get very far using a different case.
EDIT: As a summary of the comment thread, there is a difference between the message types (e.g. UInt64.msg) and the primitive types that define the data attributes on those messages (e.g. uint64). It is indicated on the documentation for the std_msgs package that those messages are not intended for long-term use, since they each name their data attributes "data", and that it is better to define your own with more descriptive names for the data stored on the message. It seems the std_msgs messages are more intended to show what primitive data types are available, and how to include them in your own message definitions.
That was my first belief. And if we look at the package names, this may hold because all of them are in lowercase chars, such as geometry_msgs.However, while the msg files are in First letter cap, or camel case, the specification is all in lowercase. Example Uint64.msg but uint64 in format specs.
When will you use the UInt64.msg? All I have seen are uint64 declaring field types? Maybe, we could use the UInt64 msg directly in some connections. It just makes me wonder, and confused, that all packages I saw would still create a userMessage defining one field of primitive type, tho name not data
It says in the documentation for std_msgs that those messages are not intended for long-term use. I suspect they are intended to show you which primitive types are available and how to build up your own messages from them.
@aconkey: std_msgs
is not really 'an example'. You cannot publish primitive types, so they need to be wrapped in a msg. If you do that, you get std_msgs
. The remark about it being better to design your own msgs is about semantics: if you see a topic that carries a UInt64
, can you tell ..
.. me what the data it carries means? I'm pretty sure your first question would be: "well, what does the uint64
encode?". And that is exactly the problem. Without asking the author, reading documentation or code, you wouldn't know.
Semantically meaningful msgs try to address this, as the ..
.. msg itself contains msg fields with descriptive names that on their own give you enough information to be able to interpret it.
That is obviously the idea, whether it always works is something else, but you'll at least stand a better chance with a proper msg than with a UInt64
.
This is a programming language question as opposed to ROS question. Both C/C++ and Python are case sensitive, therefore messages types are as well.
That was my first belief. And if we look at the package names, this may hold because all of them are in lowercase chars, such as geometry_msgs.However, while the msg files are in First letter cap, or camel case, the specification is all in lowercase. Example Uint64.msg but uint64 in format specs.
Asked: 2018-06-29 06:56:27 -0600
Seen: 393 times
Last updated: Jun 29 '18
Best toolchain for recording kinect data and converting to pointcloud offline?
how to bind a callback to include a MessageEvent [closed]
Proper source of xncore for compiling svn opencv with openni support?
ROS support for industrial robotic arms?
When should I use topics vs services vs actionlib actions (vs dynamic_reconfigure)?
Significance of ros::spinOnce()
How to put Hokuyo laser sensor on p2os?