Close

Logs and maps (part 5)

A project log for Old Roomba, new tricks

Add mapping & MQTT-interfacing with ESP8266 and an IMU

simon-jansenSimon Jansen 09/06/2022 at 17:330 Comments

Quick update on the update

Writing live map image to buffer instead of file. Reduces load quite a bit. 

img_buf = io.BytesIO()
plt.savefig(img_buf, dpi=50, format='png')
img_buf.seek(0)
poseLogImageString = img_buf.read()
poseLogImageByteArray = bytes(poseLogImageString)
client.publish(MQTT_Config.HA_name + "/camera/" + DeviceName + "_" + DeviceID + "/map",poseLogImageByteArray,0,False)
img_buf.close()

It's still not fast enough for a real live feed though. Other small changes I made are: using "zorder" to make sure the scatter plot with dots is on top. Changing the size of the dots with s=120 and setting the resolution for both live-map and post-process-map with "dpi".

Updated python script is uploaded.

I guess, now it's time to do the deep dive into the accuracy of the positional data...

Discussions