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

From rockets to robots and what does Python have to do with it. GeekBrains Graduate Story
Today we publish the story of Andrey Vukolov's transition to IT. A childhood passion for space once led him to rocket science at MSTU. The harsh reality made me forget about the dream, but everything turned out to be even more interesting. Learning C++ and Python allowed me to do an equally exciting job: programming the logic of robot control systems.

Home

I was lucky all my childhood to rave about space. Therefore, after school, I did not doubt for a minute where I should go to study, and entered the Moscow State Technical University. Bauman, to the department of rocket engine building. However, the very branch of the course - powder or liquid engines of space rockets - did not have to be chosen at all: in 2001, a special faculty commission was still distributing 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 virtually 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 one's own initiative is almost impossible. In fact, this is 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 on special order and with the approval of the secrecy commission (now this is a division of the FSTEC). The developer there is obliged 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 teach rocket science students was developed at most in the 90s.

By the time I graduated from the institute, I managed to work at the Department of the Theory of Mechanisms and start developing an educational process simulator 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. Applied mechanics was a lot more fun than rocket science: a lot of unsolved problems, an open environment, no development industry, an urgent need for simulation software. In robotics, the unsettled architecture of common software and the need to repeatedly implement complex algorithms, including fuzzy logic and the beginnings of AI. Therefore, after my first programs for processing experimental data, I almost never returned to rockets (with the exception of my graduation project).

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

From teaching to programming

From rockets to robots and what does Python have to do with it. GeekBrains Graduate Story
At the IFTOMM World Congress with student members of the research group (I am on the right)

I worked for 10 years at the Faculty of Probotics at Moscow State Technical University and taught a course on the theory of mechanisms. He published scientific papers (see at the end of the article), gradually moved from mechanics towards CAD and robotics. And in the end he decided to leave teaching. To most clearly illustrate the reasons for this decision, I will say that in ten years the course of study I have taught has not changed by a single comma. Although applied mechanics, judging by the publications, went forward very, very successfully.

In addition, the work more and more resembled bureaucratic work - reports, programs, standards and tons of paper. Under such conditions, the pleasure of teaching has been replaced by the reporting of this pleasure, and this is more than unpleasant for the practitioner.

And finally, I came to robotics in the following way: 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 from stroboscopic photography. From this topic - one step to machine vision, OpenCV and Robotic Operating System (however, then I did not even think about such a scale). After that, I finally focused on applied mechanics and robotics in research, and development became an auxiliary activity.

However, in order to find a new job in robotics, it was necessary to improve and supplement my knowledge in programming. After all, I didn’t study IT anywhere except for the annual university course (ObjectPascal and Borland VCL in C ++), 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 it would be almost impossible to combine such studies with work at the department due to a torn schedule and frequent work outside of one's own schedule (substitutions, etc.). So gradually I came up with the idea to complete paid courses remotely. I joined GeekBrains on the recommendation of professors from the Technopark Mail.ru training center located in Baumanka and enrolled in the Python Programmer course.

The courses did not cause any difficulties, one problem - I constantly had to combine: with work at the department, scientific works and events. Time was so tight that I had to sacrifice (for the time being, thankfully) most of my social connections outside the home.

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

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

From rockets to robots and what does Python have to do with it. GeekBrains Graduate Story
Keyboard Logitech K810

Python is very conducive to such work - if you have a good editor. Another programming hack: use remote desktop or runtime connections. I've completed several tasks using a secure web server running Django on my home computer. I worked from the train, the software used was PyDroid, DroidEdit, Maxima.

Why Python?

It wasn't long before I tried to use PHP as a system scripting language. Python was initially independently and little by little studied "for myself". I seriously decided to learn after I learned about the existence of an effective link between Python and C ++ at the module level - it seemed interesting to share optimized algorithms and data preparation procedures within the same language.

The simplest example: there is a control system for a non-standard powerful drive, implemented on an embedded machine with a RISC processor, in C ++. Management goes through an external machine-dependent API that supports, for example, communication between subsystems over a network. At a high level, the drive algorithm is not debugged or is not constant (you need to load different algorithms depending on the workflow).

One of the best ways to get such a system is to use the machine-specific API of the C++ subsystem as the basis for 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 that act as “wrappers” for the low-level API.

I had to learn C++ and Python binding almost from scratch. It quickly became clear that object-oriented features were more important at the high level than at the low level. Because of this, we had to completely change the approach to designing and implementing APIs, 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 differences in languages, especially in typing, when designing your interfaces.

Working in the Present: Python and the Logic of Robot Control Systems

Now I work as a Python and C++ programmer at the Research and Educational Center "Robotics" at Moscow State Technical University. 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 high-level logic of robot control systems in Python, this language connects highly optimized modules written in C ++, assembler and Go.

In the programming of 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 drive controllers, communication line concentrators, subsystems for interaction with the operator.

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

The second group of algorithms determines the operation of the robot as a whole. These are high-level programs, the development of which focuses on the clarity and speed of implementation of the algorithm, which is often quite complex. In addition, the high-level software on the robot is very often subject to change during commissioning and testing. General-purpose interpreted languages ​​are indispensable for such development.

What knowledge is needed for this job?

It will be mandatory to study 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 explore the possibilities of specialized libraries, like Boost:: Python. Those who work with low-level software will definitely have to deal with multithreading (moreover, at the kernel level), Linux / UNIX / QNX system calls. To improve your 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 my asset, developing and in demand. This is a winning strategy for jobs in engineering, where highly specialized (read: fancy) algorithms are constantly required to be developed and implemented in compiler languages. The task of preparing data for such software is much more pleasant to solve using interpreted languages. Initially, my set included C ++, Pascal and BASIC, PHP and BASH were added later.

How development tools can be useful in teaching students

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

Since 2016, I have started a big experiment on introducing development tools — programming languages, IDEs, documentation generators, version control systems — into teaching practice in higher education. We have already managed to obtain results that can be qualitatively generalized.

For example, the introduction of versioning of materials into the educational process significantly improves the quality of student work, however, only under the obligatory condition: joint work of students on shared projects. The development of a methodology for teaching technical disciplines using professional software development tools is now being actively pursued by my research group, consisting of students, applicants and students of MSTU additional education programs.

By the way, I did not leave teaching practice - I developed the author's in-depth full-time course on the device and administration of Linux for the Institute for Advanced Studies of the Moscow State Technical University, and I teach myself.

Research papers

Early work
Issues of gait planning in the design of four-legged walking systems on the example of the implementation of the gait by a horse (2010)

On the issue of kinematics and loading of the supporting element of the front leg of the horse at the stage of approach to the support as components of the working cycle of the four-legged mover (2012)

From the last
3D gear production simulation app for learning the theory of mechanisms and machines (2019)

Structural Obstacle Recognition Method and Its Application in Searching for Relief Objects (2018)

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

Source: habr.com

Add a comment