mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 10:00:48 +02:00
Clang-format run
This commit is contained in:
@@ -5,10 +5,9 @@ ServiceStopper::ServiceStopper(std::vector<Service*> services)
|
||||
, services_(services)
|
||||
, last_state_(RobotState::Error)
|
||||
{
|
||||
//enable_all();
|
||||
// enable_all();
|
||||
}
|
||||
|
||||
|
||||
bool ServiceStopper::enableCallback(std_srvs::EmptyRequest& req, std_srvs::EmptyResponse& resp)
|
||||
{
|
||||
notify_all(RobotState::Running);
|
||||
@@ -17,10 +16,10 @@ bool ServiceStopper::enableCallback(std_srvs::EmptyRequest& req, std_srvs::Empty
|
||||
|
||||
void ServiceStopper::notify_all(RobotState state)
|
||||
{
|
||||
if(last_state_ == state)
|
||||
if (last_state_ == state)
|
||||
return;
|
||||
|
||||
for(auto const service : services_)
|
||||
|
||||
for (auto const service : services_)
|
||||
{
|
||||
service->onRobotStateChange(state);
|
||||
}
|
||||
@@ -30,15 +29,15 @@ void ServiceStopper::notify_all(RobotState state)
|
||||
|
||||
bool ServiceStopper::handle(SharedRobotModeData& data, bool error)
|
||||
{
|
||||
if(data.emergency_stopped)
|
||||
if (data.emergency_stopped)
|
||||
{
|
||||
notify_all(RobotState::EmergencyStopped);
|
||||
}
|
||||
else if(data.protective_stopped)
|
||||
else if (data.protective_stopped)
|
||||
{
|
||||
notify_all(RobotState::ProtectiveStopped);
|
||||
}
|
||||
else if(error)
|
||||
else if (error)
|
||||
{
|
||||
notify_all(RobotState::Error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user