This is starting to get more-and-more off-topic, but:
Afaik there is no documented best practice for this.
Users have always been encouraged to not use std_msgs/Int*
or std_msgs/String
, but to create semantically meaningful messages. A topic carrying a String
doesn’t tell you anything about what its intended use is, nor how the message should be interpreted (other than as a plain String
of course).
So usage of std_msgs
is discouraged as there are probably better message types you can use, and you also don’t need to use it, as fields in other messages (including your own) should just use the primitive types (ie: string
, uint8
, etc) instead of their wrapped versions from std_msgs
(ie: std_msgs/String
, std_msgs/UInt8
, etc).
As to some context (almost in some sort-of chronological order):
- the Discourse thread which announced the API review: Foxy Message API Review
- the GH PR which aggregated the result of that review (as in: the comments): ros2/common_interfaces#86
- tracking moving
std_msgs
msgs out ofstd_msgs
: ros2/common_interfaces#89 - importing
std_msgs
msgs intoexample_interfaces
: ros2/example_interfaces#11 - adding deprecation notice to
std_msgs
msgs: ros2/common_interfaces#116
You should be able to find other related PRs and issues by following the links in the ones I link to here.
The summary of this is the notice in the release notes of Foxy. Additionally, the messages have deprecation notices added.
But if @33thou’s response is any indication, there aren’t that many people aware of this.