W1siziisijiwmtuvmdgvmdevmtgvmjivndkvni9ibhviyi5qcgcixsxbinailcj0ahvtyiisijmwmhgzmdajil1d?sha=0f4e199a32d06e57
Building a Quadcopter - Part 2: Making the motors rotate

Building a Quadcopter - Part 2: Making the motors rotate

Preparing the hardware

The Afro ESC supports different ways of communication (PWM, I2C, UART), but PWM is most common for these and those pins are nicely exposed with a JR-Style Servo cable.

The Edisons PWM block did just have the pins exposed as some holes, so I got cables with the counter part (based on the form of the actual contacts, the ESCs have female connectors, so I needed male ones, but based on the overal form of these it would be the other way around, and both ways are sometimes used…).
I soldered those cables to the board and connected a jumper for it to use the system voltage to power the PWM, otherwise I would have had to connect an additional power source to the PWM board.

Also these ESCs have a BEC exposed via the same cable, which is unless otherwise stated a 5V source which can be used to power things. In my case it provides a current of up to 500mA, which causes this to be perfectly within the USB specifications.
The BEC is between the red and brown cable coming from the ESC, while the PWM signal will need the orange and the brown cable. Thus I did not attach the red cable to the Edison via the PWM block but instead cut a micro USB cable in half and attached the BEC of one of the ESCs to the USB cable and plugged it into the Edisons base block to power it with. I didn’t not use the power block or anything because the Edison does not support full 5V, but the baseblock does some magic to make it work with USBs 5V.

image

Talking to the ESCs

PWM or pulse width modulation works by sending a high signal for some amount of time and the receiver measures how long the high signal was sent and knows what to do based on that time.
A high signal is anything above 1.5V or something for most of the RC stuff.
In general in the RC world the high signal (or pulse) has a length of around 1ms to indicate a minimum value (the motor does not rotate/the servo gets rotated to its lowest position) and a length of about 2ms for the highest value (motor at full speed/servo fully rotated). Looking at the sparse documentation of these ESCs I found a lowest value at 1060μs and the value for full power at 1860μs.

Mostly for safety reasons ESCs usually don’t allow to start with a rotation, instead wait for an arm value which is something below the minimum value and once that was sent at least one time a speed can be provided.
I used an arm value of about 1000μs but it can also be somewhat smaller and bigger.

The signal needs to be sent constantly though. Any frequency higher than 20Hz or so works, but due to the way some ESCs work there is a habit of sending at much higher frequencies. Just keep in mind that to send a 2ms signal you can’t go faster than 1s/2ms = 500Hz. I am currently sending at around 400Hz.

PCA9685

That is the PWM controller used by the Sparkfun block. It is made for dimming LEDs, but also works for other usecases…
It supports 24Hz up to 1526Hz, communicates via I2C and has a 12bit resolution of 4096 steps.
The 12 bit resolution means that when for example operating at 100Hz the resulting 10ms (1s/100) are split into 4096 evenly spaces parts and the pulse length has to be a multiple of 10ms/4096 = ~0.0024ms.
And instead of sending a time to the PWM controller, it expects a number of steps. The PWM controller then scales this with the value it knows based on what its pre scale register is set to. This same pre scale register also sets the signal frequency.

The code

Fortunately Sparkfun provides some code for the PWM block which takes care of the I2C communication and provides some functions to set stuff (but none takes a time directly…).

So far I just wrote some very minimalistic wrapper over their code initializing everything with what they provide as “servo-mode”, set a higher frequency (prescaler to 14 for ~400Hz) and then send an arm signal.
Once that is done a speed as value between 0 and 1 can be set for each motor.

I thought I figured out the math for the correct timings, but it turned out that the actual number of steps was quite different, so my math was probably wrong…
I found those by trial and error (prescaler 14):
Arm - 1730
Minimum - 1960
Maximum - 3500

The code is on github.

My toolchain

The Edison runs Yocto in the latest version for it provided by Intel.
I am connecting to it via SSH over Wifi and compile directly on it using GCC.
My IDE of choice is CLion which bases it’s projects on CMake and has a feature to directly transfer the files to a server which in my case is via sftp to the Edison.
I plan on improving it by adding custom build configurations running the same stuff I currently use the terminal for, but I am not sure if that will really make anything better…

Profit!

Building a Quadcopter - Part 1: General idea and selecting parts

Building a Quadcopter - Part 1: General idea and selecting parts

Inspiration and helpful sources

A bit more than a year ago I bought a 3D printer because I really wanted to and argued with the idea that I’d like to build my own quadcopter at some point and would need it to print parts for it.
Inspired by first person view multicopter racing videos on youtube I did decide on some nice efficient and cheap motors at some point but didn’t go through with buying anything.
Now the motors I selected back then are quite hard to come by so I decided to start the search for parts from scratch again.

Having no idea of anything related to this about 3 weeks ago it turned out that while all the information is out there some of it is quite scattered which is why I am documenting my steps here.

A good general introduction to get started is this article about multicopters.
I also got some useful advice from this forum thread.
This first part will mostly just put the key information of those two sources into one place based on my build and experiences so far.

General idea

I have no idea of hardware, electronics and soldering. Okay maybe I have some basic understanding, but it is very shallow. I am a programmer though, so using a ready to go flight board was out of question.
I already had the microcontroller of my choice and will introduce it here in a bit and write about the software in later parts of this series.
What I expect from my quadcopter is that it is exactly that, with 4 powerful motors and a size that fits my room for testing but big enough for an easy stable flight outside even if there is a tiny bit of wind.
I plan on adding a camera, want it to look kinda nice and most important: Be able to print the frame with my 3D printer. I also expect to break things, so things need to be easy to replace.
Since I don’t want to get too deep into the electronics, I do need some presoldered parts.

The microcontroller

A quite expensive but powerful, low energy microcontroller which seems great for this is the Intel Edison which features a 500MHz dual core Atom CPU and a 100MHz Quark MCU (for hard realtime applications), 1GB RAM and on board WiFi and Bluetooth in a very small form factor and an energy consumption of <1W.
There are some arduino board for the Edison which would open a lot of possibilities but add a lot to the size. Fortunately Sparkfun has a line of small blocks made to interface with the Edison which can be stacked easily on top of each other adding functionality.
One of those blocks features powering it via USB, another one adds a 9DOF unit with gyroscope, accelerometer and magnetometer which will be required for stable hovering and flying and then there is a PWM block, which will be needed to talk to the speed controllers to get the motors to spin and I also attached a display block with some minimalistic buttons and a small OLED display.

I already had everything but the PWM block already, so this was an easy choice for me. My alternative would have been a Raspberry Pi because I got one of those too and with a much larger community there is a lot more information about it. But adding all the required hardware would probably have made this harder in terms of putting the electronics all together and would have ended up to be a lot bigger.

There are many other possible choices and there are also different plug and play flight boards for multicopters, which is what most people seem to use.

Cables

I just bought everything from Hobbyking and didn’t waste any thoughts on the cables/plugs of the items. Mine fortunately all turned out to fit, but there are many different types and you should definately keep an eye on them. So the motor cables should fit the esc, and the esc cable needs to interface the battery and the microcontroller in some way. Sure you can just not use plugs between the parts, but that isn’t really fun either. So you should make sure everything fits or get parts to make it fit.

The motors

The choice of motors is really big, but common for multicopters are brushless outrunner motors, which I believe means that they don’t have a “brush” inside to make them spin by changing the electro magnets direction and also the elctro magnet does not rotate but instead the part around it which would be fixed in a “classical” motor. This reduces friction, improves reliability and makes it more reactive due to less mass being moved.
The disadvantage is that the motor on it’s own does not rotate just by attaching a batterie to it. Instead it provides three cables and requires a microcontroller to do a job similar to what the “brush” would do for other motors.
These microcontrollers are called “Electronic Speed Controllers” or ESC in short. They will be attached to the motor, the battery and the flight board and use all that to control the rotation speed.

This already reduces the choice of motors significantly but it is still large. apparently you want a smaller, faster motor with a smaller propeller for fast and reactive controls on small multicopters, but bigger and slower motors with bigger propellers on bigger multicopters wich are easier to handle and have a much more stable flight.
The speed is usually given in “Kv” which is a constant for the motors RPM per Volt.
A Kv over 2000 seems to be really big and a Kv smaller than 600 is quite low, so most multicopters use something between that and around 1000 appears to be quite common for a multipurpose build.

Besides the speed, it is also important to take a look at the motors thrust data. It is usually given in form of a table or diagram showing test data of using the motors at different voltages with different propellers at different speeds and how big there power consumption will be in that configuration.

A good starting point for the thrust is that the complete multicopter should at least have a thrust of twice its mass. My guesstimate was that in the worst case my build would weight around 1.5kg which means that each of the four motors needs a thrust of 3kg/4 = 750g per motor or more.

I settled on the Multistar Elite 2312-KV980 in a pack of two one for clock wise rotation and one for counter clock wise, which usually is a matter of just switching two cables, but these are for threaded quick mount propellers. And while the correct rotation direction just keeps the propellers perfectly in place the other one would losen them and have them quite immediately fly away.
These motors have a Kv of 980 and a maximum thrust of 840g with 11.1V and will usually not need more then 10A + some spikes.
They cost about 17€ per motor.
I also got M3x8 hex screws to mount the motor to my frame with.

Propellers

I just went with the recommended ones from the dataset. Self tightening 9450 propellers. 9450 refers to the length in inch, which is 9.4inch and the pitch, also in inch which is the distance the propeller would travel through a solid (if it could) with a single rotation.
There are many others, but propellers are quite cheap and easy to replace, so I’ll may or may not experiment with these at some later point.

Battery

Currently the best choice for batteries for pretty much everything seem to be Lithium-Polymer batteries. There are three important values: The voltage/cell count, the capacity and C rating.

