Skip to content

Commit 79c0a45

Browse files
committed
Fix waitForProgramNotRunning
1 parent a6ef648 commit 79c0a45

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/example_robot_wrapper.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,20 @@ void ExampleRobotWrapper::initializeRobotWithDashboard()
6868

6969
void ExampleRobotWrapper::handleRobotProgramState(bool program_running)
7070
{
71+
// Print the text in green so we see it better
7172
std::cout << "\033[1;32mProgram running: " << std::boolalpha << program_running << "\033[0m\n" << std::endl;
72-
program_running_ = program_running;
7373
if (program_running)
7474
{
7575
std::lock_guard<std::mutex> lk(program_running_mutex_);
76+
program_running_ = program_running;
7677
program_running_cv_.notify_one();
7778
}
79+
else
80+
{
81+
std::lock_guard<std::mutex> lk(program_not_running_mutex_);
82+
program_running_ = program_running;
83+
program_not_running_cv_.notify_one();
84+
}
7885
}
7986

8087
void ExampleRobotWrapper::startRTDECommununication(const bool consume_data)

0 commit comments

Comments
 (0)