storborg / axibot Goto Github PK
View Code? Open in Web Editor NEWHeadless control software for the AxiDraw pen plotter.
Home Page: http://axibot.readthedocs.io/
License: GNU General Public License v2.0
Headless control software for the AxiDraw pen plotter.
Home Page: http://axibot.readthedocs.io/
License: GNU General Public License v2.0
Some areas that need to be cleared up:
It should be possible to accelerate faster in the Y direction (where the axis has better support) than in the X direction. Try playing with an optimization where the angle of a line segment determines the max acceleration that can be used: where a perfectly horizontal line uses the existing acceleration parameters, but gradually increases to a 2x or so acceleration multiplier for a perfectly vertical line.
End goals:
At the end of every plot, when the head homes to (0,0), it stops halfway in the middle of the page with the following error:
axibot.ebb.EiBotException: Unexpected response from EBB:
Command: b'SM,30,-751,-79'
Response: b'Major malfunction Axis1 StepCounter too high : 32811'
Perhaps the speed is too high?
Relevant: https://github.com/evil-mad/EggBot/blob/master/EBB_firmware/app.X/source/ebb.c#L1425-L1434
Right now the server fails to start if axibot
is installed in non-dev mode, because the examples
directory is lost, and thus the default SVG cannot be loaded. Fix that, and maybe also switch to an example SVG which includes some basic "axibot" text or something.
An example case:
One way to deal with this is just to properly return error messages when actions fail.
On both the upload and download side, send the active SVG document via WebSockets instead of using plain HTTP requests. Mostly this is for implementation simplicity.
If an SVG doesn't have physical units set (e.g. it is only scaled in pixels), auto-scale it to fit in the working area of the AxiDraw.
The test for the USB ID string is case insensitive, and expects that the USB ID is uppercase. My AxiDraw string has lowercase letters and therefore the board is never found. Changing ebb.py to match my string 'USB VID:PID=04d8:fd92' allows the board to be found, and I can print with no issues.
This issue is NOT SVG dependent
Use for testing, diagnostics, etc.
When the robot does a long-duration move, the web interface doesn't update the state of the pen visualization during the move. This causes jankiness when traversing long line segments.
Instead of just an action counter.
User presses enter to begin a plot, this error is displayed
Press enter to begin.
Traceback (most recent call last):
File "/usr/local/bin/axibot", line 9, in
load_entry_point('axibot==0.0.2', 'console_scripts', 'axibot')()
File "/usr/local/lib/python2.7/dist-packages/axibot/cmd.py", line 180, in main
return opts.function(opts)
File "/usr/local/lib/python2.7/dist-packages/axibot/cmd.py", line 123, in plot
input("Press enter to begin.")
File "", line 0
^
SyntaxError: unexpected EOF while parsing
Note, changing input("Press enter to begin.") to raw_input allows me to plot with no issues
Issue is NOT SVG dependent
Looks like a floating point error.
WARNING:axibot.svg:This document does not specify physical units. Auto-scaling it to fit the drawing area.
AssertionError: SVG width of 11.000000000000002 must be <= 11
'''
Using python 3.6 / macOS 10.12.2 .
Use like:
bot.do(job)
job.filename
job.duration()
job.bbox()
for action in job:
Webserver is non-functional when installed via pip install.
Particularly when processing an uploaded file fails.
It should be possible to plan a job based on an SVG document, then execute that plan directly.
This feature is particularly leverage when bulk-planning and manipulating a large set of files, where it might take an inordinately long time to do things like parse and compute ink usage, time duration, etc.
Add a file format like foo.axibot.json
which stores a list of actions and can be serialized/deserialized. The JSON file can also include the original source document (in cases where an SVG document was used to generate it) so that the document can be used as a preview in the server. This could also make various debug tools simpler/cleaner.
With my ballpoint pen, most curved lines plot nicely but long lines go too fast and are not well inked. Is there a way to set a maximum speed (perhaps for lengths greater than a few mm)?
This polygon doesn't work for me:
<?xml version="1.0" encoding="UTF-8"?>
<svg width="62px" height="57px" viewBox="0 0 62 57" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 41.2 (35397) - http://www.bohemiancoding.com/sketch -->
<title>Shape</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Twinleaf-Logo-Outline" transform="translate(-226.000000, -27.000000)" stroke="#000000">
<g id="Group" transform="translate(13.000000, 27.000000)">
<polygon id="Shape" points="241.589318 0.449723582 214.07791 55.8112177 243.210983 42.7635265 273.510516 54.7168952"></polygon>
</g>
</g>
</g>
</svg>
The error is:
File "/usr/local/lib/python3.6/site-packages/axibot-0.0.3.dev0-py3.6.egg/axibot/svg.py", line 145, in convert_to_path
return points_to_path_string(node.get('points'), closed=True)
File "/usr/local/lib/python3.6/site-packages/axibot-0.0.3.dev0-py3.6.egg/axibot/svg.py", line 109, in points_to_path_string
xs, ys = point_string.split(',')
ValueError: not enough values to unpack (expected 2, got 1)
In my design software (Sketch for macOS) certain shapes are output to SVG as polygon
s. Any idea how hard it is to translate them to path
s?
It's unwise to pause plotting at a particular action, because that may result in extreme instantaneous acceleration/deceleration. Possible alternatives when pausing include:
We could also take a different approach when cancelling directly from plotting (without pausing first): Calculate a new spline trajectory from the current position and velocity back to the origin as quickly as possible. Then, execute that trajectory and lift the pen up at the same time.
This could look like an AxiBot
class with a higher-level interface for control. Something like:
path = svg.path.Path(...)
bot = AxiBot.connect()
bot.plot_path(path)
To test/demonstrate this, write a "clock" example which draws the current time as an analog clock once a minute or so.
Axibot should handle the svg tag .
My drawing program (Sketch for macOS) decided to output SVG with px units.
1px = 1/96 in
It's a trivial thing to fix. I'll submit a pull request.
When I try to plot an .svg file or get info on an .svg, I get the following error:
> axibot info lines.svg
Loading lines.svg...
Extracting paths...
Traceback (most recent call last):
File "c:\users...\appdata\local\programs\python\python35\lib\runpy.py", line 184, in _run_module_as_main
"main", mod_spec)
File "c:\users...\appdata\local\programs\python\python35\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users...\AppData\Local\Programs\Python\Python35\Scripts\axibot.exe_main.py", line 9, in
File "c:\users...\appdata\local\programs\python\python35\lib\site-packages\axibot\cmd.py", line 180, in main
return opts.function(opts)
File "c:\users...\appdata\local\programs\python\python35\lib\site-packages\axibot\cmd.py", line 95, in info
actions = file_to_actions(opts.filename, pen_up_delay, pen_down_delay)
File "c:\users...\appdata\local\programs\python\python35\lib\site-packages\axibot\cmd.py", line 48, in file_to_actions
paths = svg.extract_paths(filename)
File "c:\users...\appdata\local\programs\python\python35\lib\site-packages\axibot\svg.py", line 247, in extract_paths
recurse_tree(paths, root, matrix)
File "c:\users...\appdata\local\programs\python\python35\lib\site-packages\axibot\svg.py", line 212, in recurse_tree
recurse_tree(paths, node, matrix_new, parent_visibility=v)
File "c:\users...\appdata\local\programs\python\python35\lib\site-packages\axibot\svg.py", line 216, in recurse_tree
paths.append(transform_path(node.get('d'), matrix_new))
File "c:\users...\appdata\local\programs\python\python35\lib\site-packages\axibot\svg.py", line 188, in transform_path
transform.apply(p, transform_matrix)
File "c:\users...\appdata\local\programs\python\python35\lib\site-packages\axibot\transform.py", line 203, in apply
raise ValueError("Don't know how to transform %r" % piece)
ValueError: Don't know how to transform Move(to=(394.96965+438.69448j))
All .svg files tested so far (some created by me in inkscape, others from the example folder).
For this issue I'll focus on "lines.svg" from the examples folder.
Windows 10 and rasian linux. Same error on all attempts (with different "to" coordinates).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.