Those batteries are made out of cells and in a standard LiPo battery one cell has an average voltage of about 3.7V. A so called 3 cell battery has three cells in sequence, resulting in a voltage of 11.1V. Bigger motors may need more than that, smaller ones may need less. You don’t have to use the maximum supported voltage of a motor, but you shouldn’t go higher than that.
Just use what according to the motor data seems like a good start. In my case that is a 3 cell battery.
The voltage of a full cell is around 4.2V and should not get lower than 3V (it can, but won’t be good for the battery).
I got this small indicator which can be attached to a battery and will indicate if a cell is “too empty”.

The capacity is important for the flight time, but a higher capacity also means a bigger battery with more weight, so more capacity can also cause a shorter flight time if it means that the motors have to run much faster just to generate enough thrust.
The capacity is given in Ah or mAh. So if the battery has a capacity of 4Ah, you can draw 4A for 1h until it is empty. Assuming my 4 motors would draw an average of 40A during the flight I could fly for 4Ah/40A = 0.1h = 6mins. Because that battery is already really big I hope that in reality the motors will draw less power on average…

The C rating was new to me and refers to the discharge rate of the battery. Because if the battery only allows you to draw 20A, but instead you keep drawing 40A all the time, bad things may happen. The C rating is some kind of multiplicator to the capacity. So if the 4Ah battery has a discharge rating of 25C, it means that it is okay to draw 25*4A(h) = 100A. Often the batteries have two C ratings like this: 25-50C discharge, where 25C is the power you can easily draw all the time, but if the are some peaks of up to 50C that won’t immediately break the battery.

You should also keep an eye on weight and size.

I got two batteries. Both with 3 cells and 25-50C discharge and one big one with 4000mAh and a smaller one with 3300mAh.
I also got a distributor cable, branching each of the quite thick battery cables into 4 thinner ones fitting the ESCs.
Also a LiPo charger, but the included cables don’t fit my batteries, so I am currently waiting for fitting ones.

Speed controllers

Apparently everything works for these. The ones running the open source SimonK firmware are supposed to be the best for multicopters but some other can be flashed with it. They do come with a current rating. So you shouldn’t use a 10A ESC with a motor drawing 20A. It however is no problem to use a 30A ESC with a motor drawing just 10A.

I got 4 of the 30A Afro ESCs.

Conclusion

I took about two weeks for the parts to arrive from Hongkong. I ordered 6 instead of 4 motors and 5 instead of 4 ESCs as well as 4 additional propellers, in case something arrives broken or gets broken by me. So far it all works though :).

image

Building a Game for multiple Platforms with SFML

Building a Game for multiple Platforms with SFML

We used SFML for our Gamejam Game Huitzilopochtli and it fully supports Windows, OSX and Linux and has experimental support for iOS and Android.
The only Libraries used were Box2D and SFML. SFML has a couple of dependecies though.

We used CLion as IDE which uses cmake files for the project.

In total it took about two additional days to get it running on all the different platforms (except Android, yet).

Windows

Using the cmake UI I did set all the missing library paths manually (which kinda isn’t the point of cmake…) but once I had it all setup I generated a Visual Studio project and made a release build. The SFML dependencies are all in its repository in the “extlibs” folder.

I would have made it an x64 build, but I didn’t set that up correctly for Box2D which is linked statically and thus settled with a x86 build.
Then I copied the games executable, assets folder, SFML DLLs and the openal DLL from the SFML dependencies all together in one folder and it just worked.

Only issue is that I built it with VC++14 which is the latest and most people don’t have the runtime installed. So I packaged the runtime installer with the game.

Linux

I don’t have Linux setup on any system, so I installed VirtualBox and setup a virtual machine with the latest version of openSUSE.

I started with installing cmake and g++ and then tried generating make files for SFML and installed dev packages until it stopped complaining about any missing dependencies. Finding the correct names for those packages wasn’t much fun, but I figured them out eventually with the help of google. And unfortunately can’t remember those names anymore…

Compiling and installing Box2D did again just work and so did installing SFML once it was build.

Then cmake could do its magic on Huitzilopochtli and again there were no complications.

The tricky part was putting it all together. I started by putting the executable and the assets in the same folder and added the shared libaries for SFML together with the symlinks to them, since the project was linking against some of those.

I made another clean installation of openSUSE and also one with the latest version of Ubuntu and tested it on both. For openSUSE I was just linking against a much newer version of libjpeg and on Ubuntu openAL was missing. So I added both to the folder and was done.

One texture didn’t load which was due to Linux being case sensitive for file names.

OSX

I was developing on OSX so I didn’t expect there to be any issues, turned out I was wrong. The working directory relative to which it was looking for the assets was not the same the executable was in.

To solve this I put everything together into an App-Bundle which has a quite strict structure. It is a folder with a folder inside that is called “Contents” which includes an “Info.plist”, “PkgInfo”, a “MacOS” folder including the executable and in my case the sfml dylibs and symlinks, a “Frameworks” folder containing the frameworks SFML provides in the “extlibs” folder and a “Resources” folder containing the assets.
Since this way I know where the assets are I added some code for OSX release builds generating an absolute path to the assets and appended the assets relative paths to it everywhere they are loaded in the code.
Getting the path looks like this:

	CFBundleRef bundle = CFBundleGetMainBundle();
	CFURLRef url = CFBundleCopyBundleURL(bundle);

	CFStringRef urlString = CFURLCopyPath(url);

	const char *file = CFStringGetCStringPtr(urlString, kCFStringEncodingUTF8);
	_resourcePath = file + "Contents/Resources/";

