CSIM: ArmModel Class Reference
ArmModel Class Reference#include <armmodel.h>
Inheritance diagram for ArmModel:
List of all members.
Detailed Description
Test class of physical model, for an arm. WITHOUT DELAY!!
Public Member Functions
Public Attributes
- double mintheta1
- Baseline parameter for theta1.
-
double mintheta2
- Baseline parameter for theta2.
-
double minU1
- Baseline parameter for U1.
-
double minU2
- Baseline parameter for U2.
-
double model_DT
- The time-step of simulation.
-
double Xo
- The X coordinate of origin.
-
double Yo
- The Y coordinate of origin.
-
double m1
- The mass of 1st link.
-
double m2
- The mass of second link.
-
double lc1
- The distance of central point of link 1.
-
double lc2
- The distance of central point of link 2.
-
double l1
- Length of first link.
-
double l2
- Length of second link.
-
double I1
- The moment of inertia of link1.
-
double I2
- The moment of inertia of link2.
-
double MFACT
- The factor by which the external noise will be proportional to the input magnitude.
-
double PERT_TIME
- The time at which the perturbation will start.
-
double DURATION
- The duration of perturbation.
-
int inputFileNr
- The file-number for input of Xdest, Ydest, Theta1, Theta2 (file-name is "T(x).mat", where (x) is this number.
Protected Attributes
-
double t1
- Angle theta 1.
-
double t2
- Angle theta 2.
-
double w1
- Angular velocity 1 (updated every time step).
-
double w2
- Angular velocity 2 (updated every time step).
-
double u1
- Torque 1 (updated every time step).
-
double u2
- Torque 2 (updated every time step).
Private Member Functions
- int loadData (bool onlyReset)
-
void dist_OP (double IP, int output_start_index, int next_buffer_position, int time_index, char *VarName)
- Distributes the scalar OP value according to the places it went.
Private Attributes
-
int oldInputFileNr
- Old file-number (needed for updates).
-
int TIMESTEPS
- Number of timesteps in simulation.
-
int cur_timestep
- Current time step (in outside, not simulation time. One time step corresponds to one time-step within input files).
-
int nr_file_steps
- Number of simulation time-steps between file-time-steps.
-
int sim_step_counter
- Counts simulation steps between file-steps.
-
double * Xdest
- X-coordinate.
-
double * Ydest
- Y-coordinate.
-
double * theta1
- Angle Theta1.
-
double * theta2
- Angle Theta2.
-
double * nu1
- N U1.
-
double * nu2
- N U2.
-
double * c_theta1
- Center for distribution of Theta1.
-
double * c_theta2
- Center for distribution of Theta2.
-
double * c_u1
- Center for distribution of U1.
-
double * c_u2
- Center for distribution of U2.
-
double ** out_buffer
- Buffer for outputs (if you want to use delay).
-
int buffer_length
- Length of the buffer.
-
int buffer_position
- Position inside the buffer.
Friends
Constructor & Destructor Documentation
|
Constructs a new arm model. |
ArmModel::~ArmModel |
( |
void |
|
) |
[virtual] |
|
Member Function Documentation
int ArmModel::loadData |
( |
bool |
onlyReset |
) |
[private] |
|
|
Loads the data from a .mat file. Returns 0 for success, -1 otherwise. |
void ArmModel::reset |
( |
|
) |
[virtual] |
|
|
Resets the information stored within the model.
Reimplemented from PhysicalModel. |
int ArmModel::transform |
( |
double ** |
I, |
|
|
double * |
O |
|
) |
[virtual] |
|
|
Transforms the current inputs to new output values. - Parameters:
-
| I | Array of pointers to input values from the readouts. |
| O | Array of output values. |
- Returns:
- -1 if an error occured, 1 for success.
Implements PhysicalModel. |
int ArmModel::updateInternal |
( |
|
) |
[virtual] |
|
|
This function is called after parameters are updated.
Reimplemented from PhysicalModel. |
Member Data Documentation
|
Baseline parameter for theta1.
These parameters can be set with a csim('set',...) command. |
|