ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

a std_msgs/ColorRGBA message

asked 2013-01-28 02:46:25 -0500

anycast gravatar image

updated 2013-01-28 06:00:48 -0500

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);

    std_msgs::ColorRGBA color;

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





  return 0;

thanks for your help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-01-28 06:05:55 -0500

In your code, you are advertising the messages on the topic "chatter". From your description, it appears you want to publish on the topic "visualisation_kit":

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

A good tool to debug the input and output topics of your nodes is rosnode. In your case, for example, type this in a console window after executing your "talker" node:

rosnode info talker
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-01-28 02:46:25 -0500

Seen: 3,008 times

Last updated: Jan 28 '13