Another problem was the executable searching for its dependencies in a wrong place. The solution was to use “install_name_tool” to set the rpath to the executable path:

	install_name_tool -add_rpath @executable_path Huitzilopochtli 

The resulting app bundle did work (I double checked it on an old Mac Mini on which I had just reinstalled the OS), but refused to open the first time when just double clicking it. You could do a “Right Click -> Open -> Really Open” but that is not much fun. The reason for this was that I hadn’t codesigned it.
So I generated a new OSX developer profile on apples dev center and codesigned all libraries, frameworks, the executable and finally the whole App-Bundle:

codesign --force --verify --verbose --sign "Developer ID Application: Nils Daumann" Huitzilopochtli

The result seems to work without any issues now.

iOS

This took me a while to figure out, but is also working very well now.
At first SFML needs to be build for iOS. To do so the “IOS” define has to be set to “TRUE” and I generated an Xcode project which may or may not be needed for this.

ccmake -DIOS=TRUE -G Xcode ..

I like to use ccmake instead of just cmake in case I want to change some settings… I may or may not had to enable OpenGL ES, not sure.

Then I setup a new xcode iOS Objective-C Game project and only kept the “LaunchScreen.storyboard”, “Assets.xcassets” and “Info.plist”.
Then I added all of Huitzilopochtlis header and source files to the new project and a reference to the assets folder (this way it keeps the folder structure when copying the files to the App Bundle). Instead of statically linking Box2D I also just added all its source and header files to the project, which is not great, but was the easiest way to make it work without setting up another Xcode project for it with the correct architecture.
On the build targets “General” Tab I removed the “Main Interface”. (Otherwise it will crash on startup)

I also had to set the header and library search paths to the correct folders for the SFML libs and its dependencies as well as the Box2D include path.

This made it compile, but caused lots of linker errors. So I added the SFML libs and extlibs to the xcode project as well as “Foundation.framework”, “QuartzCore.framework”, “OpenAL.framework”, “OpenGLES.framework”, “UIKit.framework” and “CoreMotion.framework”.

But the libraries coming with SFML were not build for arm64, to fix this I also had to set the “Architectures” to $(ARCHS_STANDARD_32_BIT) in the projects “Build Settings”.

The result compiles, links and runs! But it renders in a low resolution ignoring the “retina screen”. But SFML checks the “Info.plist” and supports the “NSHighResolutionCapable” key. Just set it to “YES”. The last issue with this was that orientation changes messed everything up and just forcing one landscape orientation in the plist didn’t work out. I settled with hacking it into SFML, which was overriding my settings.

I also had the status bar appearing for a short moment during startup of the app. A solution was setting “UIViewControllerBasedStatusBarAppearance” to “NO” in the “Info.plist”.

I added touch controls and it is quite awesome :).

image

Edit: Apple only accepts 64bit builds for the Appstore, so I recompiled all the dependencies and somehow got it to work at some point…
I did submit it for testflight and they accepted it, so they probably won’t refuse it on the Appstore for anything SFML related and the game might get away with a rating of 12+.

tvOS

I applied for an Apple TV Dev Kit and first got an email telling me that I won’t get one, but another email two weeks later telling me I could get one from a second batch. So of course I did, but didn’t really got to use it yet and since I am already on a roll with porting this game to every platform I can, I decided to give it a try.

I started out with what I had for iOS but set the SDK and target for the Apple TV. It did complain about the CoreMotion framework not being supported, so I removed it and then it complained about all the used libraries not being compiled for tvOS.
I started out with recompiling SFML which unfortunately uses some unsupported features which are CoreMotion and anything related to device rotation.

I fixed all those issues by putting the poblematic code in blocks excluding it for tvOS build:

	#if !(TARGET_OS_TV)
	//code...
	#endif

Once I could build SFML I tried compiling Huitzilopochtli again and it was still complaining about the dependencies of SFML. It turned out that for some reason libjpeg was not needed, so I just stopped linking against it. Also I recompiled all the other dependencies.

Somehow the FLACiOS project I found includes a couple of main functions which got in a conflict with the one from SFML, so I just removed all of those from its code…

The resulting game just works with the Apple TV remotes touch surface and even the audio is playing flawlessly.

Android

I didn’t do this yet, but will add it here if I do.

In reply to: need.computer/puf590
How did I not think of that!? I’ll totally look into it.

#iggj9

Every couple of months InnoGames in Hamburg organizes a game jam. Everyone interested can participate and they even pay for food. And with 185 registrations and 34 games created it is also very big (the biggest game jam in Germany according to them, lacking any real competition though…).
This was the fourth time I participated and it was from Friday evening until Sunday evening.

This time I went alone and as always without a team. After the theme “Strange Rituals” was announced I went to the stage as everyone else still looking for a team or someone to join their team. Almost instantly two girls found me looking for an additional programmer for their really big team which they wanted to split in two, so of course I said yes.
After finding some ideas we split the team of 12 into teams of 5, 4 and 3 people each one following one of those ideas.
So my final team consisted of Katharina, Michaela and Thomas doing the graphics and Oliver and me for the programming.

We had no idea what technology we wanted to use and after some research settled with SFML which both of us programmers had never used before. It was easy to use but is not exactly game ready so we spend the first day creating some kind of framework to make our game with.
For physics we used Box2D.

After very little sleep, lots of Red Bull and Pizza we finally had something playable on Sunday, did some finishing touches and then failed miserably when making our final build…
We somehow managed to get a working windows build eventually, but we still don’t have an OSX build and I’d also like to make one for Linux. The problem are the assets paths which would need some tweaking in the code to work.

Our final game is about sacrificing animals and humans to the Aztec god Huitzilopochtli by pressing the correct arrow key on your keyboard. If you are too slow you will lose a life. Also sometimes a baby makes it to the altar which you should save (by again pressing the correct button).
We got ragdolls and lots of blood and it all looks and sounds pretty good.

The game can be downloaded from the game jams game page.

image image image

After all games were submitted, every team had 3 minutes to present their game to the crowd, which even though we didn’t test before worked out amazingly flawless for us.
After about 2 hours of presentations the voting was supposed to start but unfortunately their website couldn’t handle it.
So “they” decided on the very cool Füchseprellen as winner.

It was lots of fun, lots of hard work and very exhausting and I’ll totally do it again.

#iggj10 will be during the Global Game Jam in the end of January.

Thanks to InnoGames for hosting such a great game jam!

That sounds like a lot of fun indeed! :)

Sadly i’m not a game developer, so my judgement may be flawed, but this looks really cool for just a couple of development days.

I like the drawing style and i bet it would make a great mobile game, since you only have to swipe up/down/left/right. Not sure how this would comply mit Apples rules (since there’s a lot of blood) but i think this could work quite well!

How did I not think of that!? I’ll totally look into it. Thanks :)

#iggj9

#iggj9

Every couple of months InnoGames in Hamburg organizes a game jam. Everyone interested can participate and they even pay for food. And with 185 registrations and 34 games created it is also very big (the biggest game jam in Germany according to them, lacking any real competition though…).
This was the fourth time I participated and it was from Friday evening until Sunday evening.

This time I went alone and as always without a team. After the theme “Strange Rituals” was announced I went to the stage as everyone else still looking for a team or someone to join their team. Almost instantly two girls found me looking for an additional programmer for their really big team which they wanted to split in two, so of course I said yes.
After finding some ideas we split the team of 12 into teams of 5, 4 and 3 people each one following one of those ideas.
So my final team consisted of Katharina, Michaela and Thomas doing the graphics and Oliver and me for the programming.

We had no idea what technology we wanted to use and after some research settled with SFML which both of us programmers had never used before. It was easy to use but is not exactly game ready so we spend the first day creating some kind of framework to make our game with.
For physics we used Box2D.

After very little sleep, lots of Red Bull and Pizza we finally had something playable on Sunday, did some finishing touches and then failed miserably when making our final build…
We somehow managed to get a working windows build eventually, but we still don’t have an OSX build and I’d also like to make one for Linux. The problem are the assets paths which would need some tweaking in the code to work.

Our final game is about sacrificing animals and humans to the Aztec god Huitzilopochtli by pressing the correct arrow key on your keyboard. If you are too slow you will lose a life. Also sometimes a baby makes it to the altar which you should save (by again pressing the correct button).
We got ragdolls and lots of blood and it all looks and sounds pretty good.

The game can be downloaded from the game jams game page.

image image image

After all games were submitted, every team had 3 minutes to present their game to the crowd, which even though we didn’t test before worked out amazingly flawless for us.
After about 2 hours of presentations the voting was supposed to start but unfortunately their website couldn’t handle it.
So “they” decided on the very cool Füchseprellen as winner.

It was lots of fun, lots of hard work and very exhausting and I’ll totally do it again.

#iggj10 will be during the Global Game Jam in the end of January.

Thanks to InnoGames for hosting such a great game jam!

VR is awesome

VR is awesome

Lately “Virtual Reality” or “VR” in short is being turned into this next big thing so I decided to write about my past and present experience with it.
Mostly I am going to show off my cool toys here :D and also share some maybe interesting insights and experiences I had with them.

Color filters

When I was around 15 in 2005, I’ve been dreaming about building a realistic simulator for gaming, consisting of a treadmill and two displays in front of the eyes covering my complete field of view and I never really gave up on that.
So a first step into that direction were 3D glasses using color filtering, because I couldn’t effort shutter glasses which at that time only worked with CRT monitors and weren’t produced anymore.
Color filtering glasses, ideally using red and cyan did support some color and were even supported by some early NVIDIA stereo drivers which kinda worked with some games. The first game I spend a lot of time with in 3D was TES: Oblivion and it was awesome. Sure shadows didn’t really work and neither did reflections and the colors were a bit off, but that was a tradeoff I was willing to take.
At that same time I also started getting into game development and computer graphics using Gamestudio and I spent a lot of time integrating stereo rendering for those red/cyan glasses into everything I created.

