Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do I plot my messages

I am publishing a LaserScan message over ignition transport and I want to plot it in the utility shown here: https://www.youtube.com/watch?v=G5qBaEXpkvE

I don't see the topic anywhere in the topic visualizer or the plotting utility. How can I add my messages to both?

My code:

    std::string IGNITION_TOPIC = "LIDAR";
    ignition::transport::Node node;
    ignition::transport::Node::Publisher pub = node.Advertise<ignition::msgs::LaserScan>(IGNITION_TOPIC);

    scan.Clear();
    auto* time_ptr = scan.mutable_header()->mutable_stamp();
    scan.add_ranges(distance);
    time_ptr->set_sec(time.sec);
    time_ptr->set_nsec(time.nsec);

    pub.Publish(scan);