controller_manager_layer.cpp
Go to the documentation of this file.
1 
4 
5 using namespace canopen;
6 
8  if(current_state > Shutdown){
9  if(!cm_) status.error("controller_manager is not intialized");
10  }
11 }
12 
14  if(current_state > Shutdown){
15  if(!cm_){
16  status.error("controller_manager is not intialized");
17  }else{
19  ros::Time now = ros::Time::now();
20 
22 
23  if(period.isZero()) {
24  period.fromSec(boost::chrono::duration<double>(abs_now -last_time_).count());
25  }
26 
27  last_time_ = abs_now;
28 
29  bool recover = recover_.exchange(false);
30  cm_->update(now, period, recover);
31  robot_->enforce(period, recover);
32  }
33  }
34 }
35 
37  if(cm_){
38  status.warn("controller_manager is already intialized");
39  }else{
40  recover_ = true;
43  }
44 }
45 
47  if(!cm_) status.error("controller_manager is not intialized");
48  else recover_ = true;
49 }
50 
52  cm_.reset();
53 }
54 
virtual void handleRead(canopen::LayerStatus &status, const LayerState &current_state)
const void warn(const std::string &r)
void recover(LayerStatus &status)
virtual void handleInit(canopen::LayerStatus &status)
boost::chrono::high_resolution_clock::time_point time_point
virtual void handleWrite(canopen::LayerStatus &status, const LayerState &current_state)
Duration & fromSec(double t)
boost::shared_ptr< controller_manager::ControllerManager > cm_
canopen::RobotLayerSharedPtr robot_
virtual void handleRecover(canopen::LayerStatus &status)
virtual void handleShutdown(canopen::LayerStatus &status)
const void error(const std::string &r)
static Time now()
time_point get_abs_time(const time_duration &timeout)


canopen_motor_node
Author(s): Mathias Lüdtke
autogenerated on Sat May 4 2019 02:40:47