image

My experience with these is that they do work best with greyscale images, but do also allow for limited colors if you accept some ghosting.
My usual approach was to just take the red channel of one eyes image and the green and blue channels of the other one. Which might fail if there is no red in the image or if it is all red.
The red feels darker than the cyan which causes some inbalance between the eyes which can feel a bit uncomfortable.
This could probably be improved by making things a bight brighter and maybe blending in some of the color from the greyscale images if the image is lacking a specific color channel. I didn’t think of that though when I made it and was quite happy with what I had.

image

Something I did experiment with was the angle of the cameras and their distance. Too much distance or too much of an angle makes looking at the images a lot more exhausting or even breaks the experience at some point. The distance of the camera or eyes should ideally match that of your real eyes within the scale of the game world, more distance makes the stereo effect stronger and and less makes it weaker. The angle defines which distance comes out of the screen and which goes beyond it, because thats where two rays emitted from the cameras into their looking direction would cross. I usually made the cameras look into the exact same direction placing the sceen plane in an endless distance. It tends to be a bit strange but seemed to work better for me.
Two things you should never do in my opinion is to cutoff things coming out of the screen at the edges (lots of movies still do this even when they don’t have to) and convert 2D images to stereo, while it somewhat works it is always an inferior experience.
During this time I also got pretty good at staring at side by side stereo images with parallel or cross view :P.
Then avatar came out and people started talking about this 100 years old technology as if it was something totally new and modern…

Head tracking

Something that did inspire me a lot was this video:

And as a result I bought a wii remote, but never used it for head tracking. What I did do though was create my own “bright light tracking” using a webcam and a flash light:

I still think that the concept of controlling the character by looking into the direction you want it to go is quite promising.

my3D

Somewhen in 2009(?) I was asked to help out with some shaders for an iPhone game made with Unity (yes, it was even worse back then, than it is now) for Hasbros’ my3D. my3D was a cheap ($25) viewer for 3D content on iPhone and iPod Touch which was not very successful and taken off the market only a few month after their US release. They probably regret that decision by now…

image

Especially with an iPhone 4 and 4s and their retina screens this could have been great if only the content was good. The “game” I was involved in “my3D 360 Sharks” was not that bad but could have been a lot better in my opinion. Performance was bad at low resolutions and the graphics should have been a bit more colorful with maybe less fancy effects in some places and more fancy ones in others.

image

You used your thumbs on the screen for some input and could turn around using the gyroscope.

Later I made my own experiment with my3D which was some kind of third person space ship racing game where you again could steer by looking where you wanted to go and I made it even work with my iPhone 3GSs accelerometer and magnetometer because it didn’t have a gyroscope. Sure the quality wasn’t perfect but much better than I expected after the internet and my colleagues kept telling me it wasn’t really possible…

Oculus DK1

Then at some point there was this thing called kickstarter and this company called oculus which I totally missed.
But when the Oculus DK1 finally started shipping to backers I did realize that it was that thing I always wanted and preordered one. (I got a couple of really low resolution displays laying around because I planned on building something similar a couple of times, but never got around to actually do it, which is the only reason I didn’t sell a VR company for a couple billion yet :P).
Somewhen in the beginning of August 2013 I got my Oculus DK1 and I loved it!
For about 20mins after which I had to take it off and wait for at least 2 hours to get my motion sickness into an acceptable state…

image

At the same time Oculus hosted a 4 weeks(?) game jam and @widerwille.com and I decided to create a game for it using our game engine Rayne which at that point was just starting to become usable. As a result we spent most time on the engine and not much time on the game, but we did end up with something that wasn’t great but worked.
Since we integrated the oculus support ourselves it was possible to just start the game and it would automatically detect the oculus and start the game in fullscreen on the correct screen. Back then it was required to integrate the distortion shaders yourself and so we did including gamma correction at the correct time, which the latest oculus SDK just added too ;)

image

I spend lots of time with just jumping off the one high cliff we got in our games cave…
Coloring the image red when taking damage did also work well.

image

One of the most important things I learned at this time was that the first person controls working best for me is when you turn the player with your mouse or controller and have it walk into its own direction and then add the head tracking on top of that without effecting the movement. This is contrary to what oculus recommends, because they prefer to move the player always relative to where you are facing. But that way you can’t just run in one direction and look around while running.
Something else that helped me with motion sickness was actually standing up and doing some running movements on spot.

Oculus DK2

A year later, in August 2014 I finally got my Oculus DK2. It came with positional tracking and a better screen and turned out to be a big step into the right direction of less motion sickness. Sure you can still see pixels which is a problem with small text, but if you can lean in to read the text it isn’t really a big issue and it is totally possible to lose yourself in a game with it.
Motion sickness is still a problem in standard first person experiences, but others like Elite: Dangerous with lots of open space and some fixed frame around you work perfectly and I can play it for many hours without any problems.

