-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Splitted base/types to seperate cpp and hpp files #94
Conversation
Would be great if a few people could test this, since this is a fairly big change. |
Tested, works. |
One Problem I have with this PR, is that it is a single commit. It would be much better to have multiple commits, since there seem to be different changes involved. Also, (I havent' checked) it would be important imho to have the original authorships preserved. |
Just glancing over it, I'd also prefer having it split into smaller commits. At least one flaw: You copied the old/broken About In the cpp-files, you could embrace everything into Also, I'd prefer keeping the very simple getter/setter functions inlined in the header (I did not benchmark that, but I'd guess some will have measurable impact on runtime). |
This is a duplicate of the buildin allFinite()
This one includes SVD, which is a big include in the base eigen.
@jakobs I made the tests compile again. But there's one inconvenience: Since we moved the method guaranteeSPD from base/Eigen.hpp to TwistWithCovariance.cpp - because it's the only class where it is used - the test suite test_Eigen.cpp cannot compile anymore. What to do now? Remove test_Eigen.cpp? Or make the guaranteeSPD an interface function of TwistWithCovariance. But that would cause to put the templated method into the header again and make it public. |
It's a bit hacky, but include the cpp file in the test. That should work fine. |
Done. Works fine |
This of course makes the declaration of |
Please, do not move the guaranteeSPD method to TwistWithCovariance.cpp |
We could leave the function in Eigen.hpp but hide the actual implementation in a function which accepts only Addendum: I do think that removing |
We could also leave it a template and move it into some other header. It was moved out of the Eigen.hpp header, as it adds a couple of includes. |
Both solution could work, but please do not move it to TwistWithcCovariance. |
Moving it to a separate header (which is not included by Eigen.hpp) would make a difference, because a lot of packages are (indirectly) including Eigen.hpp (but don't need |
Alright. I am also fine with it and it seems the easiest 👍 |
I moved guaranteeSPD to it's own header, removed Eigen includes from TwistWithCovariance and made its .cpp dependend on new Matrix.hpp |
There was still the concern #94 (comment) to keep the very trivial functions inside the header, i.e., at least the one-liner functions which are unlikely to change (and don't depend on including heavy external headers). This was also addressed on the mailing list. Other than that, I don't have objections, though I did not actually test the most recent version. Regarding orogen/compile time: This change will actually save a lot of additional time since at the moment (almost) every package needs to be rebuild even for small changes in function bodies. |
This is not critical and can be changed over time if needed. I would prefer to merge now, so that we don't collide any more with other merges going into base types. |
|
||
}; | ||
|
||
static Temperature operator+( Temperature a, Temperature b ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is not correct (and the compiler warns about it!). It was static inline before, which is fine since the header was always in the respective compilation unit. When declaring it, static means the function is local to this compilation unit, and will not get exported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be declared as friend method inside the class. Alternatively, (also inside the class) as
Temperatur operator+(const Temperature & other) const;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just removing the static should be ok. It was working with the original code.
@jmachowinski All right, I'm fine with that (but I guess, I don't have the final call on this). |
This is base-types. No one does have "the final call on this" |
And 👍 on Janosch's point. It's good enough for now, let's dwelve into C++11 / optimizations later. |
Ok, I don't have any more objections. From my point this is good to merge. |
|
||
static Temperature operator*( double a, Temperature b ); | ||
Temperature operator*( double a, Temperature b ); | ||
|
||
static std::ostream& operator << (std::ostream& os, Temperature temperature); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this static
must be removed as well (this gives a [-Wunused-function]
warning, too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Especially because a static of a declaration looks absolutely wrong.... You can't be static without a body defined somewhere.
Compiles fine in fresh bootstrap and my own project |
We splitted the base-types header-only lib into a separate .cpp/.hpp implementation due to very long orogen parsing times. The old implementation needed about 8 minutes (on a SSD) to finish the orogen phase in base/orogen/types. With the new concept, an enhancement of nearly 6 minutes (parsing times around 2 minutes) can be achieved. Furthermore, we removed some deprecated stuff.
Split Pose.hpp into implementation and header
Float.hpp: Use std function, not boost ones
Eigen: remove isnotnan and isfinite
This is a duplicate of the buildin
allFinite()
move guaranteeSPD into TwistWithCovariance.
This one includes SVD, which is a big include in the base eigen.
moved Wrench.hpp to new src
moved TwistWithCovariance.hpp to new lib/src
moved Waypoint to new src folder
re-patched new isnan interface
splitted TransformWithCovariance
splitted Timueout
moved headers to cpp files
splitted TimeMark
removed inlining
splitted Time
splitted Temperature
moved Point
splitted Pressure
fixed compile errors
Added correct PC file for base-types, made base-lib a dummy
moved CircularBuffer
moved Deprecated
moved JointLimitRange
moved JointLimits
moved JointState
moved JointTransform
moved JointsTrajectory
moved NamedVector
moved Odometry
added odometry
ported rest of types
re-removed vector included
changed dep to right lib name
compile fixes