ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The issue is that the three fields you are trying to print are defines as uint8
in C++, those are of type uint8_t
... The output operator (<<
)is treating this type like a char
.
Does the following fix your issue?
ROS_INFO_STREAM(std::setprecision ( 0 ) << " color=(" << +msg.r << " , " << +msg.b << " , " << +msg.g << " ) ");
Read more here:
2 | No.2 Revision |
The issue is that the three fields you are trying to print are defines defined as uint8
in the message. In C++, those are of type uint8_t
... The , and the output operator (<<
)is ) is treating this type like a char
.
Does the following fix your issue?
ROS_INFO_STREAM(std::setprecision ( 0 ) << " color=(" << +msg.r << " , " << +msg.b << " , " << +msg.g << " ) ");
Read more here: