Skip to content
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

GCC 4.7 Template Use Fix #748

Merged
merged 7 commits into from
Mar 21, 2014
Merged

GCC 4.7 Template Use Fix #748

merged 7 commits into from
Mar 21, 2014

Conversation

jgoppert
Copy link
Member

This fixes our use of templates for BlockParam/ UOrbSub/UOrbPub.

Before the templates were linking only in one module and being thrown away in the rest. This made it impossible to use templates unless they were only used once, such as the current att_pos_ekf_estimator. Also this fixed the explicit typing of BlockParamInt/ BlockParamFloat (which was being used in multiple modules).

also:

  • UOrbSublication/UOrbPublication were moved to the uORB module, now uORB::Publication/ Subscription
  • List.hpp was moved from controllib to src/include/containers

*
*/

#include "UOrbPublication.hpp"
#include "Subscription.hpp"
#include "topics/parameter_update.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

help me: why are (only) these topics listed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only instantiated the templates currently using the C++ wrappers in the code base. We can add to this list as more are required. It would also be possible to make ORB_DEFINE do this automatically, but this could lead to instantiated templates that we never use (if strip fails to remove them). If you use a new template that isn't listed you will get a link error that should make it obvious you need to add the template instantiation to the uORB library. We could also typedef the currently available instantiated templates as Subscription_parameter_update etc if this would be helpful.

@jgoppert
Copy link
Member Author

This last commit brings the code up to where it can support my roboclaw segway work. It adds the encoder message. I also tried enabling fixedwing_backside and building it, which now works. Enabling the fixedwing backside build also required instantiating several commonly used templates for control work. So the template instantiation list thomas mentioned should now be more complete/useful out of the box for users.

@thomasgubler
Copy link
Contributor

I just added a subscription to an app using this interface (outside of the apps of @jgoppert) and it successfully compiled. As mentioned in the description of this PR this was not possible before.

@LorenzMeier
Copy link
Member

This looks good to me @thomasgubler If you have run it, I propose to merge.

@thomasgubler
Copy link
Contributor

@jgoppert is this tested from your side beyond the compilation?

@jgoppert
Copy link
Member Author

I can verify that for my segway controller that it is successfully arming/ changing modes etc using the uORB::Pub/Sub. I am still working on updating my segway motor controller driver for the v2 so I haven't gotten that running yet. It would also be possible to enable fixedwing backside and verify in HIL, but I haven't done that yet.

@jgoppert
Copy link
Member Author

This was now tested live on my segway, so it should be good to merge.

thomasgubler added a commit that referenced this pull request Mar 21, 2014
@thomasgubler thomasgubler merged commit 49bdfa8 into PX4:master Mar 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants