#include <ros/ros.h>
#include "turtlesim/Color.h"
#include <iomanip>
void apple(const turtlesim::Color& msg)
{
ROS_INFO_STREAM(std::setprecision ( 0 )
<< " color=(" << msg.r << " , " << msg.b << " , " << msg.g << " ) ");
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "pose_subscriber");
ros::NodeHandle n;
ros::Subscriber pose_sub = n.subscribe("/turtle1/color_sensor", 10, &apple);
ros::spin();
return 0;
}
why do my output so strange? my output is like a lot of this:
[ INFO] [1582904454.849200284]: color=(E , ? , V )
can someone tell me where do i did wrong?thanks very much!
Originally posted by 流水疾翔 on ROS Answers with karma: 5 on 2020-02-28
Post score: 0
Original comments
Comment by jarvisschultz on 2020-02-28:
I provided an answer, but I also re-tagged and edited your question title. The original title was not descriptive enough. In the future, please try to follow the Support guidelines to get the best possible help: http://wiki.ros.org/Support