Menu
Is free
registration
the main  /  Installation and configuration/ Surveillance - covert outdoor surveillance of a person. Controls and menus

Surveillance is a covert outdoor surveillance of a person. Controls and menus

Chapter 15: Working with Constraints

Object tracking

Sometimes you need to "restrict" the movement of an object or make it "follow" other objects in the scene. In this tutorial, we'll take a look at one of the Limiters that can be used to make the camera follow an object. This limiter is called " Track To Tracking constraints are used in animation and can save you a lot of time.

Let's take a look at how the limiter works. " Track To"for example. Add an object to the scene that the camera will track. Go to its edit buttons ( F9). For further work, you need to know the name of this object. Call the information window using the " N", change the object name to Actor for convenience.

Now select the camera, go to the Object buttons ( F7). Find the tab here Constraints, press the button in it Add Constraint and select from the list of delimiters " Track To". In the options panel Track To, find the field Target OB: Enter the name of our object in it, that is Actor... After that, a dotted line will appear between the object and the camera, indicating that the camera is tracking the object. If you look into the camera now, you will face one problem - the camera does not see the object! To fix this problem, click To: -Z, as well as Up: Y in the panel Constraints... That's all! Now wherever you move the object - it will always be visible from the camera. There is another way to create an object tracking camera. Select a camera, then an object and click Ctrl T, in the menu that appears, select the type " Track To Constraint".

Constraints panel options:

To: X, Y or Z and -X, -Y or -Z- axes along which tracking takes place. Usually the -Z axis needs to be selected

Influence- The degree of tracking. The lower the value of this field, the weaker the camera tracking the subject.

Target- name of the tracking object

Up- tracking direction is usually "Y"

Sometimes animation uses the Dummy camera tracking technique. This allows more dynamic control of the focus of the camera. For example, you can follow an object (near which the dummy is located), and then change focus (move the dummy). Also experiment with the parameter Influence.

Suppose that an object is moving along some rather long curved track (in our case, the primitive TorusKnot), the movement of which should be recorded by the camera in close-up - this means that at a particular moment in time it is possible to observe only a separate section of the route. In addition, a small fragment of the track with the object at any given time should be illuminated by three multi-colored floodlights resembling multi-colored theatrical spotlights. It turns out that in addition to the movement of an object along a complex trajectory, it is also required to organize tracking of the camera and three light sources. Create plane and object TorusKnot and then adjust the lighting by introducing a weak Omni- a source for general lighting of the scene and three directional spotlights, for example, with rays of blue, red and green colors and small light cones (in this case, the parameter Hotspot/Beam is equal to 10, and Falloff/Field- 20) - fig. 41. Add a path in the form of an arbitrary curved spline and move the object to the beginning of the path (Fig. 42).

Let's animate the movement of the object. Create a dummy object and arrange its movement along a trajectory (command Animation=>Constraints=>PathConstraint with included on the panel Motion flag Follow). Link an object TorusKnot with the dummy object and align it with the dummy object on all three axes, make sure that when the animation is playing, the object TorusKnot makes the planned movement along the trajectory.

Now you need to configure the tracking of light sources. In our case, the sources directed ( TargetSpot), that is, they already have a controller LookAt(Look at) restricting their rotation so that they are always aimed at their targets. Therefore, the most simple solution appears to be targeted Dummy-object, which will automatically lead to the fact that the sources will always be directed to the moving object. To do this, it is enough to select the first source (without a target), on the panel Motion open scroll LookAtParameters(Controller options "Look at"), click on the button PickTarget(Specify target) and specify an object in one of the projection windows Dummy 01 (fig. 43). Then this operation should be done with respect to the other two sources. After that, the light sources will really follow the moving object, only now the effect of multi-colored theatrical spotlights will be lost, since all three sources will illuminate the same area of ​​space, which means that their multi-colored light rays will completely merge (Fig. 44). It turns out that the target for each source must have its own, but at the same time all three targets must follow the object Dummy 01. Therefore, create three more dummy objects and place them so that they are in the centers of the supposed light spots (fig. 45). Select all three additional dummy objects and link them to the object Dummy 01 (fig. 46). Now the spotlights will not only follow the moving object, but also illuminate each of its zones, which will ensure the presence of three multi-colored light spots (Fig. 47).

Rice. 43. Configuring scroll parameters LookAtParameters for the first Spot-source

Rice. 46. ​​View of the hierarchical chain after linking additional Dummy-objects

