This material does not set a goal to kindle a holy war between people who believe that only multimedia things can be done on AS3, and people who are completely satisfied with AS3. Rather, it is a post about how a unified development environment can save time.
The very thought of making a server based on Adobe AIR and AS 3.0 may seem nightmarish, but when you are faced with the task of making not just a website, but an entire platform for creating photos, storing them (on a universal scale), communicating people and, worst of all, for Online control of robots, the game is worth the candle.
So, the project Touch Z-Distance (started on September 1, works until October 15). The task is to assemble a photo studio in which it would be possible to photograph models via the Internet, with the help of robots equipped with cameras. This studio starts for the first time. What was required to launch this ambitious project?
1. Design designs of robotic tripods that will control the TZ20 cameras:
- development of ergonomic design of tripods (Autocad, 2D-design, layout, preparation of files for laser cutting, milling cutter, 43 * 8 parts for assembly, 3D-design, placement of electronics);
- selection of materials for assembly: polystyrene, PVC, aluminum (flexible, lightweight material, mobile);
- development of mechanics in test samples (3 pcs.), In each subsequent eliminating the problems of the previous one.
')
Problem: servo-driven mechanisms were breaking out when going to the extreme position.
Solution: the tripod design allows you to go to the extreme position.
Problem: wear parts.
Solution: replacement.
2. Program the tripods (Arduino)
- flashing of boards, calibration of boards, communication with servos, calibration of serv;
- the appointment of com-ports, assigning the ordinal name of the Arduino;
Problem: the signal did not pass through the USB extension cable.
Solution: separate power for each USB extension cable.
Problem: 24kg / 1cm serv gave interference to the Arduino when overloaded.
Solution: balancing the load on the serv.
3. Connection of parts
- Arduino power (8 pcs.);
- power supply of servos of different capacity (24 kg / 1 cm, 10 kg / cm, 3 kg / cm; 64 pcs.);
- power supply, USB extension for Arduino (8 pcs.) .;
- power USB controllers 15 pcs.
Problem: reboot the Arduino.
Solution: elimination of power shortages, separate power to the Arduino (a separate unit with a power filter), separate power to the USB cable.
Problem: lack of full-time constant power.
Solution: unpacking the battery emulator from a permanent power supply; webcam connection, name assignment.
Problem: The computer does not support more than one webcam at a time.
Solution: USB bus extension, increasing the number of controllers; Tire expansion for separate power supply via webcam controllers.
Requirement: three degrees of freedom for a tripod, three degrees of freedom for finger mechanics (a unique model of mechanics at this scale (mini CNC)), work tripods and cameras for 10 hours over 45 days.
4. To upload photos from cameras using Wi-Fi flash cards
- setting up a local network of wi-fi flash drives, assigning the name of flash drives.
5. Link three servers using AIR (1.5 terabyte of photos is stored on one of the servers).
6. Girls, makeup, clothes
The main idea of ​​the studio is models, and they (models) needed to be programmed to be photographed in front of eight mechanical robots :) By the way, there were 32 models.
The list of equipment that was used and purchased in different countries:
- Wi-Fi flash drive (America);
- purchase of Arduino, servos (China);
- components for the assembly of plastic, adhesives, etc. (China, Russia).
So, as for the studio, everything was developed in ActionScript 3.0 in the FlashDevelop development environment, since it was the fastest way, and Adobe AIR includes a full range of media management. If it was a different environment or language, then you would have to use many different technologies, and not the fact that all this would work fine.
The main advantages of AIR over other development environments is the speed of development and the fact that you don’t need to switch between multiple programs - the interaction between modules goes at the “native” (intuitive) level, you don’t need to achieve compatibility every time: everything is already compatible.
Perhaps we would face some limitations on performance, whether we have a task such as video conversion or a large amount of data processing (media) task (but even in this case, we could just use other programs but in conjunction with AIR).
Due to the fact that it was necessary to divide the flows of users (so that everyone saw the site, but managed - in turn), there were problems in the program part with queues of photos and people for shooting. A queue was rewritten, which was originally on the server, and all application modules were constantly refined to increase stability, in order to take into account various factors (for example, the Internet was lost in the studio or the server fell).
The server part, which was responsible only for the queue, was transferred to the studio to solve the problem of desynchronization (delays between the server and the studio).
Actually, the queue mechanism was built right into the controller for managing the tripods, which gave an increase in stability when processing the queue and various difficult moments.
In addition to the software, there were problems with iron, but that’s another story ...
-
The project will work for two more days, so you can still go to the site and take pictures of the models, as well as criticize Adobe AIR and say that everything could be done better, easier and faster.
Finally, a small project guide!
Questions, comments?
UPD!
BY THE WAY!CLUB!
Today and tomorrow from 00.00 we will be a little naughty! I will not reveal all the cards. But maybe the phrase "easy striptease for huskies" will say something to someone :) Don't forget to stop by at night !