robot_layer.h
Go to the documentation of this file.
1 
2 #ifndef CANOPEN_MOTOR_NODE_ROBOT_LAYER_H_
3 #define CANOPEN_MOTOR_NODE_ROBOT_LAYER_H_
4 
5 #include <boost/unordered_map.hpp>
10 #include <urdf/urdfdom_compatibility.h>
11 #include <urdf/model.h>
12 #include <canopen_402/base.h>
14 
15 
16 namespace canopen {
17 
18 class RobotLayer : public LayerGroupNoDiag<HandleLayerBase>, public hardware_interface::RobotHW{
23 
30 
33 
34  typedef boost::unordered_map< std::string, HandleLayerBaseSharedPtr > HandleMap;
35  HandleMap handles_;
36  struct SwitchData {
40  };
41  typedef std::vector<SwitchData> SwitchContainer;
42  typedef boost::unordered_map<std::string, SwitchContainer> SwitchMap;
43  SwitchMap switch_map_;
44 
45  boost::atomic<bool> first_init_;
46 
47  void stopControllers(const std::vector<std::string> controllers);
48 public:
49  void add(const std::string &name, HandleLayerBaseSharedPtr handle);
51  urdf::JointConstSharedPtr getJoint(const std::string &n) const { return urdf_.getJoint(n); }
52 
53  virtual void handleInit(canopen::LayerStatus &status);
54  void enforce(const ros::Duration &period, bool reset);
55  virtual bool prepareSwitch(const std::list<hardware_interface::ControllerInfo> &start_list, const std::list<hardware_interface::ControllerInfo> &stop_list);
56  virtual void doSwitch(const std::list<hardware_interface::ControllerInfo> &start_list, const std::list<hardware_interface::ControllerInfo> &stop_list);
57 };
58 
60 
61 } // namespace canopen
62 
63 #endif
hardware_interface::PositionJointInterface pos_interface_
Definition: robot_layer.h:20
urdf::JointConstSharedPtr getJoint(const std::string &n) const
Definition: robot_layer.h:51
void add(const std::string &name, HandleLayerBaseSharedPtr handle)
Definition: robot_layer.cpp:26
HandleLayerBaseSharedPtr handle
Definition: robot_layer.h:37
boost::unordered_map< std::string, SwitchContainer > SwitchMap
Definition: robot_layer.h:42
void enforce(const ros::Duration &period, bool reset)
Definition: robot_layer.cpp:77
joint_limits_interface::EffortJointSaturationInterface eff_saturation_interface_
Definition: robot_layer.h:29
SwitchMap switch_map_
Definition: robot_layer.h:43
virtual void handleInit(canopen::LayerStatus &status)
Definition: robot_layer.cpp:41
hardware_interface::JointStateInterface state_interface_
Definition: robot_layer.h:19
boost::shared_ptr< RobotLayer > RobotLayerSharedPtr
Definition: robot_layer.h:59
boost::unordered_map< std::string, HandleLayerBaseSharedPtr > HandleMap
Definition: robot_layer.h:34
canopen::MotorBase::OperationMode mode
Definition: robot_layer.h:38
joint_limits_interface::PositionJointSoftLimitsInterface pos_soft_limits_interface_
Definition: robot_layer.h:24
const std::string name
urdf::Model urdf_
Definition: robot_layer.h:32
joint_limits_interface::EffortJointSoftLimitsInterface eff_soft_limits_interface_
Definition: robot_layer.h:28
boost::atomic< bool > first_init_
Definition: robot_layer.h:45
hardware_interface::VelocityJointInterface vel_interface_
Definition: robot_layer.h:21
hardware_interface::EffortJointInterface eff_interface_
Definition: robot_layer.h:22
joint_limits_interface::VelocityJointSoftLimitsInterface vel_soft_limits_interface_
Definition: robot_layer.h:26
virtual void doSwitch(const std::list< hardware_interface::ControllerInfo > &start_list, const std::list< hardware_interface::ControllerInfo > &stop_list)
std::vector< SwitchData > SwitchContainer
Definition: robot_layer.h:41
joint_limits_interface::PositionJointSaturationInterface pos_saturation_interface_
Definition: robot_layer.h:25
HandleMap handles_
Definition: robot_layer.h:35
ros::NodeHandle nh_
Definition: robot_layer.h:31
virtual bool prepareSwitch(const std::list< hardware_interface::ControllerInfo > &start_list, const std::list< hardware_interface::ControllerInfo > &stop_list)
RobotLayer(ros::NodeHandle nh)
Definition: robot_layer.cpp:31
void stopControllers(const std::vector< std::string > controllers)
Definition: robot_layer.cpp:18
joint_limits_interface::VelocityJointSaturationInterface vel_saturation_interface_
Definition: robot_layer.h:27


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