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

anycast's profile - activity

2013-05-31 03:15:44 -0500 received badge  Famous Question (source)
2013-02-12 06:28:18 -0500 received badge  Notable Question (source)
2013-01-28 12:52:55 -0500 received badge  Popular Question (source)
2013-01-28 02:46:25 -0500 asked a question a std_msgs/ColorRGBA message

hello everyone

i am just a beginner with ROS system. i am trying to writing a publisher node, which send a colorRGBA message to the subscriber about the topic "visualization_kit".

but it's unable to display the color,here are my codes

int main(int argc, char **argv)
{

  ros::init(argc, argv, "talker");

  ros::NodeHandle n;

  ros::Publisher chatter_pub = n.advertise<std_msgs::ColorRGBA>("chatter", 1000);

  while(ros::ok())
  {
    std_msgs::ColorRGBA color;

    color.r = 255;
    color.g = 0;
    color.b = 0;
    color.a = 1;

    //draw.colors.push_back(color)

    ROS_INFO("%s","visualisation_kit");

    chatter_pub.publish(color);

    ros::spinOnce();
  }

  return 0;
}

thanks for your help.