AUTh-ARL Core Stack  0.7
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
arl::controller::Clik Class Reference

Implements a Closed Inversed Kinematics Controller for sending Task Velocities. More...

#include <clik.h>

Inheritance diagram for arl::controller::Clik:
Collaboration diagram for arl::controller::Clik:

Public Member Functions

 Clik (const std::shared_ptr< arl::robot::Robot > &robot)
 
void measure ()
 Measures the desired data. More...
 
void update ()
 Performs the necessary calculations of the controller. More...
 
void command ()
 Commands the robot. More...
 
bool stop ()
 Implements the stopping condition of your controller. More...
 
void init ()
 Initializes the controller. More...
 
void reference (const arma::vec &ref)
 
void enableLogging (const std::string &path="/home/user/autharl_logfiles")
 Enables the logging by opening files for log benchmarking times and data. More...
 
- Public Member Functions inherited from arl::robot::Controller
 Controller (std::shared_ptr< Robot > r, const std::string &name, Timing timing=FIXED)
 Constructor which initializes the robot controller. More...
 
 ~Controller ()
 
bool run ()
 The main function that runs the controller. More...
 
bool runRT ()
 Runs the controller with real time priority. More...
 
void setExternalStop (bool arg)
 Sets an external stop to the controller. Another external thread can use this function to stop the controller. More...
 
std::string getName ()
 Returns the name of the controller. More...
 
double getTime () const
 Returns the current time since the start of the controller in seconds. More...
 
virtual void reference (const arma::mat &ref)
 

Additional Inherited Members

- Public Types inherited from arl::robot::Controller
enum  Timing { FIXED, DYNAMIC }
 
- Protected Member Functions inherited from arl::robot::Controller
virtual bool success ()
 Implements the success condition of your controller. More...
 
virtual void waitNextCycle ()
 Sets a new reference for the controller. More...
 
- Protected Attributes inherited from arl::robot::Controller
std::string name
 The name of the controller. More...
 
bool external_stop
 The external stopped setted by Controller::setExternalStop() More...
 
std::shared_ptr< Robotrobot
 The pointer to the robot to be controlled. More...
 
double t
 The current time t, with t = 0 when the controller is created. Alternatively the user can initialize time durint the init() function of its derived controller. More...
 
double dt
 The cycle time of the control loop, obtained by the robot. More...
 
bool stop_flag_
 
utils::Timer timer
 Used for measuring the current time of the controller. More...
 
utils::Timer benchmark_total_timer_
 
utils::Timer benchmark_timer_
 
io::Logger benchmark_logger_
 
io::Logger logger_
 
Timing timing_
 

Detailed Description

Implements a Closed Inversed Kinematics Controller for sending Task Velocities.

Constructor & Destructor Documentation

arl::controller::Clik::Clik ( const std::shared_ptr< arl::robot::Robot > &  robot)
explicit

Member Function Documentation

void arl::controller::Clik::command ( )
virtual

Commands the robot.

Implemented according to your controller needs. Basically makes calls to functions of the Robot class, like sending new desired joint torques or joint positions. These desired signals can be stored in internal variables and should have been calculated based on the measurements of the Controller::measure() and the calculations of the Controller::update()

Reimplemented from arl::robot::Controller.

void arl::controller::Clik::enableLogging ( const std::string &  log_path = "/home/user/autharl_logfiles")
virtual

Enables the logging by opening files for log benchmarking times and data.

Parameters
log_pathThe path for the files to store.
Exceptions
Exceptionif the files cannot be opened (the directory is not exists)

Reimplemented from arl::robot::Controller.

void arl::controller::Clik::init ( )
virtual

Initializes the controller.

Implemented according to your controller needs. Common use cases involve sending a the robot in an initial configuration, setting the robot mode (to position or torque control) or setting the paramters and gains of your controller.

Reimplemented from arl::robot::Controller.

void arl::controller::Clik::measure ( )
virtual

Measures the desired data.

Implemented according to your controller needs. Basically makes calls to functions of the Robot class and store them to internal variables, like the joint positions of the robot, the task pose of a robotic arm etc.

Reimplemented from arl::robot::Controller.

void arl::controller::Clik::reference ( const arma::vec &  ref)
bool arl::controller::Clik::stop ( )
virtual

Implements the stopping condition of your controller.

Implemented according to your controller needs. Common use cases involve stopping conditions like your robot has zero velocity, the robot hardware signals an error or dangerous movements indicates the immediate stop.

Returns
True if the controller should stop. False otherwise.

Reimplemented from arl::robot::Controller.

void arl::controller::Clik::update ( )
virtual

Performs the necessary calculations of the controller.

Implemented according to your controller needs. The calculations can use the measurements from the Controller::measure() which is stored in internal variables and store the results for the Controller::command() to use.

Implements arl::robot::Controller.