ArmSim Class Reference

Inheritance diagram for ArmSim:
Inheritance graph
[legend]
Collaboration diagram for ArmSim:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

Definition at line 61 of file ArmSim.H.


Member Function Documentation

void ArmSim::addObject ( OBJECT_TYPE  objType,
double  initPos[3] 
)

Add an object of type OBJECT_TYPE.

Definition at line 809 of file ArmSim.C.

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 (  ) 

Draw the objects we know of.

Definition at line 752 of file ArmSim.C.

References drawLine().

double ArmSim::encoder2ang ( int  eng,
MOTOR  m 
)

Convert encoder value to angle value.

Definition at line 262 of file ArmSim.C.

void ArmSim::getArmLoc ( double  loc[3]  ) 

Get the arm location from 2d to 3d.

Definition at line 615 of file ArmSim.C.

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]

Do the homeing to the all motor.

Reimplemented from RobotArm.

Definition at line 326 of file ArmSim.C.

void ArmSim::moveObject ( double  pos[3],
int  objID = 0 
)

Move the first add objects.

Definition at line 800 of file ArmSim.C.

void ArmSim::resetEncoders (  )  [virtual]

Reset all motor encoder value to 0.

Reimplemented from RobotArm.

Definition at line 317 of file ArmSim.C.

void ArmSim::resetMotorPos ( void   )  [inline, virtual]

Reset all motor position to the home place.

Reimplemented from RobotArm.

Definition at line 118 of file ArmSim.H.

void ArmSim::setMotor ( MOTOR  m,
int  pwm 
) [virtual]

Set the Motor Speed and Direction by pwm.

Reimplemented from RobotArm.

Definition at line 182 of file ArmSim.C.

void ArmSim::setMotorPos ( MOTOR  m,
int  pos 
) [inline, virtual]

Set the Motor Position by the encoder value.

Reimplemented from RobotArm.

Definition at line 115 of file ArmSim.H.

void ArmSim::simLoop (  )  [virtual]

Bring motor to a predefined position.

Reimplemented from RobotArm.

Definition at line 724 of file ArmSim.C.

void ArmSim::start2 (  )  [virtual]

do some additional config at start time; see ModelComponent.H

Reimplemented from RobotArm.

Definition at line 151 of file ArmSim.C.

void ArmSim::stopAllMotors (  )  [virtual]

Stop all the motor movement.

Reimplemented from RobotArm.

Definition at line 212 of file ArmSim.C.


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:06 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3