anthony
USA
Asked
— Edited
Resolved by DJ Sures!
Hello,
First a little background: I have to do a senior project for my class. The thing is it had to use the raspberry pi. So I chose to use the raspberry pi and the Ez-Robot for my project. I have windows IOT on my raspberry pi and have the universalbot sdk/project. I have looked through the code and didn't find a class for the sonar.
My question is How would i get values from the sonar using the universalbot application? And do I have to do anything special in order to recieve the value from there? Any help would be appreciated. Thank YOU.
Hopefully DJ or one of our other programmers will answer, but instead of looking for Sonar, look for Ping sensor or Ultra-sonic sensor. The ARC Sonar control is a combination of the ping sensor, and a servo sweeping back and forth. You would need to program that functionality yourself if not using ARC, but the servo controls are certainly there, and I expect the Ping function is there and you just missed it by searching for the wrong term.
Alan
The distance sensor is in the ezb.hc_sr04 class
Also, you may find the mono library real good as well. The mono library does include some additional features, such as Auto Position that the uwp does not support.
if you are using windows 10 IOT on your RPI2 or RPI3, only pcl assemblies targeting the .NETCore will be allowed in a UWP Project, you can't use mono library.
if you change to Linux (e.g. Raspbian), you can use the Linux MONO framework to run your application with EZB Mono SDK.
@DJ:
One quick question Mono SDK, is not compatible with the Xamarian development (Android or IOS). I know you have your priorities but if you some time using your current base code and through PCL assemblies you can create a single SDK targeting: UWP Xamarin (Android & IOS & Windows Store) Linux Mono.
Let me know if you have plans/date for that.
It is compatible with xamarin development - it's what the mobile app is built with. what issuse are you having?
I'm not using System.Drawing anywhere (does not exist in the Android profile).
Add the nuget packages for Shim
With xamarin, you will spend a lot of time in nuget installing supporting libraries. Xamarin is a great compiler but their support and implementation is absolutely terrible. Every release breaks your code. It's an absolute nightmare to deal with.
does not work, i tried Shim & Shim.Image
the PublicKeyToken is used by Microsoft, unless you recompile the EZ_B.dll with a reference to Shim.*.dlls, i don't think you can force the binding.
Are you using Shim.Imaging ? Their website mentions a commercial license, I'm not sure what is being used from System.Drawing to justify using their (Shim.Imaging)...
No I use the system.drawing that's included with android and iOS xamarin.
Let me remove the requirement for you- or why not just use uwp library source from the software link?
@DJ,
The UWP code does not compile, the main culprit is a TcpClient class.
i presume you coded for a replacement for the Net.Sockets.TcpClient not available when using UWP Apps, it uses SocketStream.
The problem is the UWP TcpClient does not have the same signature methods, unless you rewrite the calling code.
don't stress with that, when you have a break or an opportunity, take a look to the base codes, and if you find a solution let me know.
tcpclient is part of the uwp package. it's included in the source.
I know but does not compile unless is a UWP project.
I guess i'm having a hard time understanding what you're asking. On the first page you asked for UWP and XAMARIN but now you're saying you don't want UWP?
If you can clarify it would be super useful to assist further
I removed the System.Drawing reference in the latest mono package. Get it from the Software->Mono link at the top menu of this website.
Thank you for the prompt response. I have decided to go with the mono sdk on raspian jessie. Though after installing the complete mono package , and tring the test file I Get this error:
Any ideas on what might have caused it?
Without posting the code that you are using, it's impossible to diagnose. Please provide the code that you are attempting to compile. Also, the recommended distribution for raspberry pi is Debian, as stated in the mono page.
Mono is an open source project that has no real owner - or at least no one accountable for their mess ups. You will find that working with open source software will result in a nitemare of headaches but we'll get you rock'n.
Post the code and we'll start from there
The code I am using is exactly from the download page of mono-sdk. I also ran the test on the included example file and it gave the same error. It is occurring when it is creating a new instance of the ez-robot.
@dj-sures , is it possible that when I create an Ez-Robot object it needs an argument.
Oh right, the example needs updating. The ezb creator needs a string argument that is the name for the object. It's any name you wish to give it. This is incase you have many Ezbs and wish to display names to the user associated with each instance.
Check the ez_b.xml file included in the mono package for syntax parameters. The xml file should always be the first place for you to look for syntax assistance.
Here's the ezb create from the xml...
I'm on my phone so it's tough to write code but the syntax would be something like
I'll update the example later today or tonight.
THank you so much for your help
Great to hear it's working for you Anthony! Looking forward to hearing more about your project as it progresses
Hello! I know this was posted 2 years ago and a solution was found I wanted to give a little heads up that the mono.sdk example code hasn't been updated yet!
For anyone who hasn't found a solution here's what I changed my code to: