Skip to content

Commit

Permalink
Remove some unused functions from rtt_executor.hpp.
Browse files Browse the repository at this point in the history
Nobody was ever calling them.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette committed Sep 20, 2019
1 parent 9765191 commit d0cbff3
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions pendulum_control/include/pendulum_control/rtt_executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,13 @@ class RttExecutor : public rclcpp::executor::Executor
/// Default destructor
virtual ~RttExecutor() {}

/// Return the status of rttest.
// \return True if rttest has initialized, false if it is uninitialized or has finished.
bool is_rttest_ready() const
{
return rttest_ready;
}

/// Return true if the executor is currently spinning.
// \return True if rclcpp is running and if the "running" boolean is set to true.
bool is_running() const
{
return rclcpp::ok() && running;
}

/// Retrieve the results measured by rttest
// \param[in] output A struct containing performance statistics.
void get_rtt_results(rttest_results & output) const
{
output = results;
}

void set_rtt_results_message(pendulum_msgs::msg::RttestResults & msg) const
{
msg.cur_latency = last_sample;
Expand Down Expand Up @@ -104,23 +90,6 @@ class RttExecutor : public rclcpp::executor::Executor
rttest_ready = rttest_running();
}

/// Instrumented "spin_some"
/**
* This function can have unexpected results if it is called in succession with a non-monotonic
* input value. It is up to the user to ensure "i" increases linearly.
* \param[in] The iteration for this spin operation, and the index into rttest's data buffer.
* \return Pass the error code from rttest (0 on success, non-zero error code on failure).
*/
int rtt_spin_some(size_t i)
{
// Initialize the start time if this is the first iteration.
if (i == 0) {
clock_gettime(0, &start_time_);
}
// Wrap Executor::spin_some into rttest.
return rttest_spin_once(RttExecutor::loop_callback, static_cast<void *>(this), &start_time_, i);
}

/// Core component of the executor. Do a little bit of work and update extra state.
// \param[in] Anonymous argument, will be casted as a pointer to an RttExecutor.
static void * loop_callback(void * arg)
Expand Down

0 comments on commit d0cbff3

Please sign in to comment.