How to get the data that you wear the Apple watch on your left-hand or right-hand - watchkit

I want to get the data that you wear the Apple watch on your left-hand or right-hand.
In addition, I hope to know the way to get the data that your Digital Crown is on the right or left of the Apple watch.
However, I cannot find the way to do it.
Please teach me how to if you know the way.
Thank you in advance.

WKInterfaceDevice.current().wristLocation
https://developer.apple.com/documentation/watchkit/wkinterfacedevice/1650810-wristlocation
WKInterfaceDevice.current().crownOrientation
https://developer.apple.com/documentation/watchkit/wkinterfacedevice/1650805-crownorientation

Related

Halcon - detect bright spots compared to local surroundings

I'd need to detect bright regions in the image. Would be quite easy with threshold. But I need to get spots that are bright compared to its surroundings, not based on an absolute value.
What would be a good way to do this?
Unfortunately I do not have sample images at the moment.
If your background does not have too much texture, you can try the 'local_threshold' operator.
There is a nice example of it included with HDevelop demonstrating the operator for OCR purposes.

Ue4 TiledMap Generation in 3d

How i can generate a Island shaped 2d Map with tiled cubes? Does someone can give me tipps or links or some other help please?
I already tried it with Noise but it ends in weird results cause i dont get how i use it in a 2d way.
Also i tried to give each tiles numbers so i knew what was the last placed tile.
But that ended in a big Chaos.
What i dont understand right now is how to "move" in that grid or how to know what was last and what could be the next and ye.
I really guess there is a simple way to handle that all which i dont realize at the moment?
I work for right now only with BP.
Thanks

Recognize line of plants

I am trying to build an alternative to the standard line-following robot. I would like it to recognize a row of plants and follow it.
The challenge is to see a row of plants and recognize it as that. It is naturally not a solid line, but will be planted neatly in a row. It will be surrounded by weeds etc that do not grow in a neat line.
I would just like some pointers on how to approach this. Is this even feasible using Arduino?
you might need CMOS camera, and maybe RGB readings from it, then apply computer vision algorithms to try to differ the plants from everything else. Too much complicated in my opinion. But yes check the Sensors from Digikey and see maybe you could you a laser or lidar to measure the distance from reference points and then implement PID on top of that, but then you need at least Arduino Due or higher. ATMEL SAM etc...

AutoHotkey: Mapping arrows key to PS3 pad buttons?

PS3 D-PAD in Windows generates arrow key output (just like if you pressed UP DOWN LEFT RIGHT on the keyboard) insted of decent POV - which is hopeless.
So I want to map keyboard arrow keys output to PAD buttons (i.e. 7,8,11,12) using AutoHotkey script (the best thing would be to map them as POV but I am too "short" to figure that out).
I checked the pad device number and UP/DOWN/LEFT/RIGHT key codes and came out with this:
SC14B::Send {3Joy11}
SC14D::Send {3Joy12}
SC148::Send {3Joy7}
SC150::Send {3Joy8}
Unfortunatelly the only thing this script does is block use of arrows in notepad...
I also tried to assign the mapped arrows to D-pad using x360ce controller emulator but it still detects arrows as arrows, not as pad buttons.
What am I doing wrong?
I love answering my own questions :)
So as it turns out from AutoHotkey documantation, it can only listen to Joy input but cannot generate it. For this purpouse there is another peace of software: PPJoy.

AI Snake BFS Issue

I am working on solving snake boxing itself problem. I believe that If I use Breadth-First Search (BFS) to make a move, it can reduce the risk of being boxed greatly. My question is how many possible empty spaces (connected) I should look for to make sure that this move will not result in boxing myself.
The distance you have to look to see if you are boxed in is always going to depend on the size/position of the snake. The only way to be 100% sure is to search all moves in advance, and avoid moves that lead the snake to be boxed in. That said, you might have better luck with a depth-first search over breadth-first, because it can rapidly find a dead end (if it exists). Then avoid those moves. In your second example, depth-first would quickly find that moving "up" is a dead end.
I think the number of moves deep you need to search the game tree is related to the square area the snake can contain when it encircles itself. For example, a length 12 snake:
----
|00|
|00|
91--
If the snake goes up (north), it can still live but only if it then goes east. if it goes north again, then it dies.
The maximum area a snake can contain is: (length/4 - 1)^2. When this is fractional, you probably want to round up.

Resources