Giter VIP home page Giter VIP logo

Comments (4)

doudou avatar doudou commented on July 30, 2024

.... You bad, bad person.

While I do agree with you on the principle, I really want to say this: SERIOUSLY ?

from orogen.

goldhoorn avatar goldhoorn commented on July 30, 2024

;-) Good Morning Sylvain.

This was again such as "bad things happen" event.
I know this seems ugly and of course it is, but it happened because i used this struct first:

 4 struct battery_data{
  5     unsigned state:8;
  6     unsigned cell_voltage0:16;
  7     unsigned cell_voltage1:16;
  8     unsigned cell_voltage2:16;
  9     unsigned cell_voltage3:16;
 10     unsigned cell_voltage4:16;
 11     unsigned cell_voltage5:16;
 12     unsigned cell_voltage6:16;
 13     unsigned cell_voltage7:16;
 14     unsigned temperature:16;
 15     unsigned error_state:8;
 16 } __attribute__ ((packed)) __attribute__((__may_alias__));

unfourtnalty orogen still accepts this structure, but typelib can not handle these bitfields correctly, so because of this "it has to work quickly" daily working ways is simply added a "C++ like header for the only serialization-used C header which has a simliar name. This resulted in this next orogen "bug".

... daily computer scientest work ...

P.S. i know i could had used uint8_t in this example, but the structure was different in early versions so i used bitfields...

from orogen.

jmachowinski avatar jmachowinski commented on July 30, 2024

Hm, in general, we got a problem with bitfields. In typelib all offsets are in byte. If you define a type using bitfields, were the members are not alligend to 8 bit, it will fail. The clang importer has a check for these.

from orogen.

doudou avatar doudou commented on July 30, 2024

This is solved by the new-style Types access (Types.BatteryData vs Types.battery_data). Closing.

from orogen.

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.