Code Monkey home page Code Monkey logo

ros_music_adapter's People

Watchers

 avatar

ros_music_adapter's Issues

Implement on/off ports for DVS adapter

The DVS adapter should provide three outgoing ports: "out_on" for on-events, "out_off" for off-events and "out" for both kinds of events.

When providing all three ports (see implementation), but not connecting all of them, a SegFault in MUSIC arises, when entering the runtime:

[node16:30140] *** Process received signal ***
[node16:30140] Signal: Segmentation fault (11)
[node16:30140] Signal code:  (128)
[node16:30140] Failing at address: (nil)
[node16:30140] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xf890) [0x7f72c657e890]
[node16:30140] [ 1] /home/hoff/.local/lib/libmusic.so.1(_ZN5MUSIC15EventOutputPort10buildTableEv+0x29) [0x7f72c9575d79]
[node16:30140] [ 2] /home/hoff/.local/lib/libmusic.so.1(_ZN5MUSIC7Runtime11buildTablesEPNS_5SetupE+0x24) [0x7f72c9553db4]
[node16:30140] [ 3] /home/hoff/.local/lib/libmusic.so.1(_ZN5MUSIC7RuntimeC1EPNS_5SetupEd+0x2cc) [0x7f72c955483c]
[node16:30140] [ 4] music(_ZN10DVSAdapter11runROSMUSICEv+0x105) [0x40e5b5]
[node16:30140] [ 5] music(main+0x9b) [0x40d6fb]
[node16:30140] [ 6] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f72c57b9b45]
[node16:30140] [ 7] music() [0x40d828]
[node16:30140] *** End of error message ***

The MUSIC code on the DVS adapter side looks like this:

    // [...]
    port_out = initOutput("out", width_);
    // TODO MUSIC bug ...
    port_out_polarity[true] = NULL; // initOutput("out_on", width_);
    port_out_polarity[false] = NULL; // initOutput("out_off", width_);
}

MUSIC::EventOutputPort* DVSAdapter::initOutput(std::string name, int &width)
{
    MUSIC::EventOutputPort* port = setup->publishEventOutput(name);
    if (port->isConnected())
    {
        if (not port->hasWidth())
        {
            std::cout << "ERROR: port " << name << " has no width" << std::endl;
            comm.Abort(2);
        }

        int width_ = port->width();
        if (width != -1 and width_ != width)
        {
            std::cout << "ERROR: node has inconsistent output widths (" << width << " != " << width_ << ")" << std::endl;
            comm.Abort(3);
        }
        width = width_;

        // map linear index to event out port
        MUSIC::LinearIndex l_index_out(0, width_);
        port->map(&l_index_out, MUSIC::Index::GLOBAL, 1);
    }
    else
    {
        port = NULL;
    }
    return port;
}

This issue shall document the problem in the implementation until a fix is available.

@mdjurfeldt @weidel-p FYI

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.