ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

No, that is not possible, as the semantics of an std_msgs/Int8 are such that it is considered a single, 8 bit integer value, not a set of individual bits.

You have two options:

  1. use a message that contains a (fixed size) set of the bool primitive type
  2. use bit manipulation to set individual bits in an Int8

Note that option 1 will not make ROS automagically consider the (fixed size) set of bools an integer, but it is the only way to (re)set individual boolean values in a ROS message.