"Information for controlling motors with Python on Raspberry Pi" Has already been written.
Here's why I'm interested in motor control in Python. Increase the number of people who can write motor control programs and have fun incorporating them. (In the description below, the author of this article may be misunderstanding because he is not familiar with the C ++ library.)
In Python, libraries that are easy to control serial ports, socket-based networks, threads, etc. can be used in common with Windows and Linux / Unix, and development can be advanced to some extent on a machine that is easy to develop. After that, it is easy to port to the target machine.
"A person who can write Linux (or TRON or OS-less) programs in C / C ++" And "a person who can write Linux IO device drivers" And "a person who understands the electric system of motor control" And "a person who understands the force acting on the object to be driven and the mechanics such as disturbance" The condition is required.
You can try running a sample script to imitate people who say, "I don't know C / C ++. I've never compiled it." If you run the script on the interpreter, you can run the script to the extent that it can work normally. It can be developed little by little even in situations where it is not completely completed. You can see the value of the variable in the running scope of the program in Spyder (one of the Python integrated environments) with [Variable explorer]. You can save the results and use Spyder to analyze data and create graphs on a par with MATLAB, regardless of the type of Linux or Windows.
There was no standard way to code in common on Windows and Unix / Linux. Windows 3. Serial communication on Windows [3-5] Linux About serial programming in Linux in general
Python: pyserial 3.0 Article "Python and hardware-Using RS232C with Python-"
There was a big difference in the basic libraries between Linux and Windows, and it was difficult to create a program that works in common between Linux and Windows. The Unix and Linux Socket libraries are from the ancient times before IPv6, before the multithreading era, and before unicode, and I understand what the Unix and Linux libraries I'm using are. Not done.
Unix [C language] Create an echo server for inter-socket communication Windows How to communicate by TCP using winsock
Python: Python's socket library is in Python's standard library, so you can write common programs regardless of the OS type. Python's network library is rich enough to write a web server. Python standard library 7.2. Socket — low-level network interface Article I made an echo server with python
There is a library called SocketServer, so I tried using it. Tips 5 for Python beginners to use Scikit-image examples for themselves
Boost's Asio library can write source code that is highly common to Windows and Linux. Boost.Asio Boost.Asio A collection of simple clients and servers SlideShare Use Asio!
Conventional C / C ++ multithreading has no description method regardless of the type of OS. When writing a program with multiple threads, it is not always easy to check whether the function used in the function is thread-safe.
Python: Python includes multithreading in its standard library.
Python standard library 16.2. threading — high-level threading interface
Article "Multithreading with Python" Article Try loading images in a separate thread (OpenCV-Python)
In C ++ 11, the multithreaded library is standardized, so it seems that it is easier to write multithreaded programs that do not depend on the OS. Article Try loading images in a separate thread (C ++ version)
Referenced URL 1: Easy asynchronous processing in C ++ (std :: thread, std :: async) http://qiita.com/termoshtt/items/d3cb7fe226cdd498d2ef 2: Introduction to C ++ std :: async http://kaworu.jpn.org/cpp/std::async
It is slow due to dynamic type checking and checking outside the range of the array.
Japanese translation of standard documentation "Extending Python with C and C ++"
Article I tried using Cython to speed up Python
See the official documentation for basic Cython usage http://docs.cython.org/ Japanese version http://docscythonja.zouri.jp/
Recommended Posts