ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Your exact syntax is incorrect, but you can definitely set individual bits and decode the number in a subscriber. For example, something like msg.data = 8
would set the data field to have 0b00001000
in binary. You can set values using hex/binary/decimal (see integer literals), and you can also use C++ bitwise operators to set and access individual bits.