Giter Site home page Giter Site logo

Comments (2)

PeterJohnson avatar PeterJohnson commented on September 7, 2024

The idea of SimDevice, per the name, was to provide some level of flexibility to emulate physical hardware devices very efficiently with very simple APIs. Very efficiently in this context meant atomic accesses, rather than mutex-locked, thus the limitation of word-sized data types. In addition, such data types have minimal JNI overhead and are callback friendly, as well as easily visualized in a GUI. AddressableLED isn’t implemented via SimDevice but rather is a custom implementation.

Notably, in addition to SimDevice, we have NetworkTables, which is a pub/sub framework that supports far more complex data values including arrays, strings, and raw and structured/serialized data such as protobuf.

What I don’t want to do is turn SimDevice into NetworkTables. If the ask is to just provide a mutex-locked (rather than atomic) byte array or string value support, it’s something we can look into, but there may be significant performance downsides, so it should be used sparingly.

It’s somewhat unclear to me what hardware you are simulating that would need this complexity of 3D pose information. Normally low level hardware would not provide something quite like this.

from allwpilib.

brettle avatar brettle commented on September 7, 2024

In our particular case, we aren't simulating any real hardware device. Instead we were looking for an easy way to get simulation results (e.g. positions, orientations, velocities, of the robot or particular parts of it) from an external simulator back to a test framework which runs the actual robot code. Since we already have a connection between the test/robot code and the simulator via halsim_ws, we were hoping to piggy-back off of that instead of adding a new communication channel such as NetworkTables.

While I admit that the above use is not what was intended, we also would like to simulate the navX-mxp AHRS device and it does in fact provide complete 3D pose, velocity, and acceleration info (among other data). Support for mutex-locked byte array or string values would allow that data to be transferred efficiently while ensuring that it remains self-consistent.

Based on your response, we're now using NetworkTables for the first case. Fwiw, doing so increased the size of the jar used by the external simulator from 1.6MB to 9.9MB. The absolute size is not a big deal in the larger scheme of things, but the large relative increase is at least worth noting.

I'll let you decide based on the above info whether you want to close this as wont-fix, or keep this open as a possible future feature. Regardless, thanks for the quick response!

from allwpilib.

Related Issues (20)

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.