image

Input devices

Speaking of E:D, I got a nice Joystick and pedals for Playing X-Plane and they are perfect for playing in VR because all buttons are easily reachable and since they look about the same as the ones in the space ships cockpit you sometimes forget that the hands in game aren’t your real ones.
This is the experience that makes me convinced that VR works and does have a future if the games are a good fit.

image

At some point I got a Razor Hydra motion controller which uses a magnet field for position and rotation tracking and makes a quite powerful input device for room scale VR being able to track both of your hands and some buttons.
Unfortunately it is tethered, but so is the DK2.

image

I created a little tennis something game over a weekend for Ludum Dare with it. The idea is to transform the DK2 and the Hydras positions into the same coordinate system. This way moving around in the room has the same effect in the game and it just works. The Hydra isn’t perfectly accurate and there can be some distortions in the tracking, but it is still a lot of fun. I recorded a video showing it in action:

Lately I have been experimenting with the Leap Motion and also a Kinect. Both naturally have issues with hands or other body parts being covered by objects or other body parts since they only have one point of view and while a Kinect would probably work as a quite solid replacement for the Hydra in the example above the Leap Motions field of view while being mounted on a DK2 might be too small to always track the hands.
I started writing a dirty DX12 renderer with Oculus and Leap Motion support, but didn’t get past the basic rendering part yet.
I am considering a simple boxing prototype (punching a punching bag) and/or sandbox where you can shape things with your hands.

image image

Another project I still want to spend some time on is a small scene with a realistic animated person and some minor interaction like talking, walking around and throwing a ball or whatever. While it does not feel real, it should make a very nice experience.

Future

Now I am really looking forward to the HTC Vive and the Oculus CV1 and their input devices. This better be awesome :).
Another thing I am really interested in is Microsofts HoloLens, unfortunately they only sell the devkits in US and Canada for now…

In reply to: need.computer/mkn999
I got it all working in the end, but it turned out that I was lucky that my old password was still working for safe mode, which apparently isn’t always the case… Also there is no need to have an on...

I didn’t write anything here for far too long and I probably won’t in quite some time, but we’ll see.

Right now I just want to blow some steam about my current experience with Windows 10 and while probably nobody is going to read this I may still feel better afterwards.

I tried to install Windows 10 two days ago already, but after 5h it still didn’t get far with the download and I had plans, so I stopped the update.
Yesterday evening I tried again and the download finished in less than 30mins (I used some tool to force install it instead of waiting in line). I followed the installation instructions and everything was perfect. It seemed fast, clean and I was quite happy.

This morning I booted my PC and got to the login page. I Entered the same password as always and got a message that it was wrong!
So my first thought was that maybe somehow someone got into my account and changed my password and while it was unsettling that I didn’t get an email notification about it or anything I just wanted to login. I went to the password reset website the login screen mentioned and reset my password.
Tried logging in again. Still the same issue.

I only found very few similar issues when searching the internet and decided to contact the support. They offer chat and phone support. The chat seemed good enough for me, so I chose that option and it counted down a minute and then told me that I was waiting in line and should just wait a bit. I waited for about an hour. I chose the “Call me as soon as possible” option which told me to wait for about 10mins. I waited and got called back only 2 minutes late. I said hello several times, didn’t hear anything and the other side hung up. About two minutes later I got another call this time with some automated voice telling me to press some numbers, but my iOS beta decided not to allow me to open the keypad, so I hung up trying to make it work.
Another call came not much later, this time everything worked flawlessly, the quality was not great but whatever, after waiting 15 mins on the phone I finally talked to someone. She was really hard to understand and finally redirected my to a different division after telling me it would take about 5mins.
I waited for 15mins and hung up because I had a couple of things to do.
Later I called the number I was given earlier and followed the instructions given to get into the correct support line. From step to step the quality got worse and in the end I only knew what they said because I did the same steps before. I waited for about an hour and hung up…

Searching the internet a bit more it turned out that people on Microsofts answers page and reddit have been reporting the same problem before and while it doesn’t seem to be the majority of people I am apparently far from alone.
The only solution which seems to work is reinstalling windows and because I don’t want to do that I spend the last few hours to get closer to a solution.

So what I found out and already posted to answers.microsoft.com are the following steps to get a new working account:

  1. On the login screen shift-click the restart button
  2. Troubleshoot
  3. Advanced Options
  4. Startup Settings
  5. Wait until you are asked to do something.
  6. Press 4 or 5 to get into safe mode
  7. Login with your old, old password (the one that used to work)
  8. Run lusrmgr.msc
  9. Create a new user and assign it to the same groups your current usr is part of.
  10. Restart
  11. Chose your new account on the bottom left and login with the password you specified.

But I didn’t manage to get my old account to work yet… So that is what I am working on now.

I also found out that my failed login tries show up on the microsoft account website as successful. So this most probably is totally a Windows 10 bug.

So for now I can’t recommend anyone to update to Windows 10, because of the existing risk to run into the same issue.

lol, just lol.

Is microsoft really forcing you to sign up for an online account to access their local pc? This sounds crazy. But everything about your post sounds crazy to be honest.

