Robot Engage Blog Buy Now
Blog

Misty Community Forum

Training Mission: Explore Misty's .NET SDK

Mission Objective: Set up your environment and explore the examples in the IntroSkills sample project to learn how to build and deploy skills with Misty’s .NET SDK
Mission Type: Training
Launch Date: 12/03/2019
End Date: Ongoing

Mission Overview

Misty’s .NET SDK (Beta) is here, and with it comes an advanced set of tools for building mission critical skills with Visual Studio and the .NET framework. As a quick intro, here are a few things the .NET SDK provides:

  • Powerful libraries for building skills with C#
  • Project template for setting up your own .NET skill projects with Visual Studio
  • Ability to use external .NET libraries for advanced local handling of sensor data & other input
  • Preview of a mock robot API for simulating event data & command responses, so you can test skills without deploying them to a robot

We’re eager for the community to start using these tools, which is why we chose .NET as the focus of this set of Missions!

Mission Details

As with other Missions, this one comes in two parts: a training mission, and a competitive challenge.

The training mission – the mission you’re reading now – is all about setting up your environment to build .NET skills for Misty. You’ll learn about the structure of a .NET skill by exploring the documentation and experimenting with the IntroSkills sample project. You’ll also install the Misty Skills Extension for Visual Studio, which will make it easier to start building your own .NET skills from scratch. Then, put what you’ve learned to the test by building and sharing your own .NET skill in the competitive part of the mission.

The guide below includes a set of activities you can work through to set up your environment and get familiar with the .NET SDK. These activities will give you a taste of how to use the SDK before you start working on the challenge portion of the mission.

  1. First things first. Start by setting up your environment to use the .NET SDK. Follow the steps in our Getting Started guide to install/modify Visual Studio with all the workloads and components for building .NET skills.
  2. When you have Visual Studio installed, download the C# Skill Template. The template makes it easy to create a new C# project with the background task and skill code files you need to build a .NET skill.
  3. Now for the fun part. Along with the SDK itself, we’ve prepared a sample project with several runnable C# skills that you can explore to learn about the different features of Misty’s .NET SDK. Clone or download the .NET-SDK repo from GitHub, then check out the docs and run through the contents of the IntroSkills sample project. This is a great sandbox for learning about the structure of a .NET skill, and you’ll find many examples of different ways to do things like issue commands, register event listeners, and validate event data.

Once you’re comfortable with the inner-workings of the .NET SDK, join the challenge to build and share your own .NET skill for Misty!

Other Materials

In addition to the above, the following resources will aid you on this mission:

  • Skill Class Members - Provides an overview of the required elements of your .NET skill code.
  • Command Syntax - Examples of the different ways to issue a command from a .NET skill.
  • Data Handling - Examples of the different ways to register and unregister event listeners and handle event messages with callbacks.
  • File System Access - Describes how to access files stored in Windows “Known Folders” from your .NET skill code.
  • Creating a .NET Skill App Package - Describes how to build an app package so you can deploy .NET skills from Skill Runner

Mission Support

Hit a roadblock? Find a bug? Have feedback? Let us know! As Misty’s earliest developers, you are the real superstars on the journey to making personal robots a reality. Your creativity makes all this possible, and we’re eager to hear your feedback. Reply to this post to start a conversation with a member of the Misty team.

Hi Johnathan,

I successfully ran a .NET skill on Misty with my VS2019. It’s safe to say the SDK installation procedure, tool and sample CS programs should work well for anyone currently using VS2017 and planning to upgrade to VS2019 in the future. I like this .NET version of Misty SDK. I’ll work on some new skill in .NET to demo.

Thanks,
Phillip

1 Like

Awesome. Can’t wait to see it!

The video @Chris posted helped me out, and I was able to get a C# Skill to Misty, and run it.
Link here: 2019.12.04 - Misty Uplink: C# SDK Discussion with Misty's Sr. Software Engineer

I am using Visual Studio Community 2019. My non-developer skills are showing here, and the jump from JavaScript to C# and from Visual Studio Code to Visual Studio 2019 is a little intimidating. One immediate question I have: When a .NET SDK Skill is posted to github, what should the directory structure look like and how many files? Is it the whole repo directory? Following the example in the video, I have a MistyCSharpSkillGettingStarted directory. Does the entire directory go to Github?

With JavaScript Misty Skills there are 2 files, a js and a json file. I want to keep it simple and just do one (simple) C# skill.

And if this is a really newbie question, and I should be able to figure this out on my own, just tell me to go figure it out. :slight_smile:

It’s probably easiest to publish your .NET skill project to GitHub directly from Visual Studio. This ought to ensure the relevant files are included for developers who want to deploy the skill from Visual Studio or create an app package for deployment via Skill Runner. (I’m using 2017 for these screenshots, but I’d expect the steps for 2019 to be pretty close to this.)

  1. Follow this guide to creating a new, empty repository on GitHub, but do not select the option to initialize the repo with a README or .gitignore file.
  2. Open the solution for your .NET skill project in Visual Studio.
  3. If you haven’t already initialized a Git repository for the project, then select FileAdd to source control from the top menu.
    aaa
    You should see a message in the console that reads something like this:
  4. Select ViewTeam Explorer
    aac
  5. In Team Explorer, click Sync.
  6. In the Team Explorer, you should see an option Push to Remote Repository. Click Publish Git Repo under this option and enter the URL for the empty GitHub repo you created in step 1. Should be something like https://github.com/githubUsername/repoName.git
    aad
  7. Click Publish.
  8. Share the heck out of it in the Misty Community site :slight_smile:
1 Like

@Johnathan. Thanks for the help.

On Step 1, you should also not include a license file. Including anything will make it so that the newly created repository is ahead of your skill…and you will run into problems. However, problems are where you learn, so if you figure out how to recover from this, let me know. I couldn’t and (reluctantly) punted and started over.

In Step 6, There are 3 choices after hitting Sync - Push to Github, Push to Azure, and last Push to Remote Repository. Scroll down to the last one.

Here is a link to a skill created using the Misty Skill Extension. It blinks the LED blue. 3 times. Wow.

But this shows the minimum content of a basic .NET skill, which is what I was after. The only code I added were the Wait and ChangeLED lines in the MistySkill.cs OnStart method.

Now (maybe) on to actually writing a .NET C# Skill.

A post was split to a new topic: Misty Skill: Robo-Comedian

Hi @Johnathan. I was able to get through the tutorial, and change the Sample Project Skill from MostlyHarmlessSkill to ForceDriving. Successfully deployed on Misty. ForceDriving is a fun skill to play with! Your explanation on Github above helped quite a lot. The documentation to get Visual Studio set up with Extensions and deploy is spot on, and kept me on track. Just had to read it…

I tried to write a simple C# skill that is the same as my existing paceDrive function, basically converting over the JavaScript code.

I was able to get DriveHeading to work, but not DriveArc. I have looked through all sample code and could not find a DriveArc usage instance. And I am sure it is documented somewhere, but I could not find it (Where should I look?). I was able to get DriveTime to work to turn Misty, but that is a completely different set of calibrations! :slight_smile: Learning a ton, thanks for the guides.

Pointing out one gotcha - You have to be careful with units, since they are different between programming languages. In Javascript, DriveHeading Distance is in meters, and in C#, DriveHeading Distance is in mm! Is there a reason for this or am I missing something and reading it wrong?

Thanks for all the feedback!

MorningR:

I was able to get DriveHeading to work, but not DriveArc. I have looked through all sample code and could not find a DriveArc usage instance. And I am sure it is documented somewhere, but I could not find it (Where should I look?). I was able to get DriveTime to work to turn Misty, but that is a completely different set of calibrations! :slight_smile: Learning a ton, thanks for the guides.

It looks like there’s a bug in Misty’s .NET libraries wherein the DriveArc command isn’t mapped correctly. This should be fixed soon; we’ll add a known issue for this so you can track our progress.

As for complete reference docs for the .NET libraries, we haven’t released anything, yet. We anticipate the libraries will change and improve quite a bit over the next few release cycles, and we’re waiting until the “beta” dust has settled a bit to publish official reference docs. That said, you should be able to find descriptions for everything in-line thanks to the magic of IntelliSense :slight_smile:

I’d attribute the units mis-match to the “beta”-nature of the SDK, too; likely just a bit of dust that hasn’t yet been scrubbed. I believe the intent is for API commands to use the same units across SDKs :slight_smile: