Skip to content

Commit 1e526d2

Browse files
Janosch MachowinskiJanosch Machowinski
authored andcommitted
chore: fixed typos
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
1 parent 0cae831 commit 1e526d2

File tree

6 files changed

+35
-31
lines changed

6 files changed

+35
-31
lines changed

rclcpp/include/rclcpp/executors/events_cbg_executor/events_cbg_executor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ class EventsCBGExecutor : public rclcpp::Executor
222222
return FutureReturnCode::INTERRUPTED;
223223
}
224224

225-
/// We need these fuction to be public, as we use them in the callback_group_scheduler
225+
/// We need these function to be public, as we use them in the callback_group_scheduler
226226
using rclcpp::Executor::execute_subscription;
227227
using rclcpp::Executor::execute_timer;
228228
using rclcpp::Executor::execute_service;

rclcpp/include/rclcpp/timer.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ class TimerBase
190190
void
191191
clear_on_reset_callback();
192192

193+
/// Returns the clock this timer uses
194+
RCLCPP_PUBLIC
195+
const Clock::SharedPtr & get_clock() const;
196+
193197
protected:
194198
std::recursive_mutex callback_mutex_;
195199
// Declare callback before timer_handle_, so on destruction

rclcpp/src/rclcpp/executors/events_cbg_executor/events_cbg_executor.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ void EventsCBGExecutor::shutdown()
126126
// we need to shut down the timer manager first, as it might access the Schedulers
127127
timer_manager->stop();
128128

129-
bool was_spining = spinning;
129+
bool was_spinning = spinning;
130130

131131
// signal all processing threads to shut down
132132
spinning = false;
133133

