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

Use Clock instead of Rate for backward compatibility of rolling #1864

Merged
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
5 changes: 2 additions & 3 deletions controller_manager/src/ros2_control_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ int main(int argc, char ** argv)
executor, manager_node_name, "", cm_node_options);

const bool use_sim_time = cm->get_parameter_or("use_sim_time", false);
rclcpp::Rate rate(cm->get_update_rate(), cm->get_clock());

const bool lock_memory = cm->get_parameter_or<bool>("lock_memory", true);
std::string message;
Expand All @@ -85,7 +84,7 @@ int main(int argc, char ** argv)
thread_priority);

std::thread cm_thread(
[cm, thread_priority, use_sim_time, &rate]()
[cm, thread_priority, use_sim_time]()
{
if (!realtime_tools::configure_sched_fifo(thread_priority))
{
Expand Down Expand Up @@ -128,7 +127,7 @@ int main(int argc, char ** argv)
next_iteration_time += period;
if (use_sim_time)
{
rate.sleep();
cm->get_clock()->sleep_until(current_time + period);
}
else
{
Expand Down
Loading