How to get the orientation angle screen with 40 Hz stably without delay to sync?

Goal: Get orientation angle screen at 40 Hz stably without delay for synchronization.

Problem with two situations:

1. When you use the bbutil_swap and navigator_event_get_orientation_angle (event) to get the orientation angle screen with other data such as acceleration sensors and gyroscope data, the sampling frequency will be low grade at 10 Hz randomly. The difference of synchronization will increase from 25 ms to 100 ms.

2. when the screen orientation angle is collected in the following code to get the angle only, the difference in timing of sampling will be 1, 2 or 5 seconds at random.

Question: How do I get the orientation angle screen with 40 Hz stably without delay to sync?

or something wrong in my code?

Mini code:

public static void handleNavigatorEvent(bps_event_t *event) {}
switch (bps_event_get_code (event)) {}
case NAVIGATOR_ORIENTATION_CHECK:
navigator_orientation_check_response (event, true); If not the line, no updates on the screen rotation.
angle = navigator_event_get_orientation_angle (event);
break;
case NAVIGATOR_EXIT:
stop = true;
break;
}
}

public static void handle_events() {}
for(; ) {
bps_event_t * event = NULL;
If (BPS_SUCCESS! = bps_get_event (& event, 0)) {}
fprintf (stderr, "bps_get_event failed\n");
break;
}
If {(event)
If (bps_event_get_domain (event) is {navigator_get_domain()})
handleNavigatorEvent (event);
}
} else {}
break;
}
pthread_create (& t1, NULL, (void *) & rawacceleration, NULL);
}
}

int main (int argc, char * argv []) {}
screen_create_context (& screen_cxt, 0);
bps_initialize();

{If (EXIT_SUCCESS! = {bbutil_init_egl (screen_cxt))}
fprintf (stderr, "bbutil_init_egl failed\n");
bbutil_terminate();
screen_destroy_context (screen_cxt);
return 0;
}

If (BPS_SUCCESS! = screen_request_events (screen_cxt)) {}
fprintf (stderr, "screen_request_events failed\n");
bbutil_terminate();
screen_destroy_context (screen_cxt);
return 0;
}

If (BPS_SUCCESS! = navigator_request_events (0)) {}
fprintf (stderr, "navigator_request_events failed\n");
bbutil_terminate();
screen_destroy_context (screen_cxt);
return 0;
}

Rawlog = fopen (rawfilename, "w"); Save the file in a specific path.
fprintf (rawlog, "Absorption system, Angle\n");

navigator_request_events (0);

While (! shutdown) {}
handle_events();
bbutil_swap();
}

closeshutdown();

return 0;
}

Thank you for your attention,

Using SENSOR_TYPE_ORIENTATION of sensor_type_t , you should be able to get > 10 Hz.  Use sensor_set_rate() to get the slower delay to call sensor_info().  Make sure not to enable sensor_set_skip_duplicates().

However get the orientation at the 40 Hz streaming will not make your application any repsonsive more.  The only way to make your app more would be to manage the orientation change in a short period of time.  This is the time when orientation changes (at the hardware level), to receive you and to deal with it.  It is usually a constraint system and there is not that you can do about it.  What you see using the code above is the same information repeated over and over; FACE_UP, FACE_UP, FACE_UP, which is not really useful.

Tags: BlackBerry Developers

