Nokia N900 + Q-steer = Fun

    Wandering once on the Runet open spaces, I once came across the most banal Yandex.Direct block. But something interested me there, and I got to a certain site. Where they traded controlled cars. It seems to be nothing special, but in the end it led to quite interesting things and to this topic.

    These machines are called Takara-Tomy Q-Steer (also known in the USA under the names Microsizers and ZipZap). The radical difference between the Q-steer machines (namely, they were traded on that site) is that they are small. Very small. Very very. Length 4 cm, width 2.7 cm, to be exact. But, despite this, the machines are fully controllable. They understand the teams back and forth, left and right. And there is an afterburner (!) And another interesting point - the control channel - IR. Infrared radiation. They have a kind of typewriter (a little bigger in size, but not by much) on the radio control, but they are not suitable for my needs.

    In general, after sitting on that site for several hours and having studied almost everything there, I decided to buy a typewriter myself. With control via IR, of course, for one interesting thought appeared.

    In Moscow, such machines could not be found, so I ordered it on a found site. Delivery took several days, but on the first day after the order I was fired from my current job, so that in running time the remaining time before the parcel arrived flew very quickly. I will not talk about unboxing - I tore off the wrapper, tore the plastic, took out the typewriter and the remote control. Everything is simple.



    At the first personal contact with the machine, I experienced a small shock - "so small, will it really go?" True, I could not go right away - there were no batteries in the kit. And the batteries there to match the typewriter are also small, “clock” LR44. Only after some time, after reading the instructions and finding out that the machine should be turned on by turning the inconspicuous lever, it turned out that there are batteries in both the remote control and the machine. So you can drive.

    Well, I drove :-) The first experience of micro-driving captured in the largest video.



    In general, the machine is ideal for the office - you can perfectly drive around the table, on chairs, on a laptop ... In short, you can even drive around the rim of the toilet.



    But manual control of the machine is trite and uninteresting. I want control from something professional (I do not like this word, but I still have to get used to it). I already managed to find out that for Sony PSP there is a software for controlling Q-steer machines . However, it only works on older PSP models that have IR. I have a PSP Slim, and there is no infrared port on board :-(

    Of the gadgets with an infrared port, I only have the Nokia N900 at hand. However, there the infrared port is a little castrated - it can only transmit signals, but not receive But nothing is needed to control the typewriter, so the N900 is suitable. There were no ready-made programs for the N900 that could control my typewriter, so I had to do it myself.

    The whole process of writing a soft program consisted of the steps:
    • Determination of control IR signals from the native remote control of the machine
    • Reproducing IR Control Signals on the N900
    • H apisanie script to N900, converting some action with a telephone control signals for the machine
    • Drinking a bottle of unfiltered
    • Photographing and filming the entire driving and driving disgrace
    • Solemn blog entry that it worked
    • Mailing a link to a record to all your friends in order to boast




    As a result, these stages dragged on for two days (or rather, for two nights). The first was devoted to attempts to decode the remote control IR signals. I've been using a home-made IR receiver for WinLIRC on my desktop for a long time, but it was perfect for receiving remote control signals. But a problem surfaced - WinLIRC did not want to learn console commands. I tried all the settings - it did not help. And the RAW codes also did not want to be recorded, so I had to manually tear them out of the test window for receiving RAW signals.

    Not a bit ice, but managed to catch all the necessary codes for the main types of movement. Only now I did not use the afterburner button. Combining all codes into one setup file led to the appearance of this one - the settings file for the Q-steer remote control. True, the settings are only for range B, I haven’t climbed into range A yet, I have only one machine :-)

    In general, this was the first part of the subject after the equality - “Fuck first”. For having sex with the codes really. And still to have sex - while a little twitchy management turned out, we must pick further.

    There was no problem playing back the received signals on the N900. For on this mobile tablet there is quite an ordinary lirc for itself, for which the Q-steer settings file that I formed was very suitable for me. It remains only to slip his cirque.

    In the file /etc/lircd.conf, add the inclusion of our file with the config (I have it in / home / user / MyDocs / DISTR / Q-STEER / qsteer)

    include "/ home / user / MyDocs / DISTR / Q-STEER / qsteer "

    Restart lyrts. Of course, this must be done under the root.

    sudo gainroot
    /etc/init.d/lirc restart

    So, the infrared port control daemon is running, it remains to transmit commands to it. And in general, how will we manage?

    And we will control the slopes of the phone. In vain is there an accelerometer in it? We tilt the phone forward - the machine goes forward. Tilt forward slightly - goes back. Tilt back slightly - the machine stops. Almost the same with the corners. Tilt to the left - the machine to the left, tilt to the right - the machine there too. Why didn’t you make the car move backward with the same tilt of the phone - just the signal from the IR transmitter of the phone is weaker than that of the native remote control, so it is better that the IR LED is directed towards the machine, and this only happens when the phone is tilted forward. By the way, looking ahead - if you put the phone vertically - this is the exit from the program.

    The rather well-known shake.py script by Niklas Tanskanen took the basis for obtaining the phone's rotation coordinates. For a sample of interaction with lirc - a script of a Blubbi withMaemo forum . I have never encountered Python before, but now a good reason appeared to try to code in this language. By the way, PPC as unusual after C / C ++, PHP, JavaScript, etc. IMHO, especially wildly IF conditions look :-) Yes, the Petitonians are asking me.

    In short, what happened in the end? And this is what happened.

    The qsteer.py script controls the Q-steer from the Nokia N900 tablet by mocking the accelerometer.

    It looks something like this. It is difficult for one to simultaneously control and hold the camera. And I have not yet fully mastered the management.


    The movement is still twitching, it is necessary to correct the control signals. And eliminate small jambs (sometimes sending pulses is repeated when they are already sent, because of this, an error message is visible at the end of the video). But in general - everything works !!!

    It remains to do the training of the route - so that you can set commands and the phone itself would feed them in a typewriter cycle. But this is the details, to complete the work is not difficult.

    Need help!
    Management of RAW codes sucks. For rides jerky. It is necessary to emulate normal control signals. Can someone tell me how to find out the control protocol parameters for LIRC? WinLIRC refuses to learn, apparently non-standard pulse sequences.

    UPD> Yes, by the way. Do not count for advertising, that shop is called mikrogonki.ru. If you are suddenly planning to order a typewriter there, in the field "Order Notes" write "I am from a bald man." Suddenly, you look, they will give me a typewriter :-)

    UPD> I found where my jamb is! I think it’s better for beer, right now the machine is moving back and forth without jerking, just it was necessary to throw the start bit out. Now I will correct the remaining codes and post a new video.

    UPD> Corrected codes, now moves without jerking. Although occasionally, it still slows down. But this is due to the fact that the N900 does not have a very powerful IR transmitter and is rather directional. The file with the LIRC settings is reloaded.

    Here's a new video showing roughly motion with fixed control signals



    UPD> Q-steer, it appears, are laid off. They were replaced by Choro-Q cars. He arranged a small autopsy here . Also controlled via IR, but the codes are different, right now I understand.

    Also popular now: