From rockets to robots and what does Python have to do with it. GeekBrains Alumni Story







Today we publish the history of the transition to IT by Andrey Vukolov. A childhood craze for space once led him to rocket science at MSTU. The harsh reality made me forget about the dream, but everything turned out even more interesting. Studying C ++ and Python allowed us to do no less exciting work: programming the logic of robot control systems.



Start



I was lucky all my childhood to rave about space. Therefore, after school, I did not hesitate for a minute where to go to study, and entered the Moscow State Technical University. Bauman, to the department of rocket propulsion. However, the branch of the course itself — powder or liquid engines of space rockets — did not have to be selected at all: in 2001, a special faculty commission distributed the target groups of applicants. I got "in a barrel of gunpowder."



At that time, the "rocket boom" existed only in plans, engineers received meager salaries and worked in special closed design bureaus and research institutes with practically no prospects for career and professional growth. Still, powder rockets in Russia are purely military products.



Now this direction is in demand, but already during my studies I realized that in rocket science any activity on my own initiative is almost impossible. In fact, this is a military service. For example, working in the rocket industry, I would be completely deprived of the opportunity to independently develop software, even for myself, since this activity is strictly regulated.



All software products are developed exclusively by special order and with the approval of the privacy committee (now it is a division of the FSTEC). The developer there is required to register and license literally every line of code. All software is initially secret at the task level. This partly explains why the software currently used to train rocket students was developed at the maximum in the 1990s.



By the time I graduated, I managed to work at the Department of Mechanism Theory and started developing a training simulator of the technical process in C ++, so I had an example for comparison, and I could weigh all the pros and cons. The choice was obvious, and I gradually began to drift towards IT and robotics. In applied mechanics it was much more fun than in rocket science: there were many unsolved problems, an open environment, the absence of a development industry, and an urgent need for simulation software. In robotics, the unstable architecture of common software and the need to repeatedly implement complex algorithms, including fuzzy logic and the rudiments of AI. Therefore, after my first programs for processing experimental data, I almost never returned to missiles (with the exception of the graduation project).



As a result, I had the opportunity to work in the specialty for only four months before my diploma at the composite structures plant for the aerospace industry near Moscow. At the end of training, I didn’t even have to look for work - I immediately came to teach applied mechanics at the Faculty of Robotics.



From teaching to programming





