Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Commit c3b4c55

Browse files
committed
Added functions Nodelet::ok() and Nodelet::requestStop().
1 parent 3eabcdc commit c3b4c55

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

nodelet/include/nodelet/nodelet.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,12 @@ class NODELETLIB_DECL Nodelet
234234
ros::CallbackQueueInterface* st_queue = NULL,
235235
ros::CallbackQueueInterface* mt_queue = NULL);
236236

237+
/**\brief Whether it is OK to continue working with this nodelet. This function starts returning true right
238+
* before onInit() is called and starts returning false when the nodelet is requested to unload.
239+
* \return Status of the nodelet.
240+
*/
241+
bool ok() const;
242+
237243
virtual ~Nodelet();
238244
};
239245

nodelet/src/nodelet_class.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Nodelet::Nodelet ()
4545

4646
Nodelet::~Nodelet()
4747
{
48+
inited_ = false;
4849
}
4950

5051
ros::CallbackQueueInterface& Nodelet::getSTCallbackQueue () const
@@ -134,4 +135,9 @@ void Nodelet::init(const std::string& name, const M_string& remapping_args, cons
134135
this->onInit ();
135136
}
136137

138+
bool Nodelet::ok() const
139+
{
140+
return inited_;
141+
}
142+
137143
} // namespace nodelet

0 commit comments

Comments
 (0)