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

Local space angle sensor (Solved)

Archive: 12 posts


Hey guys,

Inventing all sorts of crazy contraptions at the minute, need a bit of help with a problem I've run into though. Basically, I need a form of local space angle sensor. I have 2 pieces of material bolted together so they can rotate freely, one has an angle sensor on it. When the relative angle of the 2 pieces is more than a set value, I need the angle sensor to be triggered.

For example, if one piece is facing the right (90 degrees), the other piece with the angle sensor should only trigger if it is between 180 degrees and 360 degrees (e.g. 200 degrees). However, the angle sensor only measures absolute angle, so still triggers between 270 and 90 degrees regardless. If you need more details just ask and I'll try to clarify further.

To make things a bit more awkward, I was wondering if there was a way WITHOUT using tags/tag sensors. If not I can work around it, but would be perfect if there was another way. Please let me know either way, It'd be a massive help. Thanks in advance!
2013-05-30 18:28:00

Author:
Mopkins
Posts: 123


It should be possible using 2 angle sensors and compare the values using subtraction. However, this would only work over a 90 degree range, so you would need 4 separate angle sensors set to 360 degrees on each piece of material to cover the full 360 degree range and 8 extra angle sensors set to 90 degrees to determine which 360 degree angle sensors you'll be comparing. It could get very complicated.

I'd use tag sensors set to 90 degrees, it will be much easier - especially since you only need an ON/OFF output.
2013-05-30 19:52:00

Author:
fluxlasers
Posts: 182


I've been trying to compare just the 2 with no luck, didn't know it'd have to be that complicated. The reason I'm trying to avoid tag's/sensors is i'll have multiple of these potentially moving close to each other and I don't want them to mess each other up. Any chance you could elaborate a bit on the angle sensor method? I imagine using selectors is the way to go here?2013-05-30 21:02:00

Author:
Mopkins
Posts: 123


Hmmm.....I'd like if you could elaborate more...
But.....What if you made a circle out of hologram or S.panel. You could then make this to the diameter you require, divide it into 4 segments, delete 3 of them leaving you with a 90degree segment.
You can then set this to whatever layer thickness you require. Then, place an impact sensor on it.
It would only detect what impacts with this sement. This way instead of setting a sensor to be a set angle, the 90degree angle is made for you in the shape of the segment the impact sensor is on.
2013-06-02 14:17:00

Author:
Sean88
Posts: 662


I've managed to solve this problem using angle sensors. In the end I only needed 6 angle sensors, but it required a lot of extra logic.

It is too complicated to explain in detail how to do it here, but basically, I converted the output from the main angle sensors (set to 360 degrees) so that they output a value between -100 and 100 then subtracted them, if the difference was less than 50 then the angles were less than 90 degrees apart. This worked fine apart from when the two angles were within 90 degrees of each other, but on either side of the -100 and +100 crossover point, so I also needed to invert one of the outputs and combine that with the normal output so that it would work for all angles.

I'd still go for the Tag sensor solution, even if it means labelling all your tags differently - it will be simpler and more efficient.
2013-06-03 08:41:00

Author:
fluxlasers
Posts: 182


Ahh, cool. Well done and glad you solved your problem 2013-06-03 12:42:00

Author:
Sean88
Posts: 662


I've managed to solve this problem using angle sensors. In the end I only needed 6 angle sensors, but it required a lot of extra logic.

It is too complicated to explain in detail how to do it here, but basically, I converted the output from the main angle sensors (set to 360 degrees) so that they output a value between -100 and 100 then subtracted them, if the difference was less than 50 then the angles were less than 90 degrees apart. This worked fine apart from when the two angles were within 90 degrees of each other, but on either side of the -100 and +100 crossover point, so I also needed to invert one of the outputs and combine that with the normal output so that it would work for all angles.

I'd still go for the Tag sensor solution, even if it means labelling all your tags differently - it will be simpler and more efficient.

looks like i'm a bit late to the party, but i came up with this today (when i should have been working )
though it is pretty much what you described

http://ib.api.vita.lbp.me/img/ft/3ebf14912f9efba97178c94a0367729c5a4572ad.jpg
2013-06-03 13:18:00

Author:
evret
Posts: 612


That looks/sounds awesome, I'll have a go at putting it together this weekend when I'm less busy. Thanks for your help guys, was on the verge of abandoning this idea. Hopefully it'll be worth it! 2013-06-04 00:37:00

Author:
Mopkins
Posts: 123


All the other techniques will work, but if you don't want it to be so complex you could do it the old LBP1 way. Place a tag on one of the bolted objects and a tag sensor on the other, then edit the tag sensor so it will only activate when the arm with the tag is at a certain angle (aka when the sensor can see the tag). Hopefully this would be a simpler solution. =)2013-06-08 02:28:00

Author:
BLAHBLAH1000
Posts: 72


That method has been mentioned several times already, and but said he need a few that can pass over each other and didn't want to have different tags on each to avoid interference2013-06-08 03:46:00

Author:
evret
Posts: 612


looks like i'm a bit late to the party, but i came up with this today (when i should have been working )
though it is pretty much what you described

I've been trying to make sense of what you and fluxlasers said, and I've managed to get somewhere with it but it's not quite working. I've tried exactly what you've achieved in the picture, but I feel I've set up the angle sensors differently and that's why it's not working, and was wondering if you could fill me in a little more?

**EDIT**
Got it working now after a lot of playing around, works a treat. Thanks for all the help from everyone!
2013-06-08 22:30:00

Author:
Mopkins
Posts: 123


yeah i should have mentioned a few things about my pic, the angle sensors above the selectors are set to 360 degrees, the sensors to the left of the selectors are set to 180 degrees. also the red combiners and splitters are inverted, i always change them to red when i invert them so i dont forget they are inverted. 2013-06-09 03:09:00

Author:
evret
Posts: 612


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.