Archive for category EnglishPost

[#VS11] Some colors are back in Visual Studio 11

image

Buenas,

and it is that about VS11 Beta was somewhat intolerable. A little more bland and it was like chewing wet cardboard. Now it seems that we will have a Carnival of colors that help us think seriously if both work with redial blue not burn us the vista for the next RC.

In the post of the Visual Studio product team are all examples, but some I do not end like.

For example, defining a clearer than the current grey background color and mark the selected elements into blue, is very Metro, but I do not know if this idea is correct for an IDE.

image

image

Not to mention if we above begin to use colors as indicators of State or progress. The Rio film will be a movie in black and white next to the new Visual Studio.

image

That Yes, there are some interesting things like the new colors of the Solution Explorer or a friendlier toolbar

image

image

Although, after a couple of months, I ended up getting used to the new IDE and I understand that with this I will do the same.

That Yes, in my next life I want to be an expert in user experience Risa

Source: http://blogs.msdn.com/b/visualstudio/archive/2012/05/08/visual-studio-11-user-interface-updates-coming-in-rc.aspx

 

Saludos @ Home

El Bruno

image image image

Dejar un comentario

[# VS11] Test Scribe now with support for Microsoft Test Manager 11

image

Buenas,

Quick note so I will not forget about this:

Test Scribe. that extension that lets you generate documentation from Microsoft Test Manager information, now supports working with Visual Studio 11.

image

By the way, and if you did not know, the tool is created and supported by the Visual Studio QA team Risa

Download: http://visualstudiogallery.msdn.microsoft.com/85b8215f-263f-4d1f-822b-307de339af38

Saludos @ Home

El Bruno

image image image

Dejar un comentario

[#OPINION] From Programmer to Manager, what has happened to my.

ALM 03

Buenas,

today I hit him a push and I finish the post Meanwhile AVE, travel and showrooms of innovation, I don’t have much time.

A couple of days Juan Quijano (@ jc_quijano) and Alvaro Roca published a series of articles where talked about the pros and cons of the path "of programmer to Manager".

I I am going to comment on my personal opinion, where today I’m not a programmer at 100% but am not a person who is dedicated to the Management in the form that we know it. The first thing that caught my attention in the comments of both posts is The complete DISGUST that shows more than one programmer to switch to a Management position, and of course, I’m 99.9999% sure that this is because they have had bad experiences with team leaders (since now no more managers) who can’t do their job.

In my case in particular, I’ve spent years programming. I am not of those who comment that 4 years they already coding in a Commodore 64 and from there throw lines, but I discovered more than large computer and I loved it from the first day. I spent years learning to program and believe that what most caught my attention is that in this business, we always have to be constantly learning.

When I was in my first job I was fortunate to participate in the creation of a product that started selling internationally and clear, what started as a team of 3 people, began to grow until they not reached me the fingers of one hand to count the team. At that point, it had been years of self-education on new technologies, programming, etc.; He had to become start to learn about elements to ensure that the work we did all as team was consistent, all understood where we wanted to get, etc.

At the same time I came to Spain and as coincided with the release of Visual Studio 2005, as I started to read books that went beyond programming techniques. I met AGILE, I discovered the business behind CMMI, but mainly I realized that unless concrete projects in my career would have to work hard as a team. Is for this reason that I started to try to improve the quality of the deliverables of my team, I tried to make everyone better that I (Germán taught me that the quality of a team is measured by the worst of its members), etc.

By the way, I fell a couple of awards MVPs, where in recent years have been basically Alm MVP category is to recognize and learn how to correctly use the tools of Visual Studio ALM to teamwork.

So well, I’m not a "manager of those" discussed in the posts from Juan Quijano and Alvaro Roca, but if I consider myself one of those trying to carry out a team until you get a satisfied customer and a productive team. Do seems incoherent, no?

By the way, 2 days ago I found a logical problem it took me almost a night build. As I realized that I’m "half Rusty" I am intended to make 30 minutes of Code Kata daily during the month of May.

Do to how many project managers / managers / managers know to do this sort of thing?

References:

 

Saludos @ Home

El Bruno

image image image

Dejar un comentario

[#KINECT] Angry Mouse … ;)

image

Good.

If I were a mouse or mouse would be quite angry / upset / angry or whatever you want in your land. Now comes a device more or less €100 expensive called Microsoft Kinect that aims to replace me and dethrone me in the world of computers. But of course, the anger / anger / anger begins already some time ago, when some guys from a company with a manzanita, reinvent a mobile phone a little big, put iPad name and everyone gets used to

Touch and drag instead of move and click

Then why, if a mouse I would be very angry. But as said the great Groucho Marx

It is better to remain silent and appear stupid than talk and remove doubts definitively.

That’s why that mouse still quietly accompanied by more than one and I think it will take quite some time so definitely leaves us.

Especially when there are many people who, at the time is to create a new user interface, which seek to replace the mouse, for example with gestures and actions about Kinect. These projects are designed and destined to fail in 99.99% of cases.

The key to these cases is in the word "create". What we must do is to leave alone the mouse, thank you for the services provided and start thinking what are the most effective ways of working with the new sensors that we possess.

Now the interaction between most mobile devices, tactile surfaces, as Kinect gestures detectors, pico projectors, etc.; It makes us think in new scenarios for applications that can really be great or disastrous.

Some will ask, you little sleep has affected the Bruno or what he writes this?, is very simple. As some have noticed that I like to play with Kinect and such devices, many times I get questions like

  • How can I do to replace the mouse with Kinect?
  • Not be how to double click with Kinect, when I try to replace the mouse.

And while it is true that I try to answer everything what you ask me, for those questions the answer this post. Where I do not respond nothing in particular but… well now you know.

I Luckily, have not only the opportunity to "play" with these devices but they are also part of my job at Avanade, so I can see the good and bad experiences in the world of the NUI (term beater to describe natural forms of work with electronic devices). Many people don’t realize that Kinect, for example, need considerable to be effective space, or that on a touch device because the sensitivity of the touch is not the same as a mouse.

Finally, a fact to keep in mind:

During the year 2008 the number of devices connected to the internet surpassed the number of people on Earth. By 2020 it is expected to be more than 50 billion devices connected to the internet. (Source ))

Does this mean?, which in addition to having a Mustang 100% connected to the internet, we will now have to interact with many types of new devices and of course, our friend the mouse will not be there to help us and is not a question that we emulate the functioning of mouse everywhere.

So I do not keep my mouse right now, but already begin to see how that can work in different spaces without a mouse… then I will see that device gives me the best help in that scenario Risa

By the way

1 As the layman has been me boy, wait to see what I’m doing with my RX8, a Kinect, a tablet with Windows 8, etc. limitedin the hands of a piece of code C#. My girl is a little scared but the Valentino super happy to play with the car from a tablet… Risa

.2 The ratonazo angry / upset / angry took out it of http://abstract.desktopnexus.com/get/134212?t=08tt07vgrel6eo8knisme46jh34fa00c9fcba2b

Saludos @ Home

El Bruno

image image image

Dejar un comentario

[# TFService] A couple of good news

image

Buenas,

thanks to the great Brian Harry now we can make public some of the new features incorporated the other TFS > Team Foundation Service (for me is still and unfortunate choice of name).

  • On the one hand we have an interface much more "touch friendly", meaning that if you want to control the TaskBoard or product BackLog from a touch device is much simpler. If like me you want to do are applications of control with Kinect, also much simplifies work.
  • Vast selection of the provider of security when only there are LiveId. One form less and much more happy people.
  • Filters in some important parts and… little more.
  • Ahh and a new look & feel much more metro Risa

image

Source: http://blogs.msdn.com/b/bharry/archive/2012/04/30/tfspreview-update.aspx

Saludos @ Home

El Bruno

image image image

Dejar un comentario

[# VIDEO] Magic with Kinect (augmented reallity)

image

Buenas,

After a couple of hours playing Kinect Star Wars with Valentino, hurts body parts that did not know. So this week is a bit of return to ALM, because I start a video that has absolutely nothing to do with ALM, but that is impressive in what refers to deployment of assets.

Link: http://youtu.be/C4pHP-pgwlI

The interesting thing about the video is that it is a technology that most of us could implement and create in our own House. I already have been "playing" with a bit of reality augmented with Kinect and the truth is that while it does need to know a little of how the images in general, is not so complicated.

This a few years ago was crazy just thinking, but thanks to Kinect and Kinect SDK, then what we now have easier.Impressive, is not it?

Saludos @ Home

El Bruno

image image image

Dejar un comentario

[#KINECTSDK] Kinect Missile Launcher (V): Video and source code

image

Buenas,

First we go with the links of the series

  1. Identifying the Missile Launcher
  2. Moving the Rocket missile launcher
  3. Another wayt to find out the values to work in C# with the rocket launcher
  4. Using the Rocket Launcher with Kinect
  5. Video and Source code

And now a video of 30 seconds where I show you a small example of the application running

Link: http://youtu.be/ATxtYes6pBQ

Disclaimer: when I fire the missile, it comes with a power like a HALO gun, so the few frames per second of the Kinect camera can not capture the missile on its flight. I also put the missile rocket launcher in front of the Kinect camera to record the video, so the capture of the skeleton goes a bit bad, and perform some strange recognitions in the video.

And finally, the code source of the application can be downloaded from https://skydrive.live.com/redir.aspx?cid=bef06dffdb192125 & SPL = BEF06DFFDB192125! 4275 & parid = BEF06DFFDB192125! 1932 & authkey =!AOhNmp_md8XLYbo

Saludos @ Home

El Bruno

image image image

Dejar un comentario

[#KINECTSDK] Kinect Missile Launcher (IV): Using the Rocket Launcher with Kinect

image

Buenas,

today already we will create an application that allows us to control the Lance missiles using Kinect gestures. For this I have thought of the following controls

  • The right hand controls the direction of the Lance missiles. You can go to the right, left, up or down.
  • The left hand controls the firing of the missile, shoot is raise your hand above the head.
  • If both hands are below the waist stop movements of the Lance missile

On this basis, and taking advantage of Visual controls of "Microsoft.Samples.Kinect.WpfViewers" I created a WPF application with the following code in the main window

 

   1: using System.Linq;

   2: using System.Windows;

   3: using Microsoft.Kinect;

   4:  

   5: namespace ElBruno.Rocket.Ui

   6: {

   7:     public partial class MainWindow

   8:     {

   9:         private KinectSensor _sensor;

  10:         private Rocket _rocket;

  11:         public MainWindow()

  12:         {

  13:             InitializeComponent();

  14:             Loaded += MainWindowLoaded;

  15:         }

  16:  

  17:         private void MainWindowLoaded(object sender, RoutedEventArgs e)

  18:         {

  19:             InitRocket();

  20:             InitKinectSensor();

  21:         }

  22:  

  23:         private void InitRocket()

  24:         {

  25:             _rocket = new Rocket(@"vid_0a81", @"pid_ff01");

  26:             _rocket.Connect();

  27:         }

  28:  

  29:         private void InitKinectSensor()

  30:         {

  31:             // validate

  32:             if (KinectSensor.KinectSensors.Count == 0) return;

  33:  

  34:             // init Kinect

  35:             var parameters = new TransformSmoothParameters

  36:                                  {

  37:                                      Smoothing = 0.75f,

  38:                                      Correction = 0.1f,

  39:                                      Prediction = 0.0f,

  40:                                      JitterRadius = 0.05f,

  41:                                      MaxDeviationRadius = 0.08f

  42:                                  };

  43:  

  44:             _sensor = KinectSensor.KinectSensors[0];

  45:             _sensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);

  46:             _sensor.DepthStream.Enable(DepthImageFormat.Resolution320x240Fps30);

  47:             _sensor.SkeletonStream.Enable(parameters);

  48:             _sensor.Start();

  49:             colorViewer.Kinect = _sensor;

  50:             skeletonViewer.Kinect = _sensor;

  51:             _sensor.SkeletonFrameReady += SensorSkeletonFrameReady;

  52:         }

  53:  

  54:         private void SensorSkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)

  55:         {

  56:             Skeleton[] skeletons = null;

  57:             using (var frame = e.OpenSkeletonFrame())

  58:             {

  59:                 if (frame != null)

  60:                 {

  61:                     skeletons = new Skeleton[frame.SkeletonArrayLength];

  62:                     frame.CopySkeletonDataTo(skeletons);

  63:                 }

  64:             }

  65:  

  66:             if (skeletons == null) return;

  67:  

  68:             foreach (var kinectRocketGestures in (

  69:                 from skeleton in skeletons

  70:                 where skeleton.TrackingState == SkeletonTrackingState.Tracked

  71:                 let headJoint = skeleton.Joints[JointType.Head]

  72:                 where headJoint.TrackingState != JointTrackingState.NotTracked

  73:                 select skeleton).Select(skeleton => new KinectRocketGestures(skeleton, _rocket)))

  74:             {

  75:                 var gesture = kinectRocketGestures.ValidateGestures();

  76:                 textBlockInformation.Text = gesture;

  77:             }

  78:         }

  79:     }

  80: }

It is important to note that this window has almost nothing interesting logic only starts the sensors of the Kinect and the Lance missiles and then subscribe to the skeleton update notifications.

In this notification (line 54), it validates that the tracking of the skeleton is correct and then we use a class KinectRocketGestures that is what makes a little magic between Kinect and the Lance missiles.

This class code is as follows

   1: using Microsoft.Kinect;

   2:  

   3: namespace ElBruno.Rocket.Ui

   4: {

   5:     class KinectRocketGestures

   6:     {

   7:         private readonly Skeleton _skeleton;

   8:         private readonly Rocket _rocket;

   9:  

  10:         public KinectRocketGestures(Skeleton skeleton, Rocket rocket)

  11:         {

  12:             _skeleton = skeleton;

  13:             _rocket = rocket;

  14:         }

  15:  

  16:         public string ValidateGestures()

  17:         {

  18:             var gesture = @"Not defined";

  19:             // STOP

  20:             // Right hand and Left hand hanging at the side

  21:             if (_skeleton.Joints[JointType.HandRight].Position.Y < _skeleton.Joints[JointType.HipCenter].Position.Y &&

  22:                 _skeleton.Joints[JointType.HandLeft].Position.Y < _skeleton.Joints[JointType.HipCenter].Position.Y)

  23:             {

  24:                 _rocket.StopAll();

  25:                 _rocket.StopFiring();

  26:                 _rocket.StopMovements();

  27:                 gesture = @"STOP";

  28:                 return gesture;

  29:             }

  30:  

  31:             // FIRE

  32:             if (_skeleton.Joints[JointType.HandLeft].Position.Y > _skeleton.Joints[JointType.Head].Position.Y)

  33:             {

  34:                 gesture = @"FIRE";

  35:                 _rocket.FireOnce();

  36:             }

  37:  

  38:             // MOVE RIGHT OR LEFT

  39:             // Right hand in front of right shoulder

  40:             // Right hand below shoulder height but above hip height

  41:             if (

  42:                 (_skeleton.Joints[JointType.HandRight].Position.Z < _skeleton.Joints[JointType.ElbowRight].Position.Z &&

  43:                 _skeleton.Joints[JointType.HandLeft].Position.Y < _skeleton.Joints[JointType.HipCenter].Position.Y)

  44:                 &&

  45:                 (_skeleton.Joints[JointType.HandRight].Position.Y < _skeleton.Joints[JointType.Head].Position.Y &&

  46:                 _skeleton.Joints[JointType.HandRight].Position.Y > _skeleton.Joints[JointType.HipCenter].Position.Y)

  47:                 )

  48:             {

  49:                 // Right hand right of right shoulder

  50:                 if (_skeleton.Joints[JointType.HandRight].Position.X > _skeleton.Joints[JointType.ShoulderRight].Position.X)

  51:                 {

  52:                     gesture = @"MOVE RIGHT";

  53:                     _rocket.MoveRight();

  54:                 }

  55:                 // Right hand left of left Shoulder

  56:                 if (_skeleton.Joints[JointType.HandRight].Position.X < _skeleton.Joints[JointType.ShoulderLeft].Position.X)

  57:                 {

  58:                     gesture = @"MOVE LEFT";

  59:                     _rocket.MoveLeft();

  60:                 }

  61:             }

  62:  

  63:             // MOVE UP OR DOWN

  64:             // Right hand in front of body with Left hand hanging at the side

  65:             // Right hand between shoulders

  66:             if (

  67:                 (_skeleton.Joints[JointType.HandRight].Position.Z < _skeleton.Joints[JointType.ShoulderCenter].Position.Z &&

  68:                 _skeleton.Joints[JointType.HandLeft].Position.Y < _skeleton.Joints[JointType.HipCenter].Position.Y)

  69:                 &&

  70:                 (_skeleton.Joints[JointType.HandRight].Position.X < _skeleton.Joints[JointType.ShoulderRight].Position.X &&

  71:                 _skeleton.Joints[JointType.HandRight].Position.X > _skeleton.Joints[JointType.ShoulderLeft].Position.X)

  72:                 )

  73:             {

  74:                 // Right hand above the shoulders

  75:                 if (_skeleton.Joints[JointType.HandRight].Position.Y > _skeleton.Joints[JointType.ShoulderCenter].Position.Y)

  76:                 {

  77:                     gesture = @"MOVE UP";

  78:                     _rocket.MoveUp();

  79:                 }

  80:                 // Right hand below the chest/gut

  81:                 if (_skeleton.Joints[JointType.HandRight].Position.Y < _skeleton.Joints[JointType.Spine].Position.Y)

  82:                 {

  83:                     gesture = @"MOVE DOWN";

  84:                     _rocket.MoveDown();

  85:                 }

  86:                 return gesture;

  87:             }

  88:         }

  89:     }

  90: }

And that’s it! A bit of validation of the right hand and left hand positions and have control of the Lance missiles using Kinect.

Now I’m going fast to the MadridDotNet event and in the next post I put a video and the example of the application code.

 

Saludos @ La Finca

El Bruno

image image image

1 comentario

[#KINECTSDK] Kinect Missile Launcher (III): another way to find out the values to work in C# with the rocket launcher

image

Buenas,

as I have received several questions about how to interpret the input buffer and output USB devices, will leave an easy way of doing this.

Personally, I use the technique of the trial and error; but of course, this brings you many problems head and best work with some low level language (C# sucks!).

So if you’re a friend of abstractions, USB Monitor may be helpful. This software allows you to monitor the flow of data that is sent in the USB hubs. In other words you can see one one the bytes that pass through each USB port.

In my particular case, and with the full version installed, I configured the same so that it captures all the information that passes through the second HID device. Now I noticed that the first is the mouse.

image

So once defined the device we want to attack, the following is to start with the recording of data. In my particular case, I have not applied any filter.

I launched the implementation of control of the Lance missiles that comes with it and I launched a missile. This is the trace will let me log

   1: 000238: Class-Specific Request Sent (DOWN), 24.04.2012 23:33:07.320 +22.500
   2: Request Type:Set Report (Data Field)
   3: Report Type:Output
   4: ReportID:0x0
   5: Parsed Report:
   6: Report Name:Unknown
   7: Unknown[-128..127]/[0..255]: 64
   8:  
   9: 000239: Class-Specific Data (UP), 24.04.2012 23:33:07.320 +0.0
  10: Request Type:Set Report (Data Field)
  11:  
  12: 000240: Report Arrived (UP), 24.04.2012 23:33:07.335 +0.015
  13: Report Name:Unknown
  14: Unknown[-128..127]/[0..255]: 0
  15:  
  16: 000241: Report Arrived (DOWN), 24.04.2012 23:33:07.335 +0.0
  17: Report Name:Unknown
  18: Unknown[-128..127]/[0..255]: 0
  19:  
  20: 000242: Class-Specific Request Sent (DOWN), 24.04.2012 23:33:07.335 +0.0
  21: Request Type:Set Report (Data Field)
  22: Report Type:Output
  23: ReportID:0x0
  24: Parsed Report:
  25: Report Name:Unknown
  26: Unknown[-128..127]/[0..255]: 16
  27:  
  28: 000243: Class-Specific Data (UP), 24.04.2012 23:33:07.335 +0.0
  29: Request Type:Set Report (Data Field)
  30:  
  31: 000244: Class-Specific Request Sent (DOWN), 24.04.2012 23:33:07.850 +0.514
  32: Request Type:Set Report (Data Field)
  33: Report Type:Output
  34: ReportID:0x0
  35: Parsed Report:
  36: Report Name:Unknown
  37: Unknown[-128..127]/[0..255]: 64
  38:  
  39: 000245: Class-Specific Data (UP), 24.04.2012 23:33:07.850 +0.0
  40: Request Type:Set Report (Data Field)
  41:  
  42: 000246: Report Arrived (UP), 24.04.2012 23:33:07.866 +0.015
  43: Report Name:Unknown
  44: Unknown[-128..127]/[0..255]: 16
  45:  
  46: 000247: Report Arrived (DOWN), 24.04.2012 23:33:07.866 +0.0
  47: Report Name:Unknown
  48: Unknown[-128..127]/[0..255]: 16
  49:  
  50: 000248: Class-Specific Request Sent (DOWN), 24.04.2012 23:33:07.953 +0.086
  51: Request Type:Set Report (Data Field)
  52: Report Type:Output
  53: ReportID:0x0
  54: Parsed Report:
  55: Report Name:Unknown
  56: Unknown[-128..127]/[0..255]: 64
  57:  
  58: 000249: Class-Specific Data (UP), 24.04.2012 23:33:08.007 +0.053
  59: Request Type:Set Report (Data Field)
  60:  
  61: 000250: Report Arrived (UP), 24.04.2012 23:33:08.026 +0.019
  62: Report Name:Unknown
  63: Unknown[-128..127]/[0..255]: 16
  64:  
  65: 000251: Report Arrived (DOWN), 24.04.2012 23:33:08.026 +0.0
  66: Report Name:Unknown
  67: Unknown[-128..127]/[0..255]: 16
  68:  
  69: 000252: Class-Specific Request Sent (DOWN), 24.04.2012 23:33:14.565 +6.539
  70: Request Type:Set Report (Data Field)
  71: Report Type:Output
  72: ReportID:0x0
  73: Parsed Report:
  74: Report Name:Unknown
  75: Unknown[-128..127]/[0..255]: 32
  76:  
  77: 000253: Class-Specific Data (UP), 24.04.2012 23:33:14.565 +0.0
  78: Request Type:Set Report (Data Field)
  79:  
  80: 000254: Class-Specific Request Sent (DOWN), 24.04.2012 23:37:05.977 +231.412
  81: Request Type:Set Report (Data Field)
  82: Report Type:Output
  83: ReportID:0x0
  84: Parsed Report:
  85: Report Name:Unknown
  86: Unknown[-128..127]/[0..255]: 64
  87:  
  88: 000255: Class-Specific Data (UP), 24.04.2012 23:37:05.977 +0.0
  89: Request Type:Set Report (Data Field)
  90:  
  91: 000256: Report Arrived (UP), 24.04.2012 23:37:05.977 +0.0
  92: Report Name:Unknown
  93: Unknown[-128..127]/[0..255]: 0
  94:  
  95: 000257: Report Arrived (DOWN), 24.04.2012 23:37:05.977 +0.0
  96: Report Name:Unknown
  97: Unknown[-128..127]/[0..255]: 0
  98:  
  99: 000258: Class-Specific Request Sent (DOWN), 24.04.2012 23:37:06.040 +0.062
 100: Request Type:Set Report (Data Field)
 101: Report Type:Output
 102: ReportID:0x0
 103: Parsed Report:
 104: Report Name:Unknown
 105: Unknown[-128..127]/[0..255]: 16
 106:  
 107: 000259: Class-Specific Data (UP), 24.04.2012 23:37:06.040 +0.0
 108: Request Type:Set Report (Data Field)
 109:  
 110: 000260: Class-Specific Request Sent (DOWN), 24.04.2012 23:37:06.102 +0.062
 111: Request Type:Set Report (Data Field)
 112: Report Type:Output
 113: ReportID:0x0
 114: Parsed Report:
 115: Report Name:Unknown
 116: Unknown[-128..127]/[0..255]: 64
 117:  
 118: 000261: Class-Specific Data (UP), 24.04.2012 23:37:06.196 +0.093
 119: Request Type:Set Report (Data Field)
 120:  
 121: 000262: Report Arrived (UP), 24.04.2012 23:37:06.211 +0.015
 122: Report Name:Unknown
 123: Unknown[-128..127]/[0..255]: 16
 124:  
 125: 000263: Report Arrived (DOWN), 24.04.2012 23:37:06.211 +0.0
 126: Report Name:Unknown
 127: Unknown[-128..127]/[0..255]: 16
 128:  
 129: 000264: Class-Specific Request Sent (DOWN), 24.04.2012 23:37:06.258 +0.046
 130: Request Type:Set Report (Data Field)
 131: Report Type:Output
 132: ReportID:0x0
 133: Parsed Report:
 134: Report Name:Unknown
 135: Unknown[-128..127]/[0..255]: 64
 136:  
 137: 000265: Class-Specific Data (UP), 24.04.2012 23:37:06.367 +0.109
 138: Request Type:Set Report (Data Field)
 139:  
 140: 000266: Report Arrived (UP), 24.04.2012 23:37:06.367 +0.0
 141: Report Name:Unknown
 142: Unknown[-128..127]/[0..255]: 16
 143:  
 144: 000267: Report Arrived (DOWN), 24.04.2012 23:37:06.367 +0.0
 145: Report Name:Unknown
 146: Unknown[-128..127]/[0..255]: 16
 147:  
 148: 000268: Class-Specific Request Sent (DOWN), 24.04.2012 23:37:06.430 +0.062
 149: Request Type:Set Report (Data Field)
 150: Report Type:Output
 151: ReportID:0x0
 152: Parsed Report:
 153: Report Name:Unknown
 154: Unknown[-128..127]/[0..255]: 32
 155:  
 156: 000269: Class-Specific Data (UP), 24.04.2012 23:37:06.523 +0.093
 157: Request Type:Set Report (Data Field)

If we look at the packages sent (CS Request Sent) we can see the following sequence

  • 64
  • 16
  • 64
  • 64
  • 32

Also have the time difference between each call. For my test I her I rounded to 50 milliseconds and I created a sample application are the following code:

   1: using System;

   2: using System.Threading;

   3: using USBHIDDRIVER;

   4:  

   5: namespace HidUsbDriverConsoleTest

   6: {

   7:     internal class Program

   8:     {

   9:         private static void Main(string[] args)

  10:         {

  11:             var usb = new USBInterface(@"vid_0a81", @"pid_ff01");

  12:             usb.Connect();

  13:             WriteData(usb, 64);

  14:             WriteData(usb, 16);

  15:             WriteData(usb, 64);

  16:             WriteData(usb, 64);

  17:             WriteData(usb, 32);

  18:             Console.ReadLine();

  19:         }

  20:         private static void WriteData(USBInterface usb, byte secondByteValue)

  21:         {

  22:             var command = new byte[] { 0, 2 };

  23:             command[1] = secondByteValue;

  24:             usb.UsbDevice.writeDataSimple(command);

  25:             Thread.Sleep(50);

  26:         }

  27:     }

  28: }

As you can see, lines 13-17 simulate this sequence and time to interact with the Lance missiles USB, then do the same as the original application.

Simpler is impossible Risa

Download: http://www.hhdsoftware.com/usb-monitor

 

Saludos @ Home

El Bruno

image image image

1 comentario

[#KINECTSDK] Kinect Missile Launcher (II): moving the rocket missile launcher

image

Buenas,

In the post yesterday explaining how to work with a HID device. Today we will see how to work with it, sending information to the device.

The first thing we must do is decide that library will use to work with a HID device. In my case I will use one that works pretty well, created by Florian Leitner-Fischer, and that can be downloaded from here.

In the post on the previous link, Florian explains the necessary groundwork about how works its creation. In this post we will do the following:

  • Connect to the device
  • Validate the connection
  • Send a message to move the Lance missiles USB

For this we follow the following steps

1. Create a console application

2. Add a reference to the USBHIDDRIVER library

image

3 Change the settings so that the application is X 86, rather than AnyCPU

4. Already we have our application list

Next we need to determine the VendorId and ProductId of our application. While we saw in the previous post, the following lines of code show us all HID devices you have connected

   1: var getAllDevices = new USBHIDDRIVER.USBInterface("_");

   2: getAllDevices.Connect();

   3: var devices = getAllDevices.getDeviceList();

   4: foreach (var device in devices)

   5: {

   6:     Console.WriteLine("device: " + device);

   7: }

When we run the application, we see this output in the console Windows

device: \\?\hid#vid_413c & pid_3012 # 7 & 39484631 & 0 & 0000 # {4d1e55b2-f16f-11cf-88cb-001111000030}

device: \\?\hid#vid_0a81 & pid_ff01 # 7 & b08aa68 & 0 & 0000 # {4d1e55b2-f16f-11cf-88cb-001111000030}

Assuming that our device is the second, the values be thus:

  • VendorId = vid_0a81
  • ProductId = pid_ff01

If for example move the missile down, we have to pass an array of bytes with 2 elements, zero and two. The code would be as follows:

   1: var usb = new USBHIDDRIVER.USBInterface(@"vid_0a81", @"pid_ff01");

   2: usb.Connect();

   3: var startCMD = new byte[2] {0, 2};

   4: // move down

   5: usb.UsbDevice.writeDataSimple(startCMD);

Well, if you you’ve downloaded the library of Florian, you see that the writeDataSimple() function does not exist. This is because Florian adds a double validation process to send always "clean" arrays to USB devices.

I am a person who lives to the limit and since I have no fear of the BSOD, create the following function to send messages to the device.

   1: public bool writeDataSimple(byte[] bDataToWrite)

   2: {

   3:     var success = false;

   4:     if (getConnectionState())

   5:     {

   6:         try

   7:         {

   8:             var myOutputReport = new OutputReport();

   9:             success = myOutputReport.Write(bDataToWrite, myUSB.HidHandle);

  10:         }

  11:         catch (AccessViolationException ex)

  12:         {

  13:             success = false;

  14:         }

  15:     }

  16:     return success;

  17: }

The previous function avoids validations on the buffer to send to the device and sends directly to the array of bytes. On many occasions this might return us a false or throw an exception not handled, but if we already know that the Lance missile works with a buffer of 2 bytes, because we have it easier.

Now, for this information I returned using the SimpleHIDWrite tool. The same when you select a device shows the number of items must have the input array.

image

In my case, and knowing that they were 2 bytes to implement buffer writing, because I began to try the method of trial/error and came to the following values:

  • 00, 00. Stop
  • 00, 01. Down
  • 00, 02. Up
  • 00, 04. Rotation schedule anti
  • 00, 08. Rotation schedule
  • 00, 10. It shoots missiles

With this data I already have almost everything to start. But of course, in the way I find that CodePlex is a project that already gives me interaction with the Lance missiles, with the Wii remote, etc. But of course, it doesn’t work the first and I have no place to write why. But they have an implementation of a class Rocket, the truth is that is very well.

So I replaced the component used for connection with the HID, I’ve done a little refactoring and I has been a class with the following structure.

image

Is now only a little work with KinectSDK and ready!

References:

 

 

Saludos @ Home

El Bruno

image image image

1 comentario

Seguir

Get every new post delivered to your Inbox.

Únete a otros 908 seguidores