Classes | |
struct | ArmParam |
struct | DrawObject |
struct | Object |
Public Types | |
enum | OBJECT_TYPE { BOX, CYLINDER, SPHERE } |
Public Member Functions | |
ArmSim (OptionManager &mgr, const std::string &descrName="ArmSim", const std::string &tagName="ArmSim", const double l0=0.8, const double l1=0.9, const double l2=1.00, const double l3=1.00, const double l4=1.00) | |
void | start2 () |
do some additional config at start time; see ModelComponent.H | |
void | setMotor (MOTOR m, int val) |
Set the Motor Speed and Direction by pwm. | |
void | setMotorPos (MOTOR m, int pos) |
Set the Motor Position by the encoder value. | |
int | getEncoder (MOTOR m) |
Get the encoder value from motor. | |
void | resetEncoders () |
Reset all motor encoder value to 0. | |
void | resetMotorPos () |
Reset all motor position to the home place. | |
void | stopAllMotors () |
Stop all the motor movement. | |
void | homeMotor () |
Do the homeing to the all motor. | |
void | setSafety (bool val) |
void | simLoop () |
Bring motor to a predefined position. | |
void | startSim (void) |
float | getPWM (MOTOR m) |
dWorldID | getWorld () |
dJointGroupID | getContactgroup () |
float | toDegree (float r) |
float | toRadius (float d) |
Image< PixRGB< byte > > | getFrame (int camera) |
void | getArmLoc (double loc[3]) |
Get the arm location from 2d to 3d. | |
void | getObjLoc (const int x, const int y, double loc[3]) |
Get the object location from 2d to 3d. | |
double | getGradient (MOTOR m, double *targetPos) |
Get the gradient movement from joint in angle value. | |
int | getGradientEncoder (MOTOR m, double *targetPos) |
Get the gradient movement from joint in encoder value. | |
void | addObject (OBJECT_TYPE objType, double initPos[3]) |
Add an object of type OBJECT_TYPE. | |
void | addObject (OBJECT_TYPE objType, double initPos[3], double objSize[3]) |
void | addDrawObject (OBJECT_TYPE objType, double pos[3]) |
void | drawObjects () |
Draw the objects we know of. | |
void | moveObject (double pos[3], int objID=0) |
Move the first add objects. | |
dReal * | getEndPos () |
int | ang2encoder (double ang, MOTOR m) |
Convert angle value to encoder value. | |
double | encoder2ang (int eng, MOTOR m) |
Convert encoder value to angle value. | |
void | getJointAxis (MOTOR m, dReal axis[3]) |
Get joint axis direction by motor. | |
void | getJointCenter (MOTOR m, dReal joint[3]) |
Get the value of the joint center position. | |
dJointID | getJointID (MOTOR m) |
get joint id by motor | |
void | drawLine (double pos[3]) |
Draw a line from arm end position to target. |
Definition at line 61 of file ArmSim.H.
void ArmSim::addObject | ( | OBJECT_TYPE | objType, | |
double | initPos[3] | |||
) |
int ArmSim::ang2encoder | ( | double | ang, | |
MOTOR | m | |||
) |
Convert angle value to encoder value.
Definition at line 288 of file ArmSim.C.
Referenced by getEncoder(), and getGradientEncoder().
void ArmSim::drawLine | ( | double | pos[3] | ) |
Draw a line from arm end position to target.
Definition at line 538 of file ArmSim.C.
Referenced by drawObjects().
void ArmSim::drawObjects | ( | ) |
double ArmSim::encoder2ang | ( | int | eng, | |
MOTOR | m | |||
) |
void ArmSim::getArmLoc | ( | double | loc[3] | ) |
int ArmSim::getEncoder | ( | MOTOR | m | ) | [virtual] |
Get the encoder value from motor.
Reimplemented from RobotArm.
Definition at line 226 of file ArmSim.C.
References ang2encoder().
double ArmSim::getGradient | ( | MOTOR | m, | |
double * | targetPos | |||
) |
Get the gradient movement from joint in angle value.
Definition at line 872 of file ArmSim.C.
References getJointID().
Referenced by getGradientEncoder().
int ArmSim::getGradientEncoder | ( | MOTOR | m, | |
double * | targetPos | |||
) |
Get the gradient movement from joint in encoder value.
Definition at line 868 of file ArmSim.C.
References ang2encoder(), and getGradient().
void ArmSim::getJointAxis | ( | MOTOR | m, | |
dReal | axis[3] | |||
) |
Get joint axis direction by motor.
Definition at line 893 of file ArmSim.C.
References getJointID().
void ArmSim::getJointCenter | ( | MOTOR | m, | |
dReal | joint[3] | |||
) |
Get the value of the joint center position.
Definition at line 897 of file ArmSim.C.
References getJointID().
dJointID ArmSim::getJointID | ( | MOTOR | m | ) |
get joint id by motor
Definition at line 901 of file ArmSim.C.
Referenced by getGradient(), getJointAxis(), and getJointCenter().
void ArmSim::getObjLoc | ( | const int | x, | |
const int | y, | |||
double | loc[3] | |||
) |
Get the object location from 2d to 3d.
Definition at line 793 of file ArmSim.C.
References ViewPort::unProjectPoint().
void ArmSim::homeMotor | ( | ) | [virtual] |
void ArmSim::moveObject | ( | double | pos[3], | |
int | objID = 0 | |||
) |
void ArmSim::resetEncoders | ( | ) | [virtual] |
void ArmSim::resetMotorPos | ( | void | ) | [inline, virtual] |
void ArmSim::setMotor | ( | MOTOR | m, | |
int | pwm | |||
) | [virtual] |
void ArmSim::setMotorPos | ( | MOTOR | m, | |
int | pos | |||
) | [inline, virtual] |
void ArmSim::simLoop | ( | ) | [virtual] |
void ArmSim::start2 | ( | ) | [virtual] |
do some additional config at start time; see ModelComponent.H
Reimplemented from RobotArm.
void ArmSim::stopAllMotors | ( | ) | [virtual] |