134-
if(was_spining) {
134+
if(was_spinning) {
135135
scheduler->release_all_worker_threads();
136136
}
137137

@@ -193,15 +193,15 @@ bool EventsCBGExecutor::execute_previous_ready_executables_until(
193193

194194
while(true) {
195195
auto ready_entity = scheduler->get_next_ready_entity(last_ready_id);
196-
if(!ready_entity.entitiy) {
196+
if(!ready_entity.entity) {
197197
break;
198198
}
199199

200200
found_work = true;
201201

202-
ready_entity.entitiy->execute_function();
202+
ready_entity.entity->execute_function();
203203

204-
scheduler->mark_entity_as_executed(*ready_entity.entitiy);
204+
scheduler->mark_entity_as_executed(*ready_entity.entity);
205205

206206
if(std::chrono::steady_clock::now() >= stop_time) {
207207
break;
@@ -335,7 +335,7 @@ EventsCBGExecutor::run(size_t this_thread_number, bool block_initially)
335335
sync_callback_groups();
336336

337337
auto ready_entity = scheduler->get_next_ready_entity();
338-
if(!ready_entity.entitiy) {
338+
if(!ready_entity.entity) {
339339
scheduler->block_worker_thread();
340340
continue;
341341
}
@@ -344,9 +344,9 @@ EventsCBGExecutor::run(size_t this_thread_number, bool block_initially)
344344
scheduler->unblock_one_worker_thread();
345345
}
346346

347-
ready_entity.entitiy->execute_function();
347+
ready_entity.entity->execute_function();
348348

349-
scheduler->mark_entity_as_executed(*ready_entity.entitiy);
349+
scheduler->mark_entity_as_executed(*ready_entity.entity);
350350
}
351351
}
352352

@@ -361,18 +361,18 @@ EventsCBGExecutor::run(
361361
sync_callback_groups();
362362

363363
auto ready_entity = scheduler->get_next_ready_entity();
364-
if(!ready_entity.entitiy) {
364+
if(!ready_entity.entity) {
365365
scheduler->block_worker_thread();
366366
continue;
367367
}
368368

369369
try {
370-
ready_entity.entitiy->execute_function();
370+
ready_entity.entity->execute_function();
371371
} catch (const std::exception & e) {
372372
exception_handler(e);
373373
}
374374

375-
scheduler->mark_entity_as_executed(*ready_entity.entitiy);
375+
scheduler->mark_entity_as_executed(*ready_entity.entity);
376376
}
377377
}
378378

@@ -384,7 +384,7 @@ void EventsCBGExecutor::spin_once_internal(std::chrono::nanoseconds timeout)
384384
}
385385

386386
auto ready_entity = scheduler->get_next_ready_entity();
387-
if(!ready_entity.entitiy) {
387+
if(!ready_entity.entity) {
388388
if (timeout < std::chrono::nanoseconds::zero()) {
389389
// can't use std::chrono::nanoseconds::max, as wait_for
390390
// internally computes end time by using ::now() + timeout
@@ -396,14 +396,14 @@ void EventsCBGExecutor::spin_once_internal(std::chrono::nanoseconds timeout)
396396

397397
ready_entity = scheduler->get_next_ready_entity();
398398

399-
if (!ready_entity.entitiy) {
399+
if (!ready_entity.entity) {
400400
return;
401401
}
402402
}
403403

404-
ready_entity.entitiy->execute_function();
404+
ready_entity.entity->execute_function();
405405

406-
scheduler->mark_entity_as_executed(*ready_entity.entitiy);
406+
scheduler->mark_entity_as_executed(*ready_entity.entity);
407407
}
408408

409409
void

rclcpp/src/rclcpp/executors/events_cbg_executor/first_in_first_out_scheduler.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ CBGScheduler::ExecutableEntityWithInfo FirstInFirstOutScheduler::get_next_ready_
163163
std::optional<FirstInFirstOutScheduler::ExecutableEntity> ret =
164164
ready_cbg->get_next_ready_entity();
165165
if(ret) {
166-
return CBGScheduler::ExecutableEntityWithInfo{.entitiy = std::move(ret),
166+
return CBGScheduler::ExecutableEntityWithInfo{.entity = std::move(ret),
167167
.moreEntitiesReady = !ready_callback_groups.empty()};
168168
}
169169
}
170170

171-
return CBGScheduler::ExecutableEntityWithInfo{.entitiy = std::nullopt,
171+
return CBGScheduler::ExecutableEntityWithInfo{.entity = std::nullopt,
172172
.moreEntitiesReady = false};
173173
}
174174

@@ -187,12 +187,12 @@ CBGScheduler::ExecutableEntityWithInfo FirstInFirstOutScheduler::get_next_ready_
187187
ready_cbg->get_next_ready_entity(max_id);
188188
if(ret) {
189189
ready_callback_groups.erase(it);
190-
return CBGScheduler::ExecutableEntityWithInfo{.entitiy = std::move(ret),
190+
return CBGScheduler::ExecutableEntityWithInfo{.entity = std::move(ret),
191191
.moreEntitiesReady = !ready_callback_groups.empty()};
192192
}
193193
}
194194

195-
return CBGScheduler::ExecutableEntityWithInfo{.entitiy = std::nullopt,
195+
return CBGScheduler::ExecutableEntityWithInfo{.entity = std::nullopt,
196196
.moreEntitiesReady = false};
197197
}
198198
} // namespace cbg_executor

rclcpp/src/rclcpp/executors/events_cbg_executor/scheduler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class CBGScheduler
230230

231231
struct ExecutableEntityWithInfo
232232
{
233-
std::optional<ExecutableEntity> entitiy;
233+
std::optional<ExecutableEntity> entity;
234234
bool moreEntitiesReady{};
235235
};
236236

rclcpp/test/benchmark/benchmark_executor.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ class PerformanceTestExecutor : public PerformanceTest
6464
rclcpp::shutdown();
6565
}
6666

67-
template<class Executer>
67+
template<class Executor>
6868
void executor_spin_some(benchmark::State & st)
6969
{
70-
Executer executor;
70+
Executor executor;
7171
for (unsigned int i = 0u; i < kNumberOfNodes; i++) {
7272
executor.add_node(nodes[i]);
7373
}
@@ -106,19 +106,19 @@ class PerformanceTestExecutor : public PerformanceTest
106106
}
107107
}
108108

109-
template<class Executer>
109+
template<class Executor>
110110
void benchmark_wait_for_work(benchmark::State & st)
111111
{
112-
class ExecuterDerived : public Executer
112+
class ExecutorDerived : public Executor
113113
{
114114
public:
115115
void call_wait_for_work(std::chrono::nanoseconds timeout)
116116
{
117-
Executer::wait_for_work(timeout);
117+
Executor::wait_for_work(timeout);
118118
}
119119
};
120120

121-
ExecuterDerived executor;
121+
ExecutorDerived executor;
122122
for (unsigned int i = 0u; i < kNumberOfNodes; i++) {
123123
executor.add_node(nodes[i]);
124124
}
@@ -344,7 +344,7 @@ class CallbackWaitable : public rclcpp::Waitable
344344

345345
class CascadedPerformanceTestExecutor : public PerformanceTest
346346
{
347-
std::condition_variable cascase_done;
347+
std::condition_variable cascade_done;
348348
std::vector<std::shared_ptr<CallbackWaitable>> waitables;
349349
std::atomic<bool> last_cb_triggered;
350350

@@ -365,7 +365,7 @@ class CascadedPerformanceTestExecutor : public PerformanceTest
365365
auto callback = [this, i](test_msgs::msg::Empty::ConstSharedPtr) {
366366
if (i == kNumberOfNodes - 1) {
367367
this->callback_count++;
368-
cascase_done.notify_all();
368+
cascade_done.notify_all();
369369
} else {
370370
publishers[i + 1]->publish(empty_msgs);
371371
}
@@ -387,7 +387,7 @@ class CascadedPerformanceTestExecutor : public PerformanceTest
387387
waitables[i]->set_execute_callback_function(
388388
[this]() {
389389
last_cb_triggered = true;
390-
cascase_done.notify_all();
390+
cascade_done.notify_all();
391391
});
392392
} else {
393393
waitables[i]->set_execute_callback_function(
@@ -441,7 +441,7 @@ class CascadedPerformanceTestExecutor : public PerformanceTest
441441
// start the cascasde
442442
waitables[0]->trigger();
443443

444-
cascase_done.wait_for(lk, 500ms);
444+
cascade_done.wait_for(lk, 500ms);
445445

446446
if (!last_cb_triggered) {
447447
st.SkipWithError("No message was received");

0 commit comments

Comments
 (0)