1 import paho.mqtt.client
as mqtt
8 print(
"Connected with result code "+str(rc))
10 client = mqtt.Client()
11 client.on_connect = on_connect
13 client = mqtt.Client(
"PlotJuggler-test")
15 client.connect(
"127.0.0.1", 1883, 60)
26 robot_state.query =
"query";
30 page_number = page_number +1
31 robot_state.page_number = page_number
32 robot_state.result_per_page = page_number*2
34 robot_state.pos.x = 1.1
35 robot_state.pos.y = 2.2
36 robot_state.pos.z = 3.3
40 robot_state.sensor_reading[
"sensor1"] = 15;
41 robot_state.sensor_reading[
"sensor2"] = page_number;
43 msg = robot_state.SerializeToString()
45 ret = client.publish(
"plotjuggler/stuff", msg, qos=0 )
46 print( ret.is_published() )