fix: mutex will cause thread timeout

This commit is contained in:
fan-ziqi 2024-12-19 16:42:01 +08:00
parent f63cfc54e2
commit b8b3b7fafe
3 changed files with 6 additions and 6 deletions

View File

@ -139,7 +139,7 @@ void RL_Real::SetCommand(const RobotCommand<double> *command)
void RL_Real::RobotControl()
{
std::lock_guard<std::mutex> lock(robot_state_mutex);
// std::lock_guard<std::mutex> lock(robot_state_mutex); // TODO will cause thread timeout
this->motiontime++;
@ -150,7 +150,7 @@ void RL_Real::RobotControl()
void RL_Real::RunModel()
{
std::lock_guard<std::mutex> lock(robot_state_mutex);
// std::lock_guard<std::mutex> lock(robot_state_mutex); // TODO will cause thread timeout
if (this->running_state == STATE_RL_RUNNING)
{

View File

@ -144,7 +144,7 @@ void RL_Real::SetCommand(const RobotCommand<double> *command)
void RL_Real::RobotControl()
{
std::lock_guard<std::mutex> lock(robot_state_mutex);
// std::lock_guard<std::mutex> lock(robot_state_mutex); // TODO will cause thread timeout
this->motiontime++;
@ -155,7 +155,7 @@ void RL_Real::RobotControl()
void RL_Real::RunModel()
{
std::lock_guard<std::mutex> lock(robot_state_mutex);
// std::lock_guard<std::mutex> lock(robot_state_mutex); // TODO will cause thread timeout
if (this->running_state == STATE_RL_RUNNING)
{

View File

@ -180,7 +180,7 @@ void RL_Sim::SetCommand(const RobotCommand<double> *command)
void RL_Sim::RobotControl()
{
std::lock_guard<std::mutex> lock(robot_state_mutex);
// std::lock_guard<std::mutex> lock(robot_state_mutex); // TODO will cause thread timeout
// if (this->control.control_state == STATE_RESET_SIMULATION)
// {
@ -267,7 +267,7 @@ void RL_Sim::RobotStateCallback(const robot_msgs::msg::RobotState::SharedPtr msg
void RL_Sim::RunModel()
{
std::lock_guard<std::mutex> lock(robot_state_mutex);
// std::lock_guard<std::mutex> lock(robot_state_mutex); // TODO will cause thread timeout
if (this->running_state == STATE_RL_RUNNING && simulation_running)
{