SCL
1.0
Standard Control Library : Control, dynamics, physics, and simulation
|
#include <CTrajectoryGenerator.hpp>
Public Member Functions | |
virtual sBool | initTraj (const sFloat arg_cycle_time, const Eigen::Matrix< sFloat, task_dof_, 1 > &arg_max_pos, const Eigen::Matrix< sFloat, task_dof_, 1 > &arg_max_vel, const Eigen::Matrix< sFloat, task_dof_, 1 > &arg_max_acc, const Eigen::Matrix< sFloat, task_dof_, 1 > &arg_min_pos, const Eigen::Matrix< sFloat, task_dof_, 1 > &arg_min_vel, const Eigen::Matrix< sFloat, task_dof_, 1 > &arg_min_acc) |
virtual sBool | setTrajFromTxtFile (const std::string &arg_file, const sLongLong arg_traj_slices, const sBool arg_has_time=true) |
virtual sBool | setTrajFromFunc (sFloat(*arg_func)(sFloat), const sLongLong arg_traj_slices, const sFloat arg_time_per_slice, const Eigen::Matrix< sFloat, task_dof_, 1 > &arg_pos_start, const Eigen::Matrix< sFloat, task_dof_, 1 > &arg_scale, const Eigen::Matrix< sFloat, task_dof_, 1 > &arg_stagger) |
virtual sBool | getCurrGoal (Eigen::Matrix< sFloat, task_dof_, 1 > &arg_pos_curr, Eigen::Matrix< sFloat, task_dof_, 1 > &arg_vel_curr, Eigen::Matrix< sFloat, task_dof_, 1 > &arg_acc_curr) |
virtual sBool | saveCurrState (const Eigen::Matrix< sFloat, task_dof_, 1 > &arg_state, const sFloat arg_time) |
virtual sBool | getLoggedPositions (sutil::CMappedList< sFloat, Eigen::Matrix< sFloat, task_dof_, 1 > > &ret_traj) |
Protected Attributes | |
sutil::CMappedList< sFloat, Eigen::Matrix< sFloat, task_dof_, 1 > > | traj_desired_ |
sutil::CMappedList< sFloat, Eigen::Matrix< sFloat, task_dof_, 1 > > | traj_achieved_ |
Eigen::Matrix< sFloat, task_dof_, 1 > * | traj_curr_pos_ |
Eigen::Matrix< sFloat, task_dof_, 1 > | traj_curr_vel_ |
Eigen::Matrix< sFloat, task_dof_, 1 > | traj_curr_acc_ |
sFloat | traj_curr_time_ |
sLongLong | traj_curr_idx_ |
Eigen::Matrix< sFloat, task_dof_, 1 > | max_pos_ |
Eigen::Matrix< sFloat, task_dof_, 1 > | max_vel_ |
Eigen::Matrix< sFloat, task_dof_, 1 > | max_acc_ |
Eigen::Matrix< sFloat, task_dof_, 1 > | min_pos_ |
Eigen::Matrix< sFloat, task_dof_, 1 > | min_vel_ |
Eigen::Matrix< sFloat, task_dof_, 1 > | min_acc_ |
TypeIOTG | otg_ |
sBool | traj_has_been_init_ |
A base class for trajectory tracking tasks. Reads a trajectory from file or generates trajectories on the fly.
Use this to build trajectory controllers.
|
virtual |
Generates an arbitrary function based trajectory along all the dofs.
Verifies whether the trajectory is achievable. Returns false if there is no current goal (ie. traj is over).
|
virtual |
Returns the stored trajectory so far in a mapped list indexed by the time at which the config was logged. Returns false if nothing has been logged yet.
|
virtual |
Initializes the trajectory related parameters
arg_cycle_time | The cycle time of the control loop |
arg_max_pos | The current position along the task's directions |
arg_max_vel | The maximum velocity along the task's directions |
arg_max_acc | The maximum acceleration along the task's directions |
arg_min_pos | The minimum position along the task's directions |
arg_min_vel | The minimum velocity along the task's directions |
arg_min_acc | The minimum acceleration along the task's directions |
|
virtual |
Logs a step in the trajectory. Takes the passed configuration and stores it in the achieved trajectory, indexed by a timestamp.
arg_state | The present config measured by the sensors |
arg_time | The present time |
|
virtual |
Generates an arbitrary function based trajectory along all the dofs.
Verifies whether the trajectory is achievable. Returns false if the trajectory is impossible to achieve.
arg_traj_slices | The number of time slices of the required trajectory |
arg_time_per_slice | The time in which each trajectory slice should be achieved |
arg_pos_start | The starting position along the task's directions |
arg_scale | Scales each successive dof by this value. Ie. dof_i = sin(t)*arg_scale(i); |
arg_stagger | Staggers each successive dof by this value. Ie. dof_i = sin(t)+arg_stagger(i); |
|
virtual |
Reads a trajectory and checks the trajectory for errors:
Assumes : A trajectory in a text file. One time slice per line.
arg_file | The file to read in a trajectory from |
arg_traj_slices | The number of time slices (waypoints) along the trajectory |
arg_has_time | Is the first collumn of the trajectory time? |
|
protected |
The achieved trajectory, indexed by time
|
protected |
The current trajectory acceleration. Computed on the fly.
|
protected |
The current trajectory index
|
protected |
The current trajectory position. Index into mapped list.
|
protected |
The current trajectory time
|
protected |
The current trajectory velocity. Computed on the fly.
|
protected |
The desired trajectory, indexed by time or numerical index