C# Robotics / Hardware - c#

I'm aware of Phidgets, however, I'm looking for some other types of hardware that can be interfaced with C#.
Anyone got some good ones?

Check out the Netduino. It is based on the Arduino but is programmed with the .Net Micro Framework

Take a look at my "World's Smartest House Project" http://blog.abodit.com/category/home-automation/smartest-house/ as featured on .NET Rocks #518.
It's written in C# and interfaces to X10, thermostats, alarm panels, a multi-zone audio switcher, a projector, Denon amplifiers, driveway sensors, strain gauges, and much more ...
A Caddx alarm panel is about the cheapest sensor input device you can connect to a PC - one serial port gets you 100+ inputs both wireless and wired.

Actually Lego Mindstorms kits are cheap and have a lot of different libraries to code in.
Microsoft Robotics for example. More info can be pulled from this article. My experience with Lego Mindstorms was before the NXT versions and using C however it was a great and challenging time. I may even look into grabbing a kit now that this popped up..

Advantech has a nice set of USB IO boxes that can be interfaced with anything hardware. They have a nice native .net framework with examples in C#.
The one I'm using is to control a robotic workcell I'm developing:
http://www.advantech.com/products/USB-4751/mod_1-2MLJNA.aspx

If you're specifically looking for hardware, two suggestions I've like to add are Parallax and the ROB Series. Not only can you buy whole robots you can assemble yourself (and let's face it, that's fun too!), but also bits and pieces such as microcontrollers, sensors and accessories, which you can use for your own custom-made projects.
While you will have to roll your coding sleeves before you get to actually command these bots, it's a fun process. I suggest you look into Microsoft's RDS and their DSS and CCR forums to help you get started.

Related

Recording sound in real time with c++ or C#

I have a professional sound card, and I want to record the signals from the guitar with c++ or c# for developing guitar effects in real time.
How can i record in real time through a c++ method ?
Is it mean that I need the sound card API ?
this one is enough?
Although may not be as easy as using a pre-built library, you may be able to get a C++ SDK for your sound card from the manufacturer. I would start by browsing their site or contacting support.
If that isn't an option, you can also use DirectSound which is part of the DirectX family of products. The learning curve is fairly steep but I believe it should do just about anything you want.
One final option is to look at a favorite tool (such as sound forge). A number of these tools support automation which means you can click through the app, decide what you want, then automate that sequence of events (See this as an example).
Hope that helps, best of luck!
Side Note: I have developed a number of hardware interfaces and in my experience its best to start with an example that does at least something like what you are looking for, then modify the code from there. If any particular option doesn't have an example like this I would probably skip it in favor of an example that does.
Examples
Direct Sound - Microsoft has a learning site for direct sound which you can find here. I also found this blog article which has an example for recording audio with direct sound.
Sound Forge - If you download the "Script Developers Kit" there are examples for C# in the scripts folder that should get you started. I believe this particular tool is more focused on editing and effects but I am guessing there should be automation for recording.
To just record audio in real time, any API will be fine. Note that WASAPI is the primary API (since Vista), and legacy APIs like WaveIn API, DirectSound are implemented on top of WASAPI as compatibility layers.
Regular APIs assume you are okay to certain processing latency/overhead, on the order of tens of milliseconds.
If you are going to be faster than this, and you need real time performance, such as to process data and return in back for playback as soon as possible, you need so called exclusive mode streams, where you can achieve latencies on the order of a few milliseconds, which is on par to professional audio development kits.
Windows SDK has a few audio recording samples in \Samples\multimedia\audio (C++)
It's probably a good idea to use a third party library for that.
There's a multitude of options. The ones I know of are portaudio and STK.
I like the Fmod API which supports recording (Sound recording with FMOD library) and realtime effects.

What tools do I need to make a GIS/GPS Navigation Software by C#