I know microsoft is in a difficult position (many differnent hardware vendors) and you’re smart enough to solve this issue by yourself, but imagine something like this would happen to some ordinary person, without those “special skills”.

I got it all working in the end, but it turned out that I was lucky that my old password was still working for safe mode, which apparently isn’t always the case…
Also there is no need to have an online account but I already had it which messed things up a bit more.
The real problem turned out to be two users with the same name that somehow existed after the update, one of them linked to the online account and one that wasn’t and as a result both didn’t work and I always only saw one of them.
Deleting one solved the problem for me.

I didn’t write anything here for far too long and I probably won’t in quite some time, but we’ll see.

I didn’t write anything here for far too long and I probably won’t in quite some time, but we’ll see.

Right now I just want to blow some steam about my current experience with Windows 10 and while probably nobody is going to read this I may still feel better afterwards.

I tried to install Windows 10 two days ago already, but after 5h it still didn’t get far with the download and I had plans, so I stopped the update.
Yesterday evening I tried again and the download finished in less than 30mins (I used some tool to force install it instead of waiting in line). I followed the installation instructions and everything was perfect. It seemed fast, clean and I was quite happy.

This morning I booted my PC and got to the login page. I Entered the same password as always and got a message that it was wrong!
So my first thought was that maybe somehow someone got into my account and changed my password and while it was unsettling that I didn’t get an email notification about it or anything I just wanted to login. I went to the password reset website the login screen mentioned and reset my password.
Tried logging in again. Still the same issue.

I only found very few similar issues when searching the internet and decided to contact the support. They offer chat and phone support. The chat seemed good enough for me, so I chose that option and it counted down a minute and then told me that I was waiting in line and should just wait a bit. I waited for about an hour. I chose the “Call me as soon as possible” option which told me to wait for about 10mins. I waited and got called back only 2 minutes late. I said hello several times, didn’t hear anything and the other side hung up. About two minutes later I got another call this time with some automated voice telling me to press some numbers, but my iOS beta decided not to allow me to open the keypad, so I hung up trying to make it work.
Another call came not much later, this time everything worked flawlessly, the quality was not great but whatever, after waiting 15 mins on the phone I finally talked to someone. She was really hard to understand and finally redirected my to a different division after telling me it would take about 5mins.
I waited for 15mins and hung up because I had a couple of things to do.
Later I called the number I was given earlier and followed the instructions given to get into the correct support line. From step to step the quality got worse and in the end I only knew what they said because I did the same steps before. I waited for about an hour and hung up…

Searching the internet a bit more it turned out that people on Microsofts answers page and reddit have been reporting the same problem before and while it doesn’t seem to be the majority of people I am apparently far from alone.
The only solution which seems to work is reinstalling windows and because I don’t want to do that I spend the last few hours to get closer to a solution.

So what I found out and already posted to answers.microsoft.com are the following steps to get a new working account:

  1. On the login screen shift-click the restart button
  2. Troubleshoot
  3. Advanced Options
  4. Startup Settings
  5. Wait until you are asked to do something.
  6. Press 4 or 5 to get into safe mode
  7. Login with your old, old password (the one that used to work)
  8. Run lusrmgr.msc
  9. Create a new user and assign it to the same groups your current usr is part of.
  10. Restart
  11. Chose your new account on the bottom left and login with the password you specified.

But I didn’t manage to get my old account to work yet… So that is what I am working on now.

I also found out that my failed login tries show up on the microsoft account website as successful. So this most probably is totally a Windows 10 bug.

So for now I can’t recommend anyone to update to Windows 10, because of the existing risk to run into the same issue.

With a blog comes great responsibility so here is already my second post! (Good thing @widerwille.com reminded me that I got this new blog now…) About a week ago I ordered the Ultimaker Ultimater 2...

With a blog comes great responsibility so here is already my second post! (Good thing @widerwille.com reminded me that I got this new blog now…)
About a week ago I ordered the Ultimaker Ultimater 2, a 3D printer which is supposed to have a high precision, support for different material types and a good price. I finally got the shipment notification yesterday with an estimated delivery of today and against all expectations the FedEx guy woke me up this morning!

So most of the day I spend on trying to print anything at all which kind of worked after I printed at a much higher temperature because I thought that the nozzle was blocked. Turned out that I used the wrong filament type because the flexible PLA I used has quite different printing properties than the normal one…
After changing the filament to the normal stuff everything is now working great. I even got a first selfmade minimalistic pebble stand working and found out that different settings can produce totally different results.
My new hobby will be to just watch the printer printing, which is totally mesmerizing.

Wazzup!? @widerwille.com told me that I want pants and now I got pants!

Wazzup!?
@widerwille.com told me that I want pants and now I got pants!
I might want to head to the store tomorrow and get more though…

Getting pants actually turned out to be a bigger adventure than one would expect since I also switched the webhost from Sysprovide to Uberspace, for more freedom and a much better impression in general.
But thanks to @widerwille.com and the internet it is all starting to work out fine :). What is left to do is to get some of my old content back online and to start blogging again!