At the IFTOMM World Congress with students - members of the research group (I'm on the right)



I worked for 10 years at the MSTU at the probotechnical faculty, and taught a course in the theory of mechanisms. He published scientific papers (see the end of the article), gradually moved from mechanics towards CAD and robotics. And in the end he decided to quit teaching. In order to most vividly illustrate the reasons for this decision, I will say that over the course of a dozen years, the course of study that I read has not changed by a comma. Although applied mechanics, judging by the publications, went ahead very, very successfully.



In addition, the work more and more resembled bureaucrats - reports, programs, standards and tons of paper. In such circumstances, the pleasure of teaching was replaced by reports on the receipt of this pleasure, and this is more than unpleasant for a practicing specialist.



And finally I came to robotics like this: in 2007-2009, together with professors A. Golovin and N. Umnov, we began to prepare the first scientific papers. There I had to use algorithms to determine the trajectories of objects according to stroboscopic photography. From this topic - one step to machine vision, OpenCV and the Robotic Operating System (although I didn’t even think about such a scale then). After that, I finally focused on applied mechanics and robotics in research, and development became an auxiliary activity.



However, to find a new job in robotics, it was necessary to improve and supplement my programming knowledge. After all, specifically IT, except for a one-year university course (ObjectPascal and Borland VCL in C ++) I did not study anywhere, I relied on mathematics in the theoretical aspects of development.



At first I considered options for full-time courses at my native institute. True, it quickly became clear that combining such studies with work at the department would be practically impossible due to a torn schedule and frequent work outside of one's own schedule (replacement, etc.). So gradually came up with the idea to finish paid courses remotely. I went to GeekBrains on the recommendation of professors from the Technopark Mail.ru training center located in Baumanka and entered the Python Programmer course.



The courses did not cause difficulties, one problem - constantly had to be combined: with work at the department, scientific works and events. There was not enough time so much that I had to sacrifice (fortunately, temporarily) most of the social connections outside the home.



He coped with the load like this: he solved problems on the road. This skill, developed by numerous business trips, turned out to be very useful, since without it I could not even complete all my homework (and it also replaces meditation ...). I learned how to program on the go using a laptop, smartphone and wireless keyboards for a smartphone.



I have a Dell Latitude 3470 laptop, and any smartphone with a diagonal of 5.5 inches or more paired with a Logitech K 810 BT keyboard will do. In general, I recommend Logitech products to everyone, it is very reliable and tolerates very harsh conditions of use (and this is never an advertisement).





Keyboard Logitech K810



Python is very comfortable with such work - with a good editor. Another programming hack: use remote connections to the desktop or runtime. I completed several tasks using a secure web server running Django on my home computer. He worked at the same time from the train, the software used PyDroid, DroidEdit, Maxima.



Why Python?



For quite a while I tried to use PHP as a system scripting language. Python initially independently and little by little studied "for itself". He decided to seriously study after he learned about the existence of an effective connection between Python and C ++ at the module level - it seemed interesting to separate optimized algorithms and procedures for preparing data in one language.



The simplest example: there is a non-standard powerful drive control system implemented on an embedded machine with a RISC processor, in C ++. Management is via an external machine-dependent API that supports, for example, communication between subsystems over a network. At a high level, the drive operation algorithm is not debugged or is not constant (loading of various algorithms is necessary depending on the work process).



One of the best ways to get such a system is to use the machine-specific API C ++ subsystems as the basis of the set of Python classes used on the cross-platform interpreter. Thus, the top-level developer will not need to take into account the features of the embedded machine and its OS, he will simply work with Python classes, which act as “wrappers” of the low-level API.



I had to learn the binding of C ++ and Python from scratch. The understanding quickly came that object-oriented features at a high level are much more important than at a low level. Because of this, I had to completely change the approach to designing and implementing the API, opting for classes at the Python level and shared global data in C / C ++. Get used to code generation: for example, the ROS framework itself generates names and objects in Python, so you have to take into account the differences in languages, especially in typing, designing your interfaces.



Work in the present: Python and the logic of robot control systems



Now I work as a programmer in Python and C ++ at the scientific and educational center "Robotics" at MSTU. We implement research projects and software tools commissioned by government departments: we develop manipulators with built-in vision systems and high-level automatic control algorithms that are independent of systems.



Now I am programming in Python a high-level logic of robot control systems, this language interconnects highly optimized modules written in C ++, assembler and Go.



In programming robot control algorithms, two large groups of algorithms are used. The first of them is implemented directly on the equipment, at a low level - this is the firmware of the drive controllers, communication line concentrators, subsystems of interaction with the operator.



Algorithms here are designed for a controlled execution speed and reliability exceeding the performance of the robot as a whole. The latter is necessary, since the security of the entire system depends on the low-level control software.



The second group of algorithms determines the operation of the robot as a whole. These are high-level programs, the emphasis in the development of which is on the understandability and speed of implementation of the algorithm, often quite complex. In addition, high-level software on the robot very often undergoes a change in the process of commissioning and testing. Interpretable general-purpose languages ​​are indispensable for such a development.



What knowledge is needed for such a job



It will be compulsory to learn the C ++ template language, the object-oriented features of Python. An almost indispensable skill is the ability to design and document APIs. It will not be superfluous to study the capabilities of specialized libraries, such as Boost :: Python. Those who work with low-level software will definitely have to deal with multithreading (and, at the kernel level), Linux / UNIX / QNX system calls. To enhance understanding of the principles of building robotics, it is very useful to familiarize yourself with the Robotic Operating System framework.



I try to have at least one compiling and one interpreted programming language in the asset, developing and in demand. This is a winning strategy for working in engineering, where it is constantly required to develop highly specialized (read: unusual) algorithms and implement them in compiling languages. The task of preparing data for such software is much nicer to solve using interpreted languages. Initially, my set included C ++, Pascal and BASIC, later PHP and BASH were added.



How development tools can come in handy in student learning



The main plan for professional development now is to try to bring the scientific base for the use of professional software development tools in pedagogy, to develop and test teaching methods.



In 2016, I began a large experiment on introducing development tools - programming languages, IDEs, documentation generators, version control systems - into pedagogical practice in higher education. Now we have managed to obtain results that can be summarized qualitatively.



For example, the introduction of versioning of materials into the educational process significantly improves the quality of student work, however, only under the condition that students work together on shared projects. The development of methods for teaching technical disciplines using professional software development tools is now actively conducted by the forces of my research group, which consists of students, applicants and students of supplementary education programs of MSTU.



By the way, I did not leave the teaching practice - I developed the author’s in-depth in-person course on Linux device and administration for the Institute of Advanced Studies of MSTU, and I myself teach.



Scientific work



Early work

Issues of gait planning in the design of four-legged walking systems using horse gait as an example (2010)



On the issue of kinematics and loading of the support element of the horse’s front leg in the stage of approaching the support as components of the four-leg propulsion duty cycle (2012)



From the last

3D application for simulating the production of gears for teaching the theory of mechanisms and machines (2019)



Recognition of structural obstacles and its application in the search for relief objects (2018)



Other works indexed by science citation databases can be seen on my ResearchGate profile. Most of the articles are devoted to the movement of machines; there are works on engineering pedagogy and educational software.



All Articles