In the window Left create camera, window Perspective replace with the camera projection window (command Views=>Camera from the viewport menu or the C key). Adjust the position and orientation of the camera so that it is directed at a moving object (Fig. 48). Unfortunately, the direction of object orientation will only be maintained for that particular animation frame. Therefore, select the camera (no target), in the panel Motion open the scroll LookAtParameters, click the button PickTarget and specify an object as the target of the camera Dummy 01 (fig. 49). Play the animation - now the camera faithfully follows the object, only the distance between the camera and the object is constantly changing, which makes observation difficult (Fig. 50). So link the camera to the object Dummy 01 (Fig. 51) - now the camera will not only continue tracking the object, but also automatically adjust the positioning, which means that the object will be monitored from the same distance (Fig. 52). Unfortunately, this is not all - carefully review the entire animation, and you will see that the lighting of the moving object by the spotlights at different stages of the animation is not the same, although all three light spots are always present - the fact is that the distance from the light sources to the object changes. The situation is corrected in the same way as the one discussed above with the positioning of the camera - it is enough to associate all three sources with the object Dummy 01 (fig. 53), and then install them at the desired distance from the object. This will lead to the desired result - separate frames the resulting animation is shown in Fig. 54.

Rice. 49. Configuring scroll parameters LookAtParameters for camera

Wiggling the tentacles of the marine life

Let us apply the direct kinematics method to simulate the movement of the tentacles of a certain marine life. First create three base objects - one object Spring 01 and two regular cylinders, place them on top of each other in the direction of the axis Z(this will be the base for the tentacles). In between, include two Dummy-object (fig. 55). Select the object Cylinder 02, open on the panel Motion scroll AssignController(Assigning Controllers), highlight the line Rotation and click on the button of the same name AssignController(fig. 56). In the window that opens, select the option LookAtConstrant(fig. 57) and click Ok. Then click on the button AddLookAtTarget and as the target that this cylinder will look at, specify the bottom dummy object, and in the area SelectLookAtAxis highlight the axis Z(fig. 58). Carry out a similar operation with respect to the object. Spring 01, only specify an object as a target limiting its rotation Dummy 02.

Rice. 56. Button AssignController

Rice. 57. Controller selection LookAtConstrant

Rice. 58. Appointment LookAt-targets to the object Cylinder 02

Now let's assign fading oscillations to both dummy objects, which can be done by adding controllers to them. Spring(Spring). Select an object Dummy 01, open on the panel Motion scroll AssignController, highlight the line Position, click on AssignController, select a controller Spring and increase its parameter Mass up to about 500 (Fig. 59). This parameter is responsible for the strength of the fluctuations - the higher its value, the stronger the fluctuations. In the same way, assign the controller Spring the second mock object.

Rice. 59. Purpose of the controller Spring object Dummy 01

Link an object Dummy 01 with object Cylinder 01, and the object Dummy 02 with object Cylinder 02 (fig. 60). In the mode of automatic key generation in one of the initial frames (we chose the 10th one), move the object Cylinder 01, which is the parent, some distance relative to the axes X and Y(fig. 61). Play the animation and you will see that the tentacle moves (fig. 62). Propagate the tentacles using the operation Array(team Tools=>Array) with parameters as in Fig. 63. This will immediately lead to an array of tentacles (Fig. 64), which can be used to create some fabulous sea creature, only other elements of this creature will have to be connected with the main parent object of the scene Cylinder 01. Due to the large number of objects in the scene, this will be problematic. Therefore, first click on the button SelectbyName, select the objects you want to link. Then activate the tool SelectandLink and click on the button again SelectbyName- a window will open SelectParent(but not SelectObject); specify an object in it Cylinder 01 (fig. 65) and click on the button Link, which will lead to the required binding. Now the tentacles will no longer move by themselves, but together with other elements of the sea creature. The resulting scene in some frames of the animation may resemble Fig. 66.

To see the location of an object on the map, just left-click on the name of the object in the list. The map will be centered on the specified object. In this case, the scale of the map will remain the same. Move around the map and scale it as you like. The card handling methods are described in detail in the Card section.

The map displays only those objects that are marked with flags in the first column of the table. You can mark all objects at the same time by checking the box at the very top - in the table header. Unchecking this checkbox leads to the opposite action - unchecking the checkboxes from all objects in the list. Objects marked with flags in the first column will be displayed on the map, but only when they fall into the part of the map that is currently visible on the screen.

