Robotics StackExchange | Archived questions

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

Asked by MartinDeegan on 2018-10-30 22:24:40 UTC

Comments

Answers

The topic viewer and the plotting only support Gazebo Transport for now, that's why your Ignition Transport topic is not coming up.

So you can either switch to use Gazebo Transport, or you can use Ignition GUI, which has a plot widget for Ignition Transport.

Asked by chapulina on 2018-10-31 12:19:02 UTC

Comments