This commit is contained in:
acki
2025-05-29 08:15:57 -04:00
parent 2281750427
commit 47d0dab24f
2 changed files with 12 additions and 0 deletions

View File

@@ -84,6 +84,8 @@ namespace Modelec
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr start_odo_sub_;
bool start_odo_ = false;
rclcpp::TimerBase::SharedPtr odo_get_pos_timer_;
// Promises and mutexes to synchronize service responses asynchronously
std::queue<std::promise<long>> tof_promises_;
std::mutex tof_mutex_;

View File

@@ -181,6 +181,16 @@ namespace Modelec
SendOrder("START", {std::to_string(msg->data)});
}
});
odo_get_pos_timer_ = this->create_wall_timer(
std::chrono::milliseconds(100),
[this]()
{
if (isOk && start_odo_)
{
GetPos();
}
});
}
PCBOdoInterface::~PCBOdoInterface()