So, lately during the summer I wanted to have some new robots for the students to work on. You know, some motors, couple of sensors, built-in Arduino-like electronics, that kinda stuff. And after about a week of searching I found a perfect robot … a 3D printer.
Just a first trial of using python-whiteboard with a stock Wii Remote (those things run on bluetooth) and a screen projector on a wall. As an infrared pen – a TV remote.
(sarcasm warning) Due to a recent massive surge of interest in the blog and the sheer terror of somebody actually reading it (yes, I’m looking at you Ola and Gosia), here we go with a rather pointless post – a quick autops… I mean, precise dissection of a 3D printer – Tiertime / PP3DP Up Plus 2. Or, at least, a glorified photo shoot.
Goal: postprocess what absolute magnetic angle measurement sensor (woah) AS5048a returns with Matlab in order to see plots and make animations.
First result: what in the name of valhalla is the Matlab serial doing?!
Second result: works.
The adventures with the Crazyflie on Linux Slackware 14.2 begins! … with troubles 🙂
The goal is to get it going with Python, then with Matlab, then with Simulink, then with a mount that will bind it nicely to the ground with 3DOF gimbal.
Let’s start with drivers and Python.
So, it basically boils down to an old problem: how do I get some user-controlled inputs in Matlab?
Keyboard handling in real-time is basically nonexistant, joystick is alright, but the most easy way to get some input and freedom of controlling things is – to poll the mouse position.
xy = get( 0, 'PointerLocation' )
Let’s get going with a short series of tutorials dedicated to nonlinear control examples with Matlab/Octave implementation. First to go: unicycle.
Good one for working with github: http://rogerdudler.github.io/git-guide/
https://github.com/matlab2tikz/matlab2tikz – Matlab to TikZ (Latex graphics) conversion tool for plots
https://www.sharelatex.com/learn/TikZ_package – TikZ documentation – general graphics
https://www.sharelatex.com/learn/Pgfplots_package – Pgfplots documentation – plotting tool inside Latex
Modifications and examples below.
Did you know you can tag the plots in Matlab for easier searching? Because I fuckin’ didn’t.
Why so brutal? Well, after 6 years of writing your PhD in Matlab you CAN become furious when you realise instead of keeping the links to the currently opened plots in a global variables and different lists you could’ve been naming them all that time…
Tag the plot: description for searching
aa = plot(2,2); set(aa, 'Tag', 'foot trajectory' ) findobj('Tag','foot trajectory') set( findobj('Tag','foot trajectory'), 'XData', [2 3], 'YData', '4 5')