I have been assigned to know to how to make a GPS Navigation Software for Win CE 6.0 operating system. But after searching a lot, I couldn't find a good way to start.
I have downloaded some free software by which i can view the provided ShapeFile files but I want to make a software by which I can view those files in my customized mode.
My preferred technology is .NET 3.5 / 4 and my OS supports silverlight.
You can visit this link what exactly I want to do.
Thanks in advance.
I have to work on a predefined data set (shape files) provided by my client and i have to put my app in GlobalSat [GA-5718] device.
Your suggestions are very fine but it won't work for me. Thats why I am in a confusing position.
At first you'll need to get access to the GPS data and read it. Most GPS modules act as a serial device on some COM port and provide their information in the NMEA Standard.
To get this easily read you should take a look at the OpenNETCF Serial Library, cause it provides an easy access to the informations and is able to read the NMEA strings.
But most GPS modems needed to be initialized by sending a correct NMEA input string. For these you should take a look into this documentation, this site or in the comment in the source above function public bool SendGpsMessage(string GPSSentence).
With these informations you should have a good starting point to correct read in the GPS data. Visualization of these informations to the user (like showing a Map with the current position) is another task. But maps.google.com API would be a possible candidate if you software runs on a machine with internet connection and you don't mind the costs for this connection.
The fact that you are asking this question strongly suggests you do not have the resources or ability to write it from scratch (it is a substantial project). Therefore you will have to use existing toolkits. You mention Silverlight, so I suspect you are going to be working in an online environment. Therefore I would recommend the Bing Maps Silverlight Control. IMHO, this outperforms the Google Maps control at the moment - but it is a moving target. This is a place where active competition results in two products (Google Maps & Bing Maps) constantly trying to out do each other.
If this is for a commercial application, then check the EULAs for these services - although many enthusiasts assume they are free, this is not necessarily the case. Most commercial applications cost significant sums ($1000s per month). In such a situation, the choice of service will probably come down to cost rather than technology.

Creating a usb time lapse for Cannon EOS Rebel XS using a c# program

