ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
There is not nice solution for this as in e.g. python.
If you know the message at compile-time it's probably something like if(field == "val1") value = msg.val1;
. I'd be happy to see if someone can come up with something more elegant.
If you don't know it at compile-time it might not be possible to do that at all.