22 #ifndef __PLUGINS_DYNAMIXEL_DRIVER_THREAD_H_ 23 #define __PLUGINS_DYNAMIXEL_DRIVER_THREAD_H_ 25 #include <core/threading/thread.h> 26 #include <aspect/blocked_timing.h> 27 #include <aspect/logging.h> 28 #include <aspect/configurable.h> 29 #include <aspect/blackboard.h> 31 #include <core/threading/scoped_rwlock.h> 32 #include <core/threading/read_write_lock.h> 34 #include <blackboard/interface_listener.h> 35 #include <utils/time/time.h> 37 #ifdef USE_TIMETRACKER 38 # include <utils/time/tracker.h> 44 class DynamixelServoInterface;
64 virtual void finalize();
93 bool mode_set_pending;
95 unsigned int new_mode;
100 unsigned int torque_limit;
104 std::map<unsigned int, Servo> servos_;
109 std::string cfg_prefix_;
110 std::string cfg_name_;
111 std::string cfg_device_;
112 unsigned int cfg_read_timeout_ms_;
113 unsigned int cfg_disc_timeout_ms_;
114 bool cfg_goto_zero_start_;
116 unsigned int cfg_cw_compl_margin_;
117 unsigned int cfg_ccw_compl_margin_;
118 unsigned int cfg_cw_compl_slope_;
119 unsigned int cfg_ccw_compl_slope_;
120 float cfg_def_angle_margin_;
121 bool cfg_enable_echo_fix_;
122 bool cfg_enable_connection_stability_;
123 bool cfg_autorecover_enabled_;
124 unsigned char cfg_autorecover_flags_;
125 float cfg_torque_limit_;
126 unsigned char cfg_temperature_limit_;
127 bool cfg_prevent_alarm_shutdown_;
128 float cfg_prevent_alarm_shutdown_threshold_;
129 float cfg_min_voltage_;
130 float cfg_max_voltage_;
131 std::vector<unsigned int> cfg_servos_to_discover_;
133 void goto_angle(
unsigned int servo_id,
float angle);
134 void goto_angle_timed(
unsigned int servo_id,
float angle,
float time_sec);
135 float get_angle(
unsigned int servo_id);
136 float get_angle(
unsigned int servo_id,
fawkes::Time &time);
137 void set_velocity(
unsigned int servo_id,
float vel);
138 float get_velocity(
unsigned int servo_id);
139 void set_speed(
unsigned int servo_id,
unsigned int speed);
140 void set_mode(
unsigned int servo_id,
unsigned int new_mode);
141 void set_margin(
unsigned int servo_id,
float margin);
142 bool is_final(
unsigned int servo_id);
143 bool is_enabled(
unsigned int servo_id);
144 void set_enabled(
unsigned int servo_id,
bool enabled);
145 void set_led_enabled(
unsigned int servo_id,
bool enabled);
146 void stop_motion(
unsigned int servo_id);
147 bool has_fresh_data();
148 void wait_for_fresh_data();
150 void exec_goto_angle(
unsigned int servo_id,
float angle);
151 void exec_set_mode(
unsigned int servo_id,
unsigned int new_mode);
Class to access a chain of Robotis dynamixel servos.
Thread aspect to access to BlackBoard.
Wait until a given condition holds.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Driver thread for Robotis dynamixel servos.
Fawkes library namespace.
virtual void run()
Code to execute in the thread.
A class for handling time.
Thread class encapsulation of pthreads.
Base class for all Fawkes BlackBoard interfaces.
Read/write lock to allow multiple readers but only a single writer on the resource at a time...
Thread aspect to log output.
Thread aspect to access configuration data.
virtual void run()
Stub to see name in backtrace for easier debugging.
LedInterface Fawkes BlackBoard Interface.
DynamixelServoInterface Fawkes BlackBoard Interface.
JointInterface Fawkes BlackBoard Interface.
Mutex mutual exclusion lock.
BlackBoard interface listener.