Similar Questions

  • Windows XP mode - 7: how to get the Realtek Audio Drivers with GS Wavetable outside normal? Instead of RDP Audio driver!

    1. I upgraded my comp to Windows 7, Ultimate because I need to use many XP programs. What I've discovered, is the virtual XP Mode is not the same thing as XP regular and many programs do not run properly. Particularly theAudio out to lunch and MS GS Wavetable is not available in XP Mode.

    2 - I end up having to buy another XP-Professional and installed in the same notebook. I have to turn off the laptop restart and select the Windows 7 to XP operating system. All old programs work fine under XP.

    3 - I continued looking for a fix for the XP Audio Mode or virtual. Almost 2 years now, I can not find such a simple solution.

    4. today, I found something on the Microsoft RDP Audio driver. What is the reason? Anyone know?

    5. are there available MS drivers or resources?

    I'm not interested in the commercial programs or attempts to scan my computer. MS sold Windows 7 that can run XP so I think that Microsoft is responsible for fixing.

    Thanks in advance,

    VT

    Windows XP mode - 7: how to get the Realtek Audio Drivers with GS Wavetable outside normal? Instead of RDP Audio driver!

    Hello

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the Windows Virtual PC and XP Mode Forums.

    http://social.technet.Microsoft.com/forums/en-us/w7itprovirt/threads

  • How to set the orientation of page with postscript when the pdf file is displayed in Adobe Acrobat format?

    I have a program that generates a postscript and then 'prints' the script in a PDF file using gs.

    The user can opt for the document in landscape format.  The program handles this with the addition of the 'Rotation 90' command early in the script.  It works without problem.  When the user opens the PDF file in Adobe Acrobat, it is displayed in landscape orientation.

    In addition, the user may have a "watermark", adding the document which is the text at an angle of 60 degrees.  This is handled by the emission of the "rotation of 60", then the text of the watermark, then "rotation-60.  This also works without problem.  The resulting PDF file has watermark text at an angle of 60 degrees to the rest of the text in the document.

    The problem is when these two options are used together.  The document is correctly mounted (in orientation landscape with a watermark properly tilted), but it is displayed in Acrobat in portrait, forcing the user to rotate to be able to read it.  When I look at the postscript, it seems OK, just the sum of these two options:

    rotation of 90

    things...

    60 rotate

    ... watermark text...

    turn-60

    ... the rest of the document...

    'Net turnover' is 90, leading me to believe that it would be displayed in landscape orientation, but it is displayed in portrait mode.

    There is no other sizing page not declared in the script.

    How can I get the document to display in the landscape when opened in Acrobat?  Thank you.

    Check to see that the 'gs' (ghostscript) isn't reorienting the page, by default, based on what he thinks is the correct meaning of reading.

  • How to get the Western Digital screen to appear without having seen the image of office as well.

    Original title: WD1TB MY book was installed with Windows XP and the deskyop "bleeds" through parts of the WD Menu. How can I get the WD screen appears without the office showing?

    WD1TB MY Book was installed with Windows XP and office "bleeds" through parts of the WD Menu. How can I get the WD screen appears without the office showing?  I can't read the instructions when this screen appears partially gray with the news of WD and the desktop showing through the other box of WD.

    Hello

    You can try to connect the WD 1 TB My Book on another computer running Windows XP and see if the problem still occurs.

    You can also get in touch with support from WD for assistance on the issue.

    Contact us Support WD

    http://support.wdc.com/contact/index.asp?wdc_lang=en#us

    WD community

    http://community.wdc.com/T5/my-book-for-PC/BD-p/BoardExample

  • How to get the orientation of the document?

    Hello

    Someone suggest me API that can get/set the orientation of the document.

    That is, how can I change the orientation of the doc from portrait to landscape or vice - versa by program.

    Thank you

    If you are using CS5, you can use AICropArea.h, but there is a new header in CS5 called AIArtboard.h. The acreage is OKONKh and AICropArea.h is not recommended for the future. If you only have CS5 +, use AIArtboard.h. If you need support the CS3 or CS4, use AICropArea.h for now, but just keep in mind that this will ultimately go away.

  • How to get the new logic board with 16 GB of RAM for my Macbook Pro retina 15 mid 2012?

    1 month ago I brought my Macbook to the Apple Store Genius Bar to check the GPU because I was worried about small lines on a screen while playing games.

    After 3 days of test engineering guys gave her back to me and told me that there is nothing they can do in this regard, because was unable to reproduce the problem, but gave me an option - completely replace the logic board for 700CAD. At first, I said NO, but also asked them, if they can replace the logic board, but with 16 GB instead of 8 GB, I immediately. I'll have to pay the money anyway, right? Why not?

    Long story short - they told me that they cannot do and can replace the logic board with the same RAM mount my Macbook at the present time. Specialists support Apple tells me the same thing via Chat application on the Apple Web site. Funniest - none of them could give a reasonable answer why they cannot do so.

    It's the same logic board, with the same size, but with more RAM.

    I understand that they need to sell more laptops and, if I need more RAM, I can go and buy the new Macbook, but to be honest, as an International Student I simply don't have so much money.

    So why can't they do it?

    Honnoshin wrote:

    If I need more RAM, I can go and buy the new Macbook, but to be honest, as an International Student I simply don't have so much money.

    So why can't they do it?

    You deal with politics Apple and no one on these forums can do something for you, since we are like you, only users of Apple products.

    Consider selling your MBP and put money to one with 16 GB of RAM.

    Ciao.

  • How to show the loading (wait screen) with animated image dialog between the screens

    Hello

    Can anyone show how to insert the load between two screens dialog, while the second screen is taken

    loading time?

    I tried the examples given in the forum but no luck

    There is an update about it here:

    http://supportforums.BlackBerry.com/T5/Java-development/sample-quot-Please-wait-quot-screen-part-1/t...

    Note comment added to the article as well - this is a useful Variant.

  • How to get the vRAM on allocation with Powershell?

    People,

    How can I get the report in CSV for guests of ESXi allocated by host ratio vRAM?

    I need to know what VMhost is oversubscription currently vRAM to the virtual machines.

    My understanding is that the total number allocated vRAM ov is not greater than the amount of physical RAM in each host ESXi - 4 GB (for ESXi services).

    Thank you.

    It's the same concept, something like this

    $allvms = @)

    $vms = get - VM

    $start = (get-Date). AddHours(-1)

    $metrics = "mem.usage.average", "mem.granted.average", "mem.vmmemctl.average", "mem.swapin.average."

    "mem.swapout.average", "mem.swapped.average".

    Get-Stat - entity $vms - start $start - Stat $metrics |

    Group-object - property {$_.} @entity.name} | %{

    $memAllocatedMB = $_. Group [0]. Entity.MemoryMB

    $memGrantMB = ($_.) Group | where {$_.} MetricId - eq "mem.granted.average"} | Measure-object-property value - average | Select average - ExpandProperty) / 1 KB

    $memUsageMB = $memAllocatedMB * ($_.) Group | where {$_.} MetricId - eq "mem.usage.average"} | Measure-object-property value - average | Select average - ExpandProperty) / 100

    $vmstat = "" | Select time VmName, MemUsageMB, MemGrantMB, Ratio, MemBalloonMB, SwapInMBMB, SwapOutMBMB, SwappedMBMB

    $vmstat. VmName = $_. Group [0]. @entity.name

    $vmstat. Time = $_. Group | Tri-objet-Timestamp property | Select - 1 first | Select - ExpandProperty Timestamp

    $vmstat. MemGrantMB = [Math]: Round([double]$memGrantMB,2)

    $vmstat. MemUsageMB = [Math]: Round([double]$memUsageMB,2)

    $vmstat. Ratio = [math]: Round ([double]($memUsageMB/$memGrantMB), 2)

    $vmstat. MemBalloonMB = [math]: Round ((($_.)) Group | where {$_.} MetricId - eq "mem.vmmemctl.average"} | Measure-object-property value - average | Select average - ExpandProperty) / 1 KB), 2)

    $vmstat. SwapInMBMB = [math]: Round ((($_.)) Group | where {$_.} MetricId - eq "mem.swapin.average"} | Measure-object-property value - average | Select average - ExpandProperty) / 1 KB), 2)

    $vmstat. SwapOutMBMB = [math]: Round ((($_.)) Group | where {$_.} MetricId - eq "mem.swapout.average"} | Measure-object-property value - average | Select average - ExpandProperty) / 1 KB), 2)

    $vmstat. SwappedMBMB = [math]: Round ((($_.)) Group | where {$_.} MetricId - eq "mem.swapped.average"} | Measure-object-property value - average | Select average - ExpandProperty) / 1 KB), 2)

    $allvms += $vmstat

    }

    $allvms | Select time VmName, MemUsageMB, MemGrantMB, Ratio, MemBalloonMB, SwapInMBMB, SwapOutMBMB, SwappedMBMB |

    Export-Csv "C:\TEMP\MemoryRation.csv" - noTypeInformation - UseCulture

  • How to get the Manager to update with VMware vCenter Server 5.0 device

    Hello

    We have VMware vSphere Essentials 5 and already, I downloaded the vCenter device but how get the Update Manager?

    Thank you.

    Hello

    If you want to use the Update Manager you will have to be installed on a separate windows server, the device has UM built as of yet.

  • Satellite L40-17 t - how to get the mode full screen of low resolution?

    Nice day!

    What should I do to get a resolution 800 x 600 mode full screen for Satellite L40-17 t?

    You must remove the graphics driver and should only use a common Microsoft Windows driver that supports only the resolution 600 x 800 and 768 x 1024.

    But I really don't understand why you want to use 600 x 800? Is the resolution 768 x 1024 high?

  • Satellite P100-286 - how to get the Lan 1 Gbps with Vista speed

    Many critics say the latest range of P100 with Vista installed Gigabit Ethernet support.
    However, I have a P100-286 card Intel (r) PRO/100, which only seems to support 100 base.
    Can anyone suggest a way to get 1 Gbps on this laptop on LAN?

    Hello Allister

    Maybe I'm wrong, but in my opinion, you must wait for official Vista drivers, install them and after making this check the mobile functionality of any computer.

  • How to close the pop-up screen with timer

    Hello

    How to close pop-up display with timer .assuming I want to close pop-up screen after 10 seconds please share code me complete.

    Hello

    See this sample program,

    import java.util.Timer;
    import java.util.TimerTask;
    
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.PopupScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    
    public class Example extends UiApplication {
        public static void main(String[] args) {
            Example app = new Example();
            app.enterEventDispatcher();
        }
    
        public Example() {
            pushScreen(new ExampleScreen());
        }
    
        private class ExampleScreen extends MainScreen {
            public ExampleScreen() {
    
                ButtonField but = new ButtonField("Click",ButtonField.CONSUME_CLICK);
                but.setChangeListener(new FieldChangeListener() {
    
                    public void fieldChanged(Field field, int context)
                    {
                        UiApplication.getUiApplication().pushScreen(new exmplePopup());
    
                    }
                });
    
                add(but);
            }
        }
    
        private class exmplePopup extends PopupScreen
        {
    
            public exmplePopup()
            {
                super(new VerticalFieldManager());
                GuestPop p=new GuestPop();
                add(p);
            }
    
            public class GuestPop extends VerticalFieldManager
            {
                public GuestPop()
                {
                    add(new LabelField("Hi How r u"));
    
                    Timer timer  = new Timer();
                     timer.schedule(new CountDown(), 5000);
                }
    
            }
    
            private class CountDown extends TimerTask {
                public void run() {
                    UiApplication.getUiApplication().invokeLater(new Runnable() {
    
                        public void run() {
                            UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());
    
                        }
                    });
    
                }
            }
    
        }
    }
    

    Here, I've given 5 seconds.

    Thank you.

  • Compaq Presario R3000 how to get the sound to work with Windows 7 RC

    (1) download SP29586.exe: ftp://ftp.hp.com/pub/softpaq/sp29501-30000/sp29586.exe

    (2) execute, create a swsetup c:\ directory

    3) once all files are extracted DO NOT INSTALL

    (4) now Goto the Start Menu click on devices and printers, click the name that you called your machine this will mark will be a yellow triangle as the audio driver windows 7 already installed is a realtek ac 97, which does not.

    (5) once your Machinename, you will see a general tab and then Hardware tab select the Hardware tab.

    (6) seeking the Realtek ac 97 under the functions of the device, select it and click Properties,

    (7) tab now the driver, now click on update driver.

    (8) select Let me pick from a list of device drivers, now click on disk

    9) click Browse, select the following Swsetup\SP29586\SMAXWDM\W2K_XP location and click smwdmCH6.inf

    (10) the Soundmax driver should come now select ok and next year. Now your sound will work

    Go on the side of Support HP and look for drivers for Presario R3000 and download the driver for Audio "SP28552" but do not install it. After you download the driver, search for the driver on the folder file download you too and right-click on it and select properties and then select "Change the setting for all users", once the pop-up window, select Compatibility Mode and select it for Window XP Service Pack 3 all the and click ok. Once you ok it click on the file to put in place and follow the steps.

    I did it on my Compaq Presario R3000 which has Window XP and I installed Windows 7 Enterprise 32 bit on it and it awesome except for the Audio that I just decided to work, but I still have problems with the Base system device drivers.

    I hope this help you with the problem of noise.

  • How to get the nfc for work with a7 and samsung galaxy s4

    I can't NFC to work on the new A7 with my Samsung Galaxy s4 - someone has these 2 devices and NFC works fine?  Or did you have to complete a fix to make it work?

    I discovered that the latest android update 4.3 with the samsung galaxy s4 has created problems with nfc communications - a lot of programs that use the nfc no longer works with this new update.  I was told by samsung today that there is a known issue and they are working on it.

  • How to get the text to change with each image in the slideshow base

    Hi, I'm putting the different positions and text on three different images. When I saw the text just remains the same.  I tried to change individually, but it doesn't seem to work. I took images in Photoshop and make all the same size with compensation for the text to be included later in the Muse. Then I loaded the three images in the slide show and thumbnail to bring the image before and at the Center. But regardless I the title and text appear unchanged, even if the changes to the image.  I don't know what to do with the image and text together in Photoshop would do anything for type resolution when it was introduced to the Muse.  Any ideas please.  I enclose the schema where I wish to address three different types of job seeker.slide problem.JPG

    Hi brush them... you have checked the title text on your widget option?... Try again with different slidshows which shows the option.so of text you can add the text you want in each image/trigger...sorry my English and I hope to help you

Maybe you are looking for