24 #include "goto_thread.h" 25 #include "controller.h" 26 #include "exception.h" 28 #include <interfaces/KatanaInterface.h> 47 unsigned int poll_interval_ms)
50 __poll_interval_usec = poll_interval_ms * 1000;
64 float phi,
float theta,
float psi)
81 _logger->
log_warn(
"KatanaGotoThread",
"Initiating goto failed (no solution, ignoring): %s", e.
what());
96 usleep(__poll_interval_usec);
101 if (++num_errors <= 10) {
102 _logger->
log_warn(
"KatanaMotorControlThread",
"Reading sensor/motor data failed, retrying");
105 _logger->
log_warn(
"KatanaMotorControlThread",
"Receiving sensor/motor data failed too often, aborting");
121 __x, __y, __z, __phi, __theta, __psi);
static const uint32_t ERROR_NO_SOLUTION
ERROR_NO_SOLUTION constant.
virtual void read_motor_data()=0
Read motor data of currently active joints from device into controller libray.
fawkes::RefPtr< fawkes::KatanaController > _katana
Katana object for interaction with the arm.
fawkes::Logger * _logger
Logger.
Katana motion thread base class.
virtual const char * what() const
Get primary string.
No joint configuration for desired target found.
virtual void set_target(float x, float y, float z, float phi, float theta, float psi)
Set target position.
virtual void read_sensor_data()=0
Read all sensor data from device into controller libray.
static const uint32_t ERROR_COMMUNICATION
ERROR_COMMUNICATION constant.
virtual void once()
Execute an action exactly once.
Base class for exceptions in Fawkes.
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.
const char * name() const
Get name of thread.
static const uint32_t ERROR_MOTOR_CRASHED
ERROR_MOTOR_CRASHED constant.
virtual void log_warn(const char *component, const char *format,...)=0
Log warning message.
At least one motor crashed.
bool _finished
Set to true when motion is finished, to false on reset.
virtual void log_debug(const char *component, const char *format,...)=0
Log debug message.
unsigned int _error_code
Set to the desired error code on error.
KatanaGotoThread(fawkes::RefPtr< fawkes::KatanaController > katana, fawkes::Logger *logger, unsigned int poll_interval_ms)
Constructor.
virtual bool final()=0
Check if movement is final.
static const uint32_t ERROR_CMD_START_FAILED
ERROR_CMD_START_FAILED constant.