Dynamics simulation handling class. More...
#include <dynamics_sim.h>
Public Member Functions | |
Dynamics (Robot_basic *robot_) | |
Constructor. More... | |
virtual void | plot () |
Virtual plot functions. More... | |
void | reset_time () |
Set the simulation time to the inital time. More... | |
void | Runge_Kutta4 () |
Runge Kutta solver. More... | |
void | Runge_Kutta4_Real_time () |
Runge Kutta solver for real time. More... | |
short | set_controller (const Control_Select &x) |
Set the control variable from the Control_Select reference. More... | |
void | set_dof (Robot_basic *robot_) |
Set the degree of freedom. More... | |
void | set_final_time (const double tf) |
Set the file time. More... | |
ReturnMatrix | set_robot_on_first_point_of_splines () |
Set the robot on first point of trajectory. More... | |
void | set_time_frame (const int nsteps) |
Set the number of iterations. More... | |
short | set_trajectory (const Trajectory_Select &x) |
Set the path_select variable from the Trajectory_Select reference. More... | |
ReturnMatrix | xdot (const Matrix &xin) |
Obtain state derivative. More... | |
virtual | ~Dynamics () |
Static Public Member Functions | |
static Dynamics * | Instance () |
A pointer to Dynamics instance. Pointer is 0 if there is no instance (logic done in Constructor). More... | |
Public Attributes | |
Control_Select | control |
Instance of Control_Select class. More... | |
int | dof_fix |
Degree of freedom + virtual link. More... | |
double | dt |
Time frame. More... | |
bool | first_pass_Kutta |
First time in all Runge_Kutta4 functions. More... | |
double | h |
Runge Kutta temporary variable. More... | |
double | h2 |
Runge Kutta temporary variable. More... | |
Matrix | k1 |
Runge Kutta temporary variable. More... | |
Matrix | k2 |
Runge Kutta temporary variable. More... | |
Matrix | k3 |
Runge Kutta temporary variable. More... | |
Matrix | k4 |
Runge Kutta temporary variable. More... | |
int | ndof |
Degree of freedom. More... | |
int | nsteps |
Numbers of iterations between. More... | |
Trajectory_Select | path_select |
Instance of Trajectory_Select class. More... | |
ColumnVector | pd |
Desired end effector cartesian position. More... | |
ColumnVector | ppd |
Desired end effector cartesian velocity. More... | |
ColumnVector | pppd |
Desired end effector cartesian acceleration. More... | |
ColumnVector | q |
Joints positions. More... | |
ColumnVector | qd |
Desired joints positions. More... | |
ColumnVector | qp |
Joints velocities. More... | |
ColumnVector | qpd |
Desired joints velocities. More... | |
ColumnVector | qpp |
Joints accelerations. More... | |
ColumnVector | qppd |
Desired joints accelerations. More... | |
Quaternion | quatd |
Desired orientation express by a quaternion. More... | |
Robot_basic * | robot |
Pointer on Robot_basic class. More... | |
ColumnVector | tau |
Controller output torque. More... | |
double | tf |
Final time used in Runge_Kutta4_Real_time. More... | |
double | tf_cont |
Final time used in Runge_Kutta4. More... | |
double | time |
Time during simulation. More... | |
double | to |
Initial simulation time. More... | |
ColumnVector | wd |
Desired end effector cartesian angular velocity. More... | |
ColumnVector | wpd |
Desired end effector cartesian angular acceleration. More... | |
Matrix | x |
Stated vector obtain in Runge Kutta functions. More... | |
Matrix | xd |
Statd vector derivative obtaint in xdot function. More... | |
Static Public Attributes | |
static Dynamics * | instance = 0 |
Static pointer on Dynamics class. More... | |
Dynamics simulation handling class.
Definition at line 60 of file dynamics_sim.h.
Dynamics::Dynamics | ( | Robot_basic * | robot_ | ) |
Constructor.
Definition at line 57 of file dynamics_sim.cpp.
|
inlinevirtual |
Definition at line 65 of file dynamics_sim.h.
|
static |
A pointer to Dynamics instance. Pointer is 0 if there is no instance (logic done in Constructor).
Definition at line 100 of file dynamics_sim.cpp.
|
inlinevirtual |
Virtual plot functions.
Reimplemented in New_dynamics.
Definition at line 76 of file dynamics_sim.h.
void Dynamics::reset_time | ( | ) |
Set the simulation time to the inital time.
Definition at line 155 of file dynamics_sim.cpp.
void Dynamics::Runge_Kutta4 | ( | ) |
Runge Kutta solver.
Definition at line 356 of file dynamics_sim.cpp.
void Dynamics::Runge_Kutta4_Real_time | ( | ) |
Runge Kutta solver for real time.
Definition at line 334 of file dynamics_sim.cpp.
short Dynamics::set_controller | ( | const Control_Select & | x | ) |
Set the control variable from the Control_Select reference.
Definition at line 161 of file dynamics_sim.cpp.
void Dynamics::set_dof | ( | Robot_basic * | robot_ | ) |
Set the degree of freedom.
Obtain the degree of freedom from Robot_basic pointer. Some vectors will be resize with new current dof value.
Definition at line 109 of file dynamics_sim.cpp.
void Dynamics::set_final_time | ( | const double | tf | ) |
Set the file time.
Definition at line 149 of file dynamics_sim.cpp.
ReturnMatrix Dynamics::set_robot_on_first_point_of_splines | ( | ) |
Set the robot on first point of trajectory.
Assigned the robot joints position to the first point of the trajectory if the latter is expressed in joint space, or assigned the robot joints position via inverse kinematics if the trajectory is expressed in cartesian space. The function return a message on the console if the format of the trajectory file is incorrect.
Definition at line 190 of file dynamics_sim.cpp.
void Dynamics::set_time_frame | ( | const int | nsteps | ) |
Set the number of iterations.
Definition at line 143 of file dynamics_sim.cpp.
short Dynamics::set_trajectory | ( | const Trajectory_Select & | x | ) |
Set the path_select variable from the Trajectory_Select reference.
Definition at line 174 of file dynamics_sim.cpp.
ReturnMatrix Dynamics::xdot | ( | const Matrix & | x | ) |
Obtain state derivative.
x | state vector (joint speed and joint velocity). |
The controller torque is applied if any controller has been selected, then the joint acceleration is obtained.
Definition at line 252 of file dynamics_sim.cpp.
Control_Select Dynamics::control |
Instance of Control_Select class.
Definition at line 111 of file dynamics_sim.h.
int Dynamics::dof_fix |
Degree of freedom + virtual link.
Definition at line 82 of file dynamics_sim.h.
double Dynamics::dt |
Time frame.
Definition at line 85 of file dynamics_sim.h.
bool Dynamics::first_pass_Kutta |
First time in all Runge_Kutta4 functions.
Definition at line 81 of file dynamics_sim.h.
double Dynamics::h |
Runge Kutta temporary variable.
Definition at line 85 of file dynamics_sim.h.
double Dynamics::h2 |
Runge Kutta temporary variable.
Definition at line 85 of file dynamics_sim.h.
|
static |
Static pointer on Dynamics class.
Definition at line 115 of file dynamics_sim.h.
Matrix Dynamics::k1 |
Runge Kutta temporary variable.
Definition at line 92 of file dynamics_sim.h.
Matrix Dynamics::k2 |
Runge Kutta temporary variable.
Definition at line 92 of file dynamics_sim.h.
Matrix Dynamics::k3 |
Runge Kutta temporary variable.
Definition at line 92 of file dynamics_sim.h.
Matrix Dynamics::k4 |
Runge Kutta temporary variable.
Definition at line 92 of file dynamics_sim.h.
int Dynamics::ndof |
Degree of freedom.
Definition at line 82 of file dynamics_sim.h.
int Dynamics::nsteps |
Numbers of iterations between.
Definition at line 82 of file dynamics_sim.h.
Trajectory_Select Dynamics::path_select |
Instance of Trajectory_Select class.
Definition at line 112 of file dynamics_sim.h.
ColumnVector Dynamics::pd |
Desired end effector cartesian position.
Definition at line 98 of file dynamics_sim.h.
ColumnVector Dynamics::ppd |
Desired end effector cartesian velocity.
Definition at line 98 of file dynamics_sim.h.
ColumnVector Dynamics::pppd |
Desired end effector cartesian acceleration.
Definition at line 98 of file dynamics_sim.h.
ColumnVector Dynamics::q |
Joints positions.
Definition at line 98 of file dynamics_sim.h.
ColumnVector Dynamics::qd |
Desired joints positions.
Definition at line 98 of file dynamics_sim.h.
ColumnVector Dynamics::qp |
Joints velocities.
Definition at line 98 of file dynamics_sim.h.
ColumnVector Dynamics::qpd |
Desired joints velocities.
Definition at line 98 of file dynamics_sim.h.
ColumnVector Dynamics::qpp |
Joints accelerations.
Definition at line 98 of file dynamics_sim.h.
ColumnVector Dynamics::qppd |
Desired joints accelerations.
Definition at line 98 of file dynamics_sim.h.
Quaternion Dynamics::quatd |
Desired orientation express by a quaternion.
Definition at line 110 of file dynamics_sim.h.
Robot_basic* Dynamics::robot |
Pointer on Robot_basic class.
Definition at line 113 of file dynamics_sim.h.
ColumnVector Dynamics::tau |
Controller output torque.
Definition at line 98 of file dynamics_sim.h.
double Dynamics::tf |
Final time used in Runge_Kutta4_Real_time.
Definition at line 85 of file dynamics_sim.h.
double Dynamics::tf_cont |
Final time used in Runge_Kutta4.
Definition at line 85 of file dynamics_sim.h.
double Dynamics::time |
Time during simulation.
Definition at line 85 of file dynamics_sim.h.
double Dynamics::to |
Initial simulation time.
Definition at line 85 of file dynamics_sim.h.
ColumnVector Dynamics::wd |
Desired end effector cartesian angular velocity.
Definition at line 98 of file dynamics_sim.h.
ColumnVector Dynamics::wpd |
Desired end effector cartesian angular acceleration.
Definition at line 98 of file dynamics_sim.h.
Matrix Dynamics::x |
Stated vector obtain in Runge Kutta functions.
Definition at line 92 of file dynamics_sim.h.
Matrix Dynamics::xd |
Statd vector derivative obtaint in xdot function.
Definition at line 92 of file dynamics_sim.h.