code to support the Hackerbot Industries Hackerbot
What does what here:
- hackerbot_map_utils.py - decodes JSON-based compressed maps into ROS-compatible map files
- map_puller.py - Python script to download a map off the Hackerbot to a file
- maptexts - sample maps in compressed JSON format.
- maps - sample map images
To run, do one of the following:
- Use map_puller.py to download a map from your robot onto the onboard Raspi
- cut-and-paste the terminal output from a Python miniterm session:
Send
MACHINE,1followed byGETMAP,1(or whatever map you want) and save the whole JSON output from theGETMAP,1command to a text file. The file should have 1 continuous, very long JSON string(See themaptextsdirectory for examples)
usage: map_puller.py [-h] [-o OUTFILE] [-p PORT] [-m MAP_ID] [-l]
get maps stored on a Hackerbot base
options:
-h, --help show this help message and exit
-o OUTFILE, --outfile OUTFILE
filename to save map as,include full path if necessary
-p PORT, --port PORT serial port to use(default=/dev/ttyACM0)
-m MAP_ID, --map_id MAP_ID
id of map to retrieve
-l, --listmaps List map ids, skip retrieval
- Run
hackerbot_map_utils.py -f <textfile>. You should see output showing the resolution of the decompressed map and number of bytes processed from the script along with a new .pgm and .png file. Those are your mapfiles.
This is all still pretty experimental and based on a good bit of apriori assumptions, hand-decoding and general hackery. It works for me with the files included in the maptexts directory. It might even work for you! :)
Please let me know about successes and failures.