mirror of https://github.com/fan-ziqi/rl_sar.git
fix: mutex will cause thread timeout
This commit is contained in:
parent
f63cfc54e2
commit
b8b3b7fafe
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue