Giter Club home page Giter Club logo

pyimc's People

Contributors

oysstu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pyimc's Issues

Vehicle not connected & Estimated State

Hi Oysstu,

first of all thanks for developing this awesome project!

I'm trying to develop an avoidance system for UAV and I'll like to use pyimc for sending instructions to the vehicle. I installed pyimc using the current IMC, Dune and Neptus versions available in their repositories with python 3.7. I'm using a DUNE simulation of the 'lauv-xplore-1' vehicle to test keyboard_input_example.py but I'm not able to use it correctly. It works to stop the vehicle but the start method doesn't work:

INFO:pyimc.actors.base:Starting file log (/tmp/pyimc/ccu-pyimc-jm/20211203/083813)
DEBUG:asyncio:Using selector: EpollSelector
DEBUG:pyimc.actors.base:Connected nodes: []
DEBUG:pyimc.actors.base:Connected nodes: [(30, 'lauv-xplore-1')]
DEBUG:pyimc.actors.base:Connected nodes: [(30, 'lauv-xplore-1')]
start
INFO:examples.KeyboardActor:Vehicle not connected

In addition, I tried to get more info about the estimated state using @Subscribe(pyimc.EstimatedState) but I doesn't get any response, which could be an answer to why the start method in keyboard_input_example.py says that the vehicle is not connected.

Any help will be appreciated!

Best regards

Juan

Generating bindings from a already existing build package

Hi,

I really like the functionality of this module!

When I develop with DUNE, I usually have a build folder (with a generated package containing all libraries/include files, using make package). In stead of re-building dune when generating the python bindings, should it not be possible to simply use this folder? IMC can be put in this folder as well, using make imc_download.

I wanted to take a crack at this myselves, but I am not to familiar with the Extensions framework.

Best regards,
Kristian

Document the library

No documentation currently exists for the library, only a few examples. Create generated documentation online using e.g. readthedocs.io.

Users are assumed to familiarize themselves with the IMC specification and how to use that in relation to systems running DUNE. This documentation would strictly be related to the implemented actors, node map, decorators, lsf parsing, and exposed DUNE functionality

Implement events and event handlers

The current actor structure allows for a base class to expose functions that can be overridden in child classes; e.g. on_node_disconnect can be called by IMCBase and implemented in user code. When implementing nested actors (e.g. to handle different aspects of DUNE/IMC interactivity) through inheritance, this is limiting as multiple actors cannot override the same function. This leads to either duplicated calls or function implementation.

Another way to get around this issue is to add a decorator which subscribes to events, for example through an enumeration

from enum import Enum, auto

class IMCEvent(Enum):
    NODE_CONNECT    = auto()
    NODE_TIMEOUT    = auto()
    PLAN_START      = auto()
    PLAN_STOP       = auto()

class TestActor(IMCBase):
    @OnEvent(IMCEvent.NODE_CONNECT)
    def node_connected(self, node):
        ...

If the number of events are limited, this can also be handled through individual decorators

class TestActor(IMCBase):
    @OnConnect()
    def node_connected(self, node):
        ...

Filtering of incoming messages for subscriptions

When implementing subscriptions to IMC messages, one often has to filter the incoming messages based on some criteria. E.g. if the message are coming from a specific system, or is being sent to a target system, or that the actor is in a certain state

One proposed quality of life improvement wrt. this is the addition of a filtering input to the subscription decorator itself. Usage would look as follows

class TestActor(IMCBase):
    @Subscribe(pyimc.EstimatedState)
    def without_filter(self, msg):
        if msg.src == 0x5501:
            # Do stuff
            ...

    def filter(self, msg):
        return msg.src == 0x5501

    @Subscribe(pyimc.EstimatedState, filter=TestActor.filter)
    def with_filter(self, msg):
        # Do stuff immediately

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.