rostopic publish constant value
ROS messages allow the definition of constants (e.g. for emulating enum types). Is there a way to publish these named values in "rostopic pub"?
For example, I have a defined message type Emotion.msg:
uint32 emotion
float64 intensity
uint32 NEUTRAL=0
uint32 HAPPY=1
uint32 SAD=2
The idea is that the emotion value is set to one of the constants, and I don't really want to remember what the constants are as values.
The following works as expected, but is not ideal:
rostopic pub --once /set_emotion my_msgs/Emotion 1 0.5
Rather, I want to publish something like
rostopic pub --once /set_emotion my_msgs/Emotion HAPPY 0.5
or at least
rostopic pub --once /set_emotion my_msgs/Emotion my_msgs/Emotion/HAPPY 0.5
Neither of these seem to work, since the constants get interpreted as strings. Is there a way to specify named constants in the rostopic utility? Neither of these seems to work.