However, if the "Show icons of objects along the edges of the map" flag is set in the user settings, then if an object goes beyond the visible area of ​​the map, its icon will be displayed on the edge of the map. Then it is enough to click on it so that the map is centered on this object.

In order not to lose the current location of the object on the map, also check the box in the "Track object" column. Objects marked with flags in this column are always visible on the map. Upon arrival of a new message from such objects, the map is automatically centered so that these objects are visible.

Also in this section:

-

Two years ago, when I first started doing multicopters, I had to make a small one. Since the quadcopter was conceived to be purely autonomous, all that was required from this remote control was to operate the drone during testing and tuning.

In principle, the remote control coped quite successfully with all the tasks assigned to it. ... But there were also serious drawbacks.

  1. The batteries did not fit into the case, so they had to be tied to the case with electrical tape :)
  2. The parameter setting was carried out on four potentiometers, which turned out to be very sensitive to temperature. In the room, you set up some values, go out into the street - and they are already different, they floated away.
  3. Have Arduino Nano which I used in the remote, there are only 8 analog inputs. Four were busy with tuning potentiometers. One potentiometer served as gas. Two inputs were connected to a joystick. Only one exit remained free, and there are many more parameters for customization.
  4. The only joystick was not pilot at all. Potentiometer throttle control was also quite depressing.
  5. Also, the remote control did not make any sounds, which is sometimes extremely useful.

To eliminate all these shortcomings, I decided to radically redesign the remote control. Both the iron part and the software. Here's what I wanted to do:

  • Make a large case so that you can stuff everything you want now (including batteries), and what you want later.
  • Somehow to solve the problem with the settings, not by increasing the number of potentiometers. Plus, add the ability to save parameters in the remote control.
  • Make two joysticks like on normal pilot consoles. Well, the joysticks themselves are Orthodox.

New building

The idea is extremely simple and effective. We cut out two plates from plexiglass or other thin material and connect them with racks. The entire contents of the case are attached to either the top or bottom plate.

Controls and menus

To control a bunch of parameters, you need to either place a bunch of potentiometers on the remote control and add an ADC, or do all the settings through the menu. As I said, tuning with potentiometers is not always a good idea, but you shouldn't give it up either. So, it was decided to leave four potentiometers in the remote control, and add a full-fledged menu.

To move around the menu and change parameters, buttons are usually used. Left, right, up, down. But I wanted to use an encoder instead of buttons. I got this idea from a 3D printer controller.


Of course, due to the addition of the menu, the remote control code swelled up several times. To start, I added just three menu items: "Telemetry", "Parameters" and "Store params". The first window displays up to eight different indicators. So far, I only use three: battery, compass and altitude.

In the second window, six parameters are available: PID controller coefficients for the X / Y, Z axes and accelerometer correction angles.

The third point allows you to save the parameters to the EEPROM.

Joysticks

I didn't think about the choice of pilot joysticks for a long time. It so happened that I got the first Turnigy 9XR joystick from a colleague in the quadrocopter business - Alexander Vasiliev, the owner of the well-known site alex-exe.ru. I ordered the second one directly from Hobbyking.


The first joystick was spring loaded in both coordinates - for yaw and pitch control. The second one I took the same, and then remake it into a joystick to control thrust and rotation.

Food

In the old console, I used a simple LM7805 voltage regulator, which was fed with a bundle of 8 AA batteries. A terribly ineffective option, in which 7 volts were spent on heating the regulator. 8 batteries - because only such a compartment was at hand, and LM7805 - because at that time this option seemed to me the simplest, and most importantly, the fastest.

Now I decided to do wiser, and put a sufficiently effective regulator on the LM2596S. And instead of 8 AA batteries, I installed a compartment for two LiIon 18650 batteries.


Result

Putting everything together, we got such a device. Inside view.


But with the lid closed.


The cap on one potentiometer and the caps on the joysticks are missing.

Finally, a video on how to configure parameters through the menu.


Outcome

Physically, the console is assembled. Now I am working on modifying the code of the remote control and the quadrocopter in order to return them to their former strong friendship.

In the course of setting up the remote control, shortcomings were identified. Firstly, the lower corners of the remote control rest against the hands: (Probably, I will redesign the plates a little, smooth the corners. Secondly, even a 16x4 display is not enough for a beautiful telemetry display - I have to shorten the parameter names to two letters. In the next version of the device I will install a dot display , or just a TFT matrix.