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

[nodelet] Public api to check nodelet is initialized #34

Open
wants to merge 1 commit into
base: indigo-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions nodelet/include/nodelet/nodelet.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ class Nodelet
/**\brief Empty constructor required for dynamic loading */
Nodelet();

/**\brief Whether the nodelet is initialized */
bool is_initialized();

/**\brief Init function called at startup
* \param name The name of the nodelet
* \param remapping_args The remapping args in a map for the nodelet
Expand Down
7 changes: 6 additions & 1 deletion nodelet/src/nodelet_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ ros::NodeHandle& Nodelet::getMTPrivateNodeHandle() const
return *mt_private_nh_;
}

bool Nodelet::is_initialized()
{
return inited_;
}

void Nodelet::init(const std::string& name, const M_string& remapping_args, const V_string& my_argv,
ros::CallbackQueueInterface* st_queue, ros::CallbackQueueInterface* mt_queue)
{
Expand All @@ -129,8 +134,8 @@ void Nodelet::init(const std::string& name, const M_string& remapping_args, cons
mt_nh_->setCallbackQueue(mt_queue);

NODELET_DEBUG ("Nodelet initializing");
inited_ = true;
this->onInit ();
inited_ = true;
}

} // namespace nodelet