NOTE :- Run roscore in on of the other terminal before starting the tutorial to start rosmaster.
! python3 ../scripts/generate_cling_3rd_party.py roscpp
#include "load_roscpp.h"
#include "jupyter_ros_utils/ros1_publisher.hpp"
This widget will use publish data using pub_callback and show it in the stream
ros_init("cpp_ros_async_callback_publisher");
#include <std_msgs/UInt32.h>
uint32_t data = 0;
std_msgs::UInt32 pub_callback() {
std_msgs::UInt32 msg;
msg.data = data;
++data;
ROS_INFO("%d", data);
return msg;
}
ZeusPublisher pub("/magic/uint", pub_callback);