Choreonoid  1.8
Public Types | Public Member Functions | Protected Member Functions | List of all members
cnoid::SimpleController Class Reference

#include <SimpleController.h>

Public Types

enum  StateType {
  StateNone = Link::StateNone, JointDisplacement = Link::JointDisplacement, JointAngle = Link::JointAngle, JointVelocity = Link::JointVelocity,
  JointAcceleration = Link::JointAcceleration, JointEffort = Link::JointEffort, JointForce = Link::JointForce, JointTorque = Link::JointTorque,
  LinkPosition = Link::LinkPosition, LinkTwist = Link::LinkTwist, LinkExtWrench = Link::LinkExtWrench, LinkContactState = Link::LinkContactState,
  JOINT_DISPLACEMENT = JointDisplacement, JOINT_ANGLE = JointAngle, JOINT_VELOCITY = JointVelocity, JOINT_SURFACE_VELOCITY = Link::DeprecatedJointSurfaceVelocity,
  JOINT_ACCELERATION = JointAcceleration, JOINT_EFFORT = JointEffort, JOINT_TORQUE = JointTorque, JOINT_FORCE = JointForce,
  LINK_POSITION = LinkPosition, LINK_FORCE = LinkExtWrench
}
 
typedef SimpleController *(* Factory) ()
 

Public Member Functions

virtual ~SimpleController ()
 
virtual bool configure (SimpleControllerConfig *config)
 
virtual bool initialize (SimpleControllerIO *io)
 
virtual bool start ()
 
virtual bool control ()
 
virtual void stop ()
 
virtual void unconfigure ()
 

Protected Member Functions

 SimpleController ()
 

Member Typedef Documentation

◆ Factory

typedef SimpleController*(* cnoid::SimpleController::Factory) ()

Member Enumeration Documentation

◆ StateType

Enumerator
StateNone 
JointDisplacement 
JointAngle 
JointVelocity 
JointAcceleration 
JointEffort 
JointForce 
JointTorque 
LinkPosition 
LinkTwist 
LinkExtWrench 
LinkContactState 
JOINT_DISPLACEMENT 
JOINT_ANGLE 
JOINT_VELOCITY 
JOINT_SURFACE_VELOCITY 
JOINT_ACCELERATION 
JOINT_EFFORT 
JOINT_TORQUE 
JOINT_FORCE 
LINK_POSITION 
LINK_FORCE 

Constructor & Destructor Documentation

◆ ~SimpleController()

SimpleController::~SimpleController ( )
virtual

◆ SimpleController()

SimpleController::SimpleController ( )
protected

Member Function Documentation

◆ configure()

bool SimpleController::configure ( SimpleControllerConfig config)
virtual

The configure function is called when the controller is associated with a target body item. The function is used to implement the configuration process that should be done before starting the simulation.

Returns
Return true if the configuration succeeds, or false if it fails.
Note
If the "reloading" property of the SimpleControllerItem is true, the configure function is executed just before calling the initialize function when the simulation is started because the controller is always reloaded when the simulation is started in the "reloading" mode.

◆ control()

bool SimpleController::control ( )
virtual

The control function is called at every frame of the control loop. The control process is implemented in this function.

Returns
Return true if the control is still active. If the false is returned, the simulation may be stopped depending on the simulation mode.

◆ initialize()

bool SimpleController::initialize ( SimpleControllerIO io)
virtual

The initialize function is called when the simulation is initialized to start.

Returns
Return true if the initialization succeeds, or false if it fails.

◆ start()

bool SimpleController::start ( )
virtual

The start function is called when the simulation is started. The function is called after basic initialization process is finished and the simulation is about to start.

Returns
Return true if the initialization succeeds, or false if it fails.

◆ stop()

void SimpleController::stop ( )
virtual

The stop function is called when the simulation is stopped. The finalization of the control process is implemented in this function.

◆ unconfigure()

void SimpleController::unconfigure ( )
virtual

The unconfigure function is called when the controller is unloaded. The process to finalize the controller itself is implemented in this function.


The documentation for this class was generated from the following files: