Sphero 2.0 Turning in place - sphero-api

I tried running mRobot.drive(0f, 90f); or RollCommand.SendCommand(mRobot, 90f, 0f); with my sphero 2.0 and it does not move really at all sounds like the motors are trying to twitch but don't. Tried it with a sphero 1.0 and it works fine. Same thing happens with SetHeadingCommand.sendCommand(mRobot, 90f); but no luck on the sphero 2.0. Not sure if my sphero is bad but don't see why it runs on sphero 1 but not sphero 2 the same code.
Also when i open the Sphero app that you can download and initializes the ball it does not say there is any firmware updates.

Related

Audio problems in nativescript app on iOS

I have a nativescript-app that uses text-to-speech functionality (#nativescript-community/texttospeech).
This is working fine so far.
Now, I open a modal-view with the #nstudio/camera-plus plugin that enables the user to capture a photo.
After closing the camera-view, the audio of the text-to-speech is only half as loud as before.
Is the camera messing up the audio-settings? And if so, how can I avoid that?
Nativescript 8.1
texttospeech 3.0.3
camera-plus 4.0.3
Didn't find the cause for this, but at least a workaround.
I put this above every audio-related task:
AVAudioSession.sharedInstance().setCategoryWithOptionsError( AVAudioSessionCategoryPlayAndRecord, AVAudioSessionCategoryOptions.DefaultToSpeaker);
That sets the volume back to full.

How is iBeacon support REALLY changed in iOS 7.1?

I've seen claims on the net that the newly released iOS 7.1's iBeacon support.
Specifically:
The system is supposed to still notify your app about
didEnterRegion/didExitRegion events, even if the user explicitly
kills your app.
didEnterRegion/didExitRegion notifications are
supposed to be faster from the background and/or with the device
locked.
I have not been able to confirm either of these claims with my own testing. In fact, I seem to be less likely to get didEnterRegion/didExitRegion notifications from a locked device. (more accurately I seem to get didEnterRegion notices, but not didExitRegion notices). That could be because Apple made me remove my BLE background mode entries in my info.plist - I'm not completely sure. I'm still trying to sort this out.
I had trouble setting up my tests at first, but I have witnessed background region entry callbacks after killing an app in iOS 7.1 on both iPhone 4s and iPhone 5s models. See comments below for testing details and instructions to reproduce.
I have also done tests on background detection times on an iPhone 4S, and I still see delays of 15 minutes on iOS 7.1. My full test results and methodology are described here.
Finally, I have also done some tests on the fluctuations on the "accuracy" (distance in meters) measurement on the same device before and after the upgrade to iOS 7.1. I do not see an obvious difference in the noise on the estimate. The graphs below show results before and after the upgrade, with an iBeacon 0.5 meters away for 60 seconds then moved to 3 meters away for 60 seconds. In both cases, the transmitter was a properly calibrated iPhone 4S w/ iOS 7.1 and the receiver was an iPhone 5S.
iOS 7.0.6 Estimated distance
iOS 7.1 Estimated distance
As has been mentioned in several articles circulating around the internet, beacon sensing is available even when you swipe your app away from the multi-tasking view. However in my experiments, a region enter/exit event doesn't call the didDetermineState: directly (Probably because I hadn't been using the AppDelegate to initiate any beacon sensing but instead triggering monitoring based on UI events). Instead if you have registered for Background Location Updates, your AppDelegate's didFinishLaunchingWithOptions: method would get called with the value for key UIApplicationLaunchOptionsLocationKey in the parameter launchOptions set.
You can do a simple check like this to test if this is indeed a location update that has bought your app into the background to perform some task.
if ([launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey])
You can then either register your monitored regions again or start ranging immediately.
P.S. CLLocationManager retains your previously monitoredRegions on app restore but without starting monitoring again using the same UUID and identity, you would not get the enter/exit region event in CLLocationManagerDelegate (which had brought your back up to life)
David has done some wonderful work on this, so I'm writing this cautiously... but I'm seeing something quite different from him in my tests.
I'm using two phones: an iPhone 4S running iOS 7.1 (11D167) and an iPhone 5S running iOS 7.0.6 (11B651). My iBeacons are manufactured and sold by Bluecats (www.bluecats.com), although I'm not yet using their SDK (ie. I'm just using CoreLocation) and I don't think the manufacturer makes much difference.
I'm getting response times of around 1-2 seconds on both devices when the app is running in the foreground and also when running in the background. The only difference is when I remove the app from the app switcher: iOS 7.0.6 never responds (or perhaps will do in 15 minutes), but iOS 7.1 responds in roughly the same time. When I say "respond", I mean that the CLLocationManager's locationManager:didDetermineState:forRegion: delegate is called by iOS.
I'm testing by actually wandering around my office with phones in hand, so I'm physically moving in and out of range. Strangely (?), in my early testing, where I was sitting at my desk and simulating moving in and out of range by removing and reinserting batteries, I was seeing much slower response times. Perhaps this is part of the difference?
In my testing I have seen the presence of a beacon go un-noticed by an app for up to 15 minutes, but I found something that's interesting. I'm using RedBearLabs mini BTLE sensors as ibeacons and their app to program the beacons, http://redbearlab.com/ibeacon/ (http://redbearlab.com/s/MiniBeacon_v1.zip), seems to have an something in it that immediately starts a scan / update of beacons. If I start a beacon up, and in my app it goes unnoticed, by starting then quitting the MiniBeacon app my app immediately notifies me that there are new beacons. This is the same result when entering or exiting. Their app uses CBCentralManager, which my app doesn't, so maybe a mixture between CBCentralManager and CLBeaconRegion is the way to go? I imagine CLBeaconRegion starts / restarts the bluetooth radio, so maybe that is the reason for this. Just taking a stab at it in hopes that someone with a more complete understanding can help resolve this.
Thanks
My testing also reproduces 15 mins to start scanning when my app is in background mode on iOS7.1.1. Just a bit curious, I have seen quite many youtube videos from different companies showing the app has been waken from background mode as soon as they approach their beacons. Is it sales trick?

Sphero connect on Mac issue

I recently bought Sphero 2.0 and playing with it on iPad with no problems.
Now I want try to develop some apps with Mac SDK however I am not able to connect my Sphero with my Mac Mini 2012 nor Macbook Pro 2013 Retina. I open Bluetooth settings, I see Sphero-YRG click to "Pair", it shows for two seconds "Connected" and after that "Not connected".
After this pairing process I can still click on "Not connected" Sphero bluetooth device, after few seconds it turned into "Connected" and again after two seconds its "Not connected". I doubted that it really gets to connected state because Sphero won't start light with that blue-white as it does when it connects to my iPad.
This is output from /var/log/system.log :
Feb 3 21:19:11 Pavel-Mac-mini.local blued[83]: Save link key for device: 68-86-e7-00-25-b8
Feb 3 21:19:12 Pavel-Mac-mini.local BluetoothUIServer[3420]: setAudioDevice:kAudioDeviceUnknown
Feb 3 21:19:12 Pavel-Mac-mini.local BluetoothUIServer[3420]: Failed to set the device Sphero-YRG
Feb 3 21:19:13 Pavel-Mac-mini kernel[0]: [0xffffff8058432e00][free]()
What worked for me is quickly running some code using the Sphero during the short interval while it shows "connected" in the Bluetooth settings.
Connect Sphero. It will automatically disconnect, stupid.
ls /dev | grep Sphero shows the name of the port which was associated with the device. Use the tty one (in my case, /dev/tty.Sphero-BOY-AMP-SPP).
Paste the port name into your code, so you can run it quickly.
Remove Sphero from the Bluetooth settings UI.
Choose to pair with the Sphero again, and immediately run your code using it. Now it stays connected and the connection is usable and stable.
The Mac SDK looks like its last update was about a year ago, which would mean that the SDK has not been updated to be able to see or connect to the Sphero 2.0 ball correctly. That being said, the Mac SDK is actually an unofficial SDK, and therefore is not directly supported by us. I will make sure that this gets forwarded to the correct people, and will get you some more information when I know more.
You could try using artoo open source framework to connect and control your sphero from your computer.
Here you can find a tutorial on how to do it: https://github.com/hybridgroup/artoo/wiki/1.3.2.-Sphero
If you don't want to use ruby, you could use http://cylonjs.com with javascript too.

Sphero Windows Sample App?

Has anyone gotten the Sample BasicDriveApp App working in Windows 8?
https://github.com/orbotix/Sphero-Win-SDK
When I build and run the Project I get a message "No Sphero is connected" and when I try to connect the Sphero via Windows 8 Bluetooth it does not work.
Can anyone offer any tips?
Thanks.
John.
It indeed works, I've had some problems with connectivity myself, however.. process I use to restore if all goes awry:
Refresh Sphero (return to base for sleep mode, wait a few seconds, wake up)
Refresh Bluetooth in Windows (off / on) without connecting to Sphero
Open your app, wait for it to connect. It'll find Sphero and automatically dig in if all goes well.
[Update]
It appears Windows 8.1 doesn't really know what to do with Sphero. It has a hard time reconnecting after the connection is lost, even if you close all instances of the app and toggle through Bluetooth.

WP8 performance in multithread XNA game

I'm working on multithreaded game and targeting wp7 and wp8. I'm using background threads for network comunication and got stuck on problem that wp8 has huge perfomapnce issue when i have 3-4 background threads. Fps drops, for example if you touch rectangle and move it around screen with your finger it will move discrete not smoothly. But on wp7 all works smoothly and perfect. Whats wrong with multithreading in wp8? Are there any good practices to achieve good perfomance? Tested on lumia 920 and htc hd7
Workaround
Looks like promblem with new wp8 software update, but have no other device to test.

Resources