I am wondering if this is even possible. I want to make my own software to control the release of the shutter via the remote shutter release. From the diagrams I have seen it has a 3.3 v (no load) and a threshold voltage of 1.8v. I am wondering if I can use limit a usb cables voltage which is around 5.25v, if I am understanding correctly. Is this even possible, or do I need to look in a new direction. I am hoping to write the software in c# which I am fairly confident in.
Thank you in advance for your help :)
I've played a lot with these type of shutter remotes, for both the sony alpha and for the canon line of dslr's. For the cannon, it is usually a 2.5mm stereo plug. It has 3 contacts: ground, focus and shutter. Shorting each one of them and you will trigger that function in the camera.
http://www.doc-diy.net/photo/eos_wired_remote/
A few years ago, I designed my own circuitry that would take serial commands from the host (in my case an HP Pocket PC) and drive one of the lines down using a microcontroller GPIO port.
Nowadays there are similar devices with much easier connection and control options. And if you'd like to take the DIY road, there are very nice options such as the arduinos or if you're a c# addict, there are the netduinos.
Here's a commercially available solution, including SDK:
http://www.breezesys.com/DSLRRemotePro/features.htm
Working with USB devices in .Net is not the most straightforward task... There are no libraries in the BCL to deal with USB. However, it is possible to use Win32 API's.
This article should get you started in the right direction, as far as accessing a USB device if you want to pursue this.
As for whether it's possible, it might be... I don't rule anything out, but I think you're in for a LOT of research time to make it work if it's possible at all. (I've never seen anything in the Win32 API documentation that allows you to control the voltage, for example). However, it would be very cool if you could make it work, and the satisfaction factor alone may be worth the try.
Added
I took a look at PInvoke.net (a very good site for learning about Win32 API calls) to see if they cover power management for USB drives, and I see nothing at all.
http://www.pinvoke.net/search.aspx?search=usb&namespace=[All]#

Snapping pictures from Windows C# Canon SDK vs PTP or MTP

I am hoping to receive some general guidance on accomplishing a seemingly simple goal. I have a DSLR camera (Canon EOS 50D) and need to write an application that will tell the camera to take a picture. I also need to transfer the picture to the computer and possibly delete it from the camera's storage. A bonus would be to get a live preview from the camera in my application. My environment will be Windows (either XP Pro or Vista Enterprise) and .Net 3.5 (C#).
I have done some research and found a couple of options. One I know will work, but limits me to using only Canon cameras in the future. I have found and downloaded an SDK from Canon that provides a lot of this functionality. I've looked over the SDK and while it's extensive and written in C it does have C# wrappers that will speed up development a bit.
Another option I've found is called Windows Portable Devices. Apparently, it is an API that will talk to devices that implement PTP and MTP standards. It is COM based and as far as I can tell it has no .Net wrappers. This is not however a show stopper. I could P/Invoke the functionality I need or write a Managed C++ DLL to use in my application to talk to the camera.
I am looking for anyone with experience with WPD to give me pointers. I've perused the documentation and seen references to transferring images and deleting images. I have not, however, seen mention of commands to take a picture, get a preview image, or say focus/auto-focus.
The WPD api provides the command WPD_COMMAND_STILL_IMAGE_CAPTURE_INITIATE
I am not sure whether your camera supports it but it should be simple enough to find out. If you can get the "wpdinfo" tool from the driver development kit and start it with your camera connected then send it a WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_COMMANDS command and see if it supports the still image capture command. IF so then you could give that a try.
The comment from TallGanglyGuy is incorrect. ptp does allow you to trigger new images and change exposure, etc. Some cameras have firmware that only exposes some of the ptp commands.
PTP supports common device controls, such as taking a picture, so that
the user could take advantage of the PC/camera combination in new and
different ways again, without requiring additional software.
quoted from http://msdn.microsoft.com/en-us/windows/hardware/gg463507.aspx#EXC
try my Eos Framework: https://github.com/esskar/Canon.Eos.Framework
IMHO it's a better alternative then the .cs file that comes with the SDK.
PTP and MTP are both protocols for transferring files from a digital still camera (DSC). The protocols provide no functionality for triggering new images, or setting exposure control. You will be stuck using the camera specific SDK. If you want multiple vendor support Nikon has an SDK that provides similar support as the Canon SDK for their cameras.
More info on PTP and MTP can be found here:
http://en.wikipedia.org/wiki/Picture_Transfer_Protocol
and
http://en.wikipedia.org/wiki/Media_Transfer_Protocol
EDIT
I forgot to mention that WIA may be interesting to you, assuming your camera's driver provides a WIA interface.
This is really generic, but it may help.
I had to write an application that used two different bar code scanners from two different vendors with different SDK's. I created an interface that defined the methods and events that I wanted to code for, and then wrote adapter classes that implemented my interface.
This worked well in my case, and switching from one to the other was pretty seamless. If you took the same approach, you wouldn't be totally dependent upon one SDK.

Wiimote example programs

I'd like to use the Wiimote (accelerometers, gyroscopes, infrared camera, etc, etc, etc) on various applications.
It's a bluetooth device, and I know others have connected it to their computer.
What's the easiest way to start using it in my software - are there libraries for C#, for instance?
I want my software to be usable and easily installable - what's the current easiest way to connect a wiimote to the computer? Can I make that process part of my software installation?
-Adam
Have you seen Johnny Chung Lee's 'Procrastineering' Blog? He's written a lot on the subject of using wii remotes and has some fantastic demonstration videos. [Edit] I just found out Mr Lee did a TED talk which gives a good introduction to the stuff he's done too...
There's a wealth of information over on Wiibrew.org - check out their Wiimote Library page for some other APIs if you want to look beyond c#. As an avid Python fan, I'm quite curious to have a play with the pyWiimote library :-)
Coding4Fun had a managed C# library up that would allow you to interface with it but it seems their site is down right now. Though I think they used the Robotics Studio so that may be a place to start.
Found it... http://www.codeplex.com/WiimoteLib
Oh and I forgot to post a link to these videos I saw quite some time ago. http://www.cs.cmu.edu/~johnny/projects/wii/
If you use WiimoteLib (from Coding4Fun as mentioned in another answer), there is an example application called WiimoteTest. This tests all of the Wiimote inputs and outputs, including for multiple Wiimotes at the same time, so it is a good starting point for your own Wiimote code as it gives you an example of how to do pretty much anything you would want to.
For the second part of your question, connecting the Wiimote to the computer is pretty much the same as connecting any other Bluetooth device. I don't know that it would be very suitable to have this done at installation as it is likely to be connected and disconnected a lot, especially since the Wiimote will turn itself off if not used for a while. However, it's pretty much a matter of following a standard Windows wizard to connect to it, so it's not too hard. This assumes you have a Bluetooth driver that will work with the Wiimote - more information on that is available at the Coding4Fun website. It worked for me with the default driver that already came with my laptop but if it doesn't for you, the one they recommend is BlueSoleil.
what's the current easiest way to
connect a wiimote to the computer?
I not found solution for connect wiimote within my software, you have to connect manually into Windows, but on Windows register bluetooth device it very take time, Try Toshiba bluetooth stack it more convenient.

Categories