update to windows
This commit is contained in:
@@ -23,7 +23,7 @@ class RobotControlTest
|
||||
}
|
||||
|
||||
public:
|
||||
RobotControlTest() = default;
|
||||
RobotControlTest();
|
||||
~RobotControlTest();
|
||||
|
||||
void run();
|
||||
@@ -32,6 +32,9 @@ private:
|
||||
void executeMission(const Mission& mission);
|
||||
};
|
||||
|
||||
RobotControlTest::RobotControlTest()
|
||||
{}
|
||||
|
||||
RobotControlTest::~RobotControlTest()
|
||||
{
|
||||
event_processor_.stop();
|
||||
@@ -49,27 +52,22 @@ void RobotControlTest::run()
|
||||
executeMission(*mission);
|
||||
});
|
||||
|
||||
event_processor_.start();
|
||||
mission_executor_.start();
|
||||
|
||||
|
||||
while (true)
|
||||
{
|
||||
auto feedback = move_base_ptr_->getFeedback();
|
||||
auto nav_state = feedback->navigation_state;
|
||||
|
||||
// FIX #8: navDoneEvent fires only when navigation AND actions are both done.
|
||||
if (nav_state != prev_nav_state_)
|
||||
if (nav_state != prev_nav_done_state_ && nav_state == robot::move_base_core::State::SUCCEEDED && areActionsDone())
|
||||
{
|
||||
if (nav_state == robot::move_base_core::State::SUCCEEDED && areActionsDone())
|
||||
{
|
||||
event_processor_.navDoneEvent();
|
||||
}
|
||||
else if (nav_state == robot::move_base_core::State::ABORTED)
|
||||
{
|
||||
event_processor_.navFailedEvent();
|
||||
}
|
||||
prev_nav_state_ = nav_state;
|
||||
event_processor_.navDoneEvent();
|
||||
}
|
||||
else if (nav_state == robot::move_base_core::State::ABORTED)
|
||||
{
|
||||
event_processor_.navFailedEvent();
|
||||
}
|
||||
prev_nav_state_ = nav_state;
|
||||
|
||||
// Example: receive an order (replace condition with your real source)
|
||||
if (/* new order available */ false)
|
||||
|
||||
Reference in New Issue
Block a user