Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Tutorials
#1

Equally Spaced Objects

Archive: 5 posts


This is a tutorial specifically for someone who made a post in the 'Help' section.

I'll begin by covering how tag sensors work when determining a DISTANCE as a SIGNAL.
(The first image shows ZERO%, not 10%)

42325

42330

42326

From these three images it can be seen that the signal received by a tag sensor with the 'distance' setting is a measure of the distance between the tag and the maximum detection range of the tag sensor.

Now lets look at tag sensors with VERY LARGE detection ranges.

42327

From this picture we can see that the distance between a tag and a tag sensor can be given by 100 - the tag sensor signal (the signal being received). We can simulate this calculation simply by plugging our received signal into a NOT gate.

x = 100 - Signal

Great, so now we have two objects and we can represent the distance between those objects as a signal. But we want to put another object between them which will always be half way between both objects.

Lets look at another example to help us imagine the scenario.

42328

In this picture, the circle is the object that we want to sit half way between the two squares. we can see that it's distance from one of the squares can be given by:

A = P - S

Where S is the received signal, P is the signal given by the position of the circle and A is the distance between the square and circle. If we want the circle to sit halfway between the two squares we need the distance between either of the two squares and the circle to be (x/2) where x is the distance between both square, as shown earlier.

42329

From this image we can see that it would be ideal if:

A = (x/2)

Therefore..

A - (x/2) = 0

How to divide signals: https://lbpcentral.lbp-hub.com/index.php?t=74799-Division-of-Signals

If we want this to be true we can make it so with an advanced mover set to SPEED SCALE. By subtracting (x/2) FROM A and plugging the resulting signal into our speed scale advanced mover, you will find that the circle will move closer and closer to the point half way between the two squares. As the circle approaches this point the resultant signal will draw closer and closer to 0% at which point the circle will stop moving. If either of the two squares are moved, the resultant signal will change and force the circle to move to a new position which is half way between the two squares.

A great exercise to familiarise yourself with logic would be to try to understand WHY the circle will always move TOWARDS the mid-point and never away. A small hint is that it has to do with how NEGATIVE and positive signals work with the SPEED SCALE setting.

It is important to set your advanced mover to have 100% acceleration and deceleration as well as 100 as its max speed.
2012-10-15 08:18:00

Author:
Seku
Posts: 65


being completely honest, i dont understand this tutorial, and i already know how to do what your trying to show.......

regarding tag sensors- they send an analogue signal that moves between 0% to 100% as a tag moves from the max sensor range to the min sensor range.

2 points side by side but with a fair distance between. each has it's own tag, i'll just call them left tag and right tag.
piece of material in between with a chip on it, on this chip have a sensor for left tag and a sensor for right tag, a combiner and an advanced mover.
wire the left tag sensor to the positive input of the combiner, right tag sensor to the negative input. then wire the combiner to the left/right input of the mover.
when the center object is closer to the left tag the left tag sensor will output a higher signal than the right tag sensor and cause the combiner to send the mover a positive signal which will move it right. it will keep moving right untill both sensors output the same strength signal which will cancel each other out via the combiner. it would move left if it is closer to the right tag.

however i would be interested in learning the method that considers angle (you mentioned in the other thread), i have messed around with it b4 but i suck at maths so the actual equations elude me...... :S
2012-10-15 09:58:00

Author:
evret
Posts: 612


Doesn't use complicated mathematics, it's just an application of polar co-ordinates which, for this scenario, prove to be very useful. I can show you on LBP, perhaps you'd understand if you saw the logic yourself rather than reading a tutorial.2012-10-15 10:28:00

Author:
Seku
Posts: 65


if you mean where there are external points of reference then i already know what your talking about. but i thought you meant the trig based method where Sin Cosine etc is used2012-10-15 10:53:00

Author:
evret
Posts: 612


There aren't external points but it doesn't use trig either, just uses the angle sensor and the two boxes2012-10-15 11:43:00

Author:
Seku
Posts: 65


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.