fix: mutex will cause thread timeout

This commit is contained in:
fan-ziqi 2024-12-19 16:42:01 +08:00
parent 5b05b05529
commit 44f8f5324f
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() 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++; this->motiontime++;
@ -150,7 +150,7 @@ void RL_Real::RobotControl()
void RL_Real::RunModel() 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) 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() 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++; this->motiontime++;
@ -155,7 +155,7 @@ void RL_Real::RobotControl()
void RL_Real::RunModel() 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) if (this->running_state == STATE_RL_RUNNING)
{ {

View File

@ -153,7 +153,7 @@ void RL_Sim::SetCommand(const RobotCommand<double> *command)
void RL_Sim::RobotControl() 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) if (this->control.control_state == STATE_RESET_SIMULATION)
{ {
@ -218,7 +218,7 @@ void RL_Sim::JointStatesCallback(const sensor_msgs::JointState::ConstPtr &msg)
void RL_Sim::RunModel() 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) if (this->running_state == STATE_RL_RUNNING && simulation_running)
{ {