24 #include "goto_thread.h"
26 #include "controller.h"
27 #include "exception.h"
29 #include <interfaces/KatanaInterface.h>
48 unsigned int poll_interval_ms)
51 poll_interval_usec_ = poll_interval_ms * 1000;
81 "Initiating goto failed (no solution, ignoring): %s",
97 usleep(poll_interval_usec_);
102 if (++num_errors <= 10) {
103 _logger->
log_warn(
"KatanaMotorControlThread",
"Reading sensor/motor data failed, retrying");
107 "Receiving sensor/motor data failed too often, aborting");
123 name(),
"Position (%f,%f,%f, %f,%f,%f) reached", x_, y_, z_, phi_, theta_, psi_);
KatanaGotoThread(fawkes::RefPtr< fawkes::KatanaController > katana, fawkes::Logger *logger, unsigned int poll_interval_ms)
Constructor.
virtual void set_target(float x, float y, float z, float phi, float theta, float psi)
Set target position.
virtual void once()
Execute an action exactly once.
Katana motion thread base class.
fawkes::Logger * _logger
Logger.
fawkes::RefPtr< fawkes::KatanaController > _katana
Katana object for interaction with the arm.
bool _finished
Set to true when motion is finished, to false on reset.
unsigned int _error_code
Set to the desired error code on error.
Base class for exceptions in Fawkes.
virtual const char * what() const
Get primary string.
virtual void read_motor_data()=0
Read motor data of currently active joints from device into controller libray.
virtual void read_sensor_data()=0
Read all sensor data from device into controller libray.
virtual bool final()=0
Check if movement is final.
virtual void move_to(float x, float y, float z, float phi, float theta, float psi, bool blocking=false)=0
Move endeffctor to given coordinates.
static const uint32_t ERROR_NO_SOLUTION
ERROR_NO_SOLUTION constant.
static const uint32_t ERROR_COMMUNICATION
ERROR_COMMUNICATION constant.
static const uint32_t ERROR_MOTOR_CRASHED
ERROR_MOTOR_CRASHED constant.
static const uint32_t ERROR_CMD_START_FAILED
ERROR_CMD_START_FAILED constant.
At least one motor crashed.
No joint configuration for desired target found.
virtual void log_debug(const char *component, const char *format,...)=0
Log debug message.
virtual void log_warn(const char *component, const char *format,...)=0
Log warning message.
const char * name() const
Get name of thread.