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

Allow ros console macros to be reused for node / nodelet code #2

Open
chadrockey opened this issue Dec 18, 2012 · 1 comment
Open

Comments

@chadrockey
Copy link
Member

Low priority, wait til rainy day:

It would be nice to automatically handle the appropriate behavior based on if the software was running from a node or a nodelet.

It seems the best way to write a nodelet is to:

  1. Underlying ROS agnostic library
  2. ROS Class around library that uses nodehandles
  3. Nodelet that instantiates class
  4. Node that instantiates class

This provides the advantages of nodelets while still allowing stable debugging and separation with a pure node implementation. This helps to allow easier problem identification and more flexible use over other implementations that either load a nodelet programatically or duplicate often complex wrapper code

However, for step 2) Using the rosconsole macros is difficult, as the Class does not know if its a nodelet for a node. It could be possible to define in the class, all of the possible combinations and provide new macros based on a "is_nodelet" variable, but it would be cleaner for users if this was either automatically detected or had a standardized header and interface available.

Here's an example of this layout. Note that currently I use ROS_****, even inside the nodelet. This causes the output to look like it's from the manager. https://github.com/ros-perception/depthimage_to_laserscan

  1. Library
  2. ROS Class
  3. Nodelet
  4. Node

tl;dr:
It would be great to reuse ROS_INFO for both nodelets and nodes and have the getName() autodetect where its coming from.

@dirk-thomas dirk-thomas added this to the untargeted milestone Apr 21, 2014
@dirk-thomas
Copy link
Member

The API of nodes and nodelets is by design different. It is unlikely that this will be changed in the near future (without breaking API). Therefore marking this with milestone untargeted.

johnsonshih added a commit to johnsonshih/nodelet_core that referenced this issue Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants