Coder Social home page Coder Social logo

instantiator / vector-plus Goto Github PK

View Code? Open in Web Editor NEW
25.0 8.0 3.0 125.57 MB

A community application to manage new behaviours for the Anki Vector robot from Digital Dream Labs. Build behaviours as plugins for easy distribution.

C# 90.37% HTML 8.33% CSS 0.64% JavaScript 0.11% Dockerfile 0.34% Shell 0.21%
docker-container vector-robot net-core plugin-system application unofficial-sdk digital-dream-labs anki-vector

vector-plus's Introduction

VectorPlus

A C# library, framework and server for defining and managing new behaviours for the Vector robot (created by Anki, now supported by Digital Dream Labs).

VectorPlus communicates with your robot using the unofficial C# library Anki.Vector.SDK. It is designed to run continuously and maintain a connection to your Vector robot over your home wifi network.

Context

The SDK allows programs to access and control the Vector robot. Some capabilities require that the SDK take full control of the robot. While that is happening, the robot is locked.

VectorPlus creates behaviours that only take control of the robot as they need it, and release that control afterwards.

Current state

The project is still in early stages. You can launch it using VisualStudio and connect to your robot, or run it in a Docker container on any machine.

In planning:

  • Some better state tracking facilities.
  • Some more interesting demo behaviours.
  • Some documentation for writing your own behaviour modules.
  • Fix the docker container segmentation fault issue.
  • Combine VectorPlus.Capabilities.Vision and VectorPlus.Lib.
  • Distribute VectorPlus.Lib as a Nuget package for developers to build against.

Running your VectorPlus server

VectorPlus is under development - some of these details may change going forward.

Due to issues with Docker, I recommend launching the application through Visual Studio.

Launching with Visual Studio

  • Download and run the VectorPlus.Web project from the Visual Studio solution.
  • It's a web server, so visit: http://localhost:5000 to test it on your own machine.

Launching through Docker

There are a number of scripts to help you get started running the app in a Docker container:

  • docker-build.sh - this builds a docker image tagged vectorplusapp using VectorPlus.Web/Dockerfile.
  • docker-run.sh - this starts a docker container named vectorplus, running the app published on port 5000.
  • docker-stop.sh - this stops and removes the vectorplus docker container.
  • docker-shell.sh - this will open a bash shell inside the docker container (helpful if you want to examine it while it's running).
  • docker-launch-bash.sh - this will launch the docker container, but start a bash shell instead of the VectorPlus web server.

Running the web server

NB. Right now, the docker container throws a segmentation fault and halts shortly after launching the application. I'm still exploring options to fix this.

Debugging the container

For the clearest view of what is happening in a vectorplusapp Docker container:

  • Launch one with: docker-launch-bash.sh - this will give you a bash terminal into the container.
  • Launch the web application itself with: dotnet VectorPlus.Web.dll

Connecting to the robot

By default, the application will pick up your Vector SDK if you have that set up. If you're running on a personal machine where you've already set up the SDK, you don't need to do anything.

If you haven't set up the SDK, or you're running VectorPlus as a server on a separate machine (or inside Docker), you can configure the SDK connection to the robot through the Connection page.

Enabling behaviours

Head over to the Configuration page, and upload a module.

Plugins/2020-08-15 demo-behaviour.zip is a zip of the output binaries from VectorPlus.Demo.Behaviours project (which you could build yourself as a part of this Visual Studio solution).

Once you've selected the zip file, press the Upload button.

NB. There's currently a UX bug - so it's not clear that you've selected the file and that it's waiting for you to press Upload.

Once loaded, you can activate a number of different example behaviours to try out with Vector.

Demo behaviours

These behaviours will remain active while the web server runs.

Developing new behaviours

VectorPlus is intended to make it easy to build new behaviours that can co-exist. They can be bundled up and distributed as modules in DLL form for others to install.

Credit

Huge credit to Digital Dream Labs for picking up where Anki left off, maintaining and supporting both Cosmo and Vector robots. If you haven't already purchased a subscription to updates, you can do so at their site.

Other useful tools

vector-plus's People

Contributors

instantiator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vector-plus's Issues

Saving connection configuration violates a unique constraint

On saving RoboConfig from the connection page, a unique constraint is violated in the db.

VectorPlus.Web.Service.VectorPlusBackgroundService.StoreRoboConfig(RoboConfig config) in VectorPlusBackgroundService.cs
+
db.SaveChanges();
VectorPlus.Web.Service.VectorPlusBackgroundService.SetRoboConfigAsync(string robotName, string robotSerial, string email, string password, string ipOverride) in VectorPlusBackgroundService.cs
+
StoreRoboConfig(roboConfig); // store final version with cert and guid
VectorPlus.Web.Controllers.ConnectionController.UpdateAsync(ConnectionViewModel model) in ConnectionController.cs
+
var response = await service.SetRoboConfigAsync(
Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor+TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments)
System.Threading.Tasks.ValueTask<TResult>.get_Result()
System.Runtime.CompilerServices.ValueTaskAwaiter<TResult>.GetResult()

118428435_10164622986585019_6646985092555608700_o

NB. The RoboConfig should be a singleton in the database. This should be fixable by first searching for and removing any existing RoboConfig entries before saving the new one.

To be confirmed: I had believed this was already happening.

The issue could relate to a recent change that switches from creating a database context for each operation, to retaining a long-lived singleton database context.

If that's the case, the issue may be that transaction management needs to be implemented, so that operations can be flushed to the database in order.

Please add some more fun sample behaviours

The sample behaviours in VectorPlus are ok - but there's plenty of room for new, fun, behaviours that people can use out of the box. We can use this issue to track ideas for new behaviours, and then create separate issues to implement them.

Feel free to add a comment with any ideas that you have for new things that Vector could do.

The UX for uploading a plugin is incomplete

When the user selects a plugin to upload, the UI does not show what they have chosen or indicate that it is ready for upload. Expected behaviour ought to be that the plugin filename is shown, and the Upload button should switch from disabled to enabled (with a visual indicator, too) - so that the user knows they can now upload the chosen plugin.

Docker container segmentation fault

The docker container built from VectorPlus.Web/Dockerfile throws a segmentation fault shortly after launching the application. See the docker-build.sh, docker-run.sh, and docker-launch-shell.sh scripts.

There are no other clues at present as to why this happens.

Users may still launch the project from Visual Studio. This is classified as a show-stopper, as dockerisation is a key feature for the project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.