14 typedef std::shared_ptr<blmc_drivers::SafeMotor>
SafeMotor_ptr;
35 for(
size_t i=0 ; i<motor_list.size() ; ++i)
37 encoders_.push_back(std::deque<double>());
38 currents_.push_back(std::deque<double>());
73 void set_gains(
double kp,
double kd)
94 static THREAD_FUNCTION_RETURN_TYPE
loop(
void* instance_pointer)
97 return THREAD_FUNCTION_RETURN_VALUE;
This is a basic PD controller to be used in the demos of this package.
Definition: sine_position_control.hpp:19
std::vector< std::deque< double > > control_buffer_
control_buffer_
Definition: sine_position_control.hpp:137
std::vector< std::deque< double > > encoders_
Encoder data.
Definition: sine_position_control.hpp:122
This namespace is the standard namespace of the package.
Definition: const_torque_control.cpp:12
double kp_
Controller proportional gain.
Definition: sine_position_control.hpp:142
real_time_tools::RealTimeThread rt_thread_
This is the real time thread object.
Definition: sine_position_control.hpp:88
double kd_
Controller derivative gain.
Definition: sine_position_control.hpp:147
void start_loop()
This method is a helper to start the thread loop.
Definition: sine_position_control.hpp:63
~SinePositionControl()
Destroy the SinePositionControl object.
Definition: sine_position_control.hpp:54
SinePositionControl(std::vector< SafeMotor_ptr > motor_list)
Construct a new SinePositionControl object.
Definition: sine_position_control.hpp:27
static THREAD_FUNCTION_RETURN_TYPE loop(void *instance_pointer)
this function is just a wrapper around the actual loop function, such that it can be spawned as a pos...
Definition: sine_position_control.hpp:94
unsigned memory_buffer_size_
memory_buffer_size_ is the max size of the memory buffer.
Definition: sine_position_control.hpp:117
std::vector< std::deque< double > > currents_
current data
Definition: sine_position_control.hpp:132
std::vector< std::deque< double > > velocities_
Velocity data.
Definition: sine_position_control.hpp:127
std::vector< SafeMotor_ptr > motor_list_
This is list of motors.
Definition: sine_position_control.hpp:84
void loop()
this is a simple control loop which runs at a kilohertz.
Definition: sine_position_control.cpp:13
void stop_loop()
Stop the control and dump the data.
Definition: sine_position_control.cpp:94
bool stop_loop_
managing the stopping of the loop
Definition: sine_position_control.hpp:112
std::shared_ptr< blmc_drivers::SafeMotor > SafeMotor_ptr
This is a simple shortcut.
Definition: const_torque_control.hpp:15