ahroscontrol

ahroscontrol


-----------------------------------
HardwareResourceManager base types:

class hardware_interface::HardwareResourceManager<ResourceHandle, ClaimPolicy>
        : public HardwareInterface
        , public ResourceManager<ResourceHandle>

class hardware_interface::HardwareInterface
    maintains a set of claimed ResourceHandle names

class hardware_interface::ResourceManager<ResourceHandle>
    maintains a map of name->ResourceHandle

-----------------------------------
examples of HardwareResourceManager subclasses

class hardware_interface::JointStateInterface
        : public HardwareResourceManager<JointStateHandle>
    JointStateHandle is ptr to pos, vel, effort.
    does not claim resources.

class hardware_interface::JointCommandInterface
        : public HardwareResourceManager<JointHandle, ClaimResources>
    base class for next 3 types.
    claims resources.

class hardware_interface::EffortJointInterface 
        : public JointCommandInterface
    JointHandle points to an effort command (and to current p,v,e).

class hardware_interface::VelocityJointInterface 
        : public JointCommandInterface
    JointHandle points to a velocity command (and to current p,v,e).

class hardware_interface::PositionJointInterface 
        : public JointCommandInterface
    JointHandle points to a position command (and to current p,v,e).

--------------------------------
class RobotHW :
        public InterfaceManager
    checkForConflict() - checks for conflicts between 2 ControllerInfo

class InterfaceManager
    maintains a map of typename->interface*
    An interface is any type, but usually subclass of HardwareResourceManager.  Examples:
        hardware_interface::JointStateInterface
        hardware_interface::PositionJointInterface
        hardware_interface::EffortJointInterface
        hardware_interface::VelocityJointInterface
        

--------------------------------
struct ControllerInfo
{
  std::string name, type, hardware_interface;
  std::set<std::string> resources;
};

-----------------------------------------
class Controller<hwinterface>  // hwinterface is (usually) subclass of HardwareResourceManager
        : public ControllerBase
    ???
    A controller has a 1:1 relationship with a hwinterface (HardwareResourceManager subclass).
    init() - initialize (called from non-realtime thread)
    initRequest() - calls init()


class ControllerBase
    starting() - called in rt-loop when controller starts
    update() - called in rt-loop every timestep when controller is started
    stopping() - called in rt-loop when controller stops
    getHardwareInterfaceType() - return HardwareResourceManager subclass typename
    state_ - CONSTRUCTED, INITIALIZED, or RUNNING

----------------------------------------------
Example controllers:

class JointStateController
        : public controller_interface::Controller<hardware_interface::JointStateInterface>
    publish joint_state topic for all joints in JointStateInterface


class joint_trajectory_controller::JointTrajectoryController<SegmentImpl, HardwareInterface>
        : public controller_interface::Controller<HardwareInterface>
    follow a trajectory.  SegmentImpl is a class that samples the trajectory.

class position_controllers::JointTrajectoryController
        : public joint_trajectory_controller::JointTrajectoryController<
                                            trajectory_interface::QuinticSplineSegment<double>,
                                            hardware_interface::PositionJointInterface>
    Follow trajectory with position control interface.

class effort_controllers::JointTrajectoryController
        : public joint_trajectory_controller::JointTrajectoryController<
                                            trajectory_interface::QuinticSplineSegment<double>,
                                            hardware_interface::PositionJointInterface>
    Follow trajectory with effort control interface.