Graphical Simulation Programmer Notes = tsxGraphics

Application Name: tsxGraphics

Development Path: vc_proj/RTSX/cs/tsxGraphics

Contents

Form Information
Camera View Control = gfxView
IOMenu
ViewMenu
Vehicle Display = gfxVehicle
SelectMenu
Arm Display = gfxArm
EeMenu
SelectMenu
Simulation Control = gfxSum
VehicleMenu
TypeMenu
Utility Group Forms
Menu Information
File Menu = gfxwmFileM
Display Menu = gfxwmDisplayM
Global Variables
Communication Variables
Simulation Variables
Performer Variables
XForms Variables

Form Infomation


gfx_form[0] = gfxView
Label = "Camera View Control"
 
gfxViewSysObj
[0] File Menu button -> wm_fileMenuButtonCB(0)
[2] Display Menu Button -> wm_displayMenuButtonCB(0)
 
gfxViewChoiceObj
None
 
gfxViewLabelObj
None
 
gfxViewCmdObj
[1] View Initialize Button -> gfx_initViewCB(0)
[2] Interlace Stereo Button -> No CB function Yet
 
 
gfxViewCmd1Obj
[0-3] Graphic View Selection Option Menu -> gfx_viewCB(i)
0 = Graphics, 1 = Graphics 1, 2 = Graphics 2, 3 = Stereo
 
gfxViewCmd2Obj
[0-3] Graphic Window Control Radio Buttons -> gfx_chooseCameraCB(i)
0 = Graphics, 1 = Graphics 1, 2 = Graphics 2, 3 = Stereo
 
gfxViewCmd3Obj
[0-3] Graphic View Message Type Option Menu -> gfx_viewTypeMenuButtonCB(i)
0 = Graphics, 1 = Graphics 1, 2 = Graphics 2, 3 = Stereo
 
gfxViewCmd4Obj
[0-6] Delta Control Inputs -> gfx_deltaInputCB(i)
0 = Fwd, 1 = Right, 2 = Down, 3 = Roll, 4 = Pitch, 5 = Yaw
 
gfxViewCmd5Obj
[0-6] Delta Control Increment Button -> gfx_deltaUpButtonCB(i)
0 = Fwd, 1 = Right, 2 = Down, 3 = Roll, 4 = Pitch, 5 = Yaw
 
gfxViewCmd6Obj
[0-6] Delta Control Inputs -> gfx_deltaDownButtonCB(i)
0 = Fwd, 1 = Right, 2 = Down, 3 = Roll, 4 = Pitch, 5 = Yaw
 
gfxSumCmd0Obj
[10] IO Device Selection Option Menu -> gfx_overrideMenuButtonCB(10)
although a gfxSum object it is the Delta Control Menu on the gfxView form.
 
gfxSumCmd1Obj
[10] IO Device Multiplier Input -> gfx_multiplierCB(10)
although a gfxSum object it is the Delta Control Multiplier Input on the gfxView form.
 
gfxViewTelObj
None
 
Menus
IOMenu
IOMenuButton(i) -> gfx_IOMenuButtonCB(i)
 
-1= None,
use definitions in vc_proj/RTSX/include/TSXNUMS.H
0 = HCA
1 = HCB
2 = HCC
3 = HCD
4 = SBA
5 = SBB
6 = SBC
7 = SBD
8 = HCA_Sim
9 = HCB_Sim
10 = HCC_Sim
11 = HCD_Sim
12 = Log A(Head)
13 = Log B(Mouse)
14 = Log C(Mouse)
15 = Log D(Mouse)
16 = MagA(Head)
17 = MagB(Mouse)
18 = MagC(Mouse)
19 = MagD
20 = TTNA(Left)
21 = TTNB(Right)
22 = TTNC
23 = TTND
24 = HCA_TSX
25 = HCB_TSX
26 = HCC_TSX
27 = HCD_TSX
 
 
 
ViewMenu

 ViewMenuButton(i) -> gfx_viewMenuButtonCB(i)

where i is the id of the view as defined in gfx_define.h as <>_VIEW
 
0 = None
1 = Mobile1
2 = Mobile2
3 = N. Porthole
4 = S. Porthole
5 = SCAMP
6 = SSV
7 = Ranger NBV
8 = Ranger TSX
Ranger NBV Manipulator cameras
9 = Right Arm
10 = Left Arm
11 = Grapple Arm
12 = Video Arm
Ranger TSX Manipulator Cameras
13 = Positioning Leg 1
14 = Positioning Leg 2
15 = Right 8DOF Arm
16 = Left 8DOF Arm
17 = Positioning Leg 3
18 = Video 7DOF Arm
 
 

gfx_form[1] = gfxVehicle
Label = "Vehicle Display"
 
gfxVehicleSysObj
[0] File Menu button -> wm_fileMenuButtonCB(0)
[2] Display Menu Button -> wm_displayMenuButtonCB(0)
 
gfxVehicleCmdObj
[0] NBRF Display Option Menu -> gfx_vehicleCB(0)
[1] NBV Spacelab pallet Display Option Menu-> gfx_vehicleCB(1)
[2] RPCM Display Button -> gfx_palletCB(2)
[3] ECU Display Button -> gfx_palletCB(3)
[4] APFR Display Button -> gfx_palletCB(4)
[5] Hoops Display Button -> gfx_palletCB(5)
 
gfxVehicleCmd1Obj
[0-3] Vehicle Actual Position Display Option Menu -> gfx_vehicle1CB(i)
where i is the id of the vehicle
0 = Ranger TSX, 1 = Ranger NBV, 2 = SSV, 3 = SCAMP, 4 = MPOD
 
gfxVehicleCmd2Obj
[0-3] Vehicle Command Position Display Option Menu -> gfx_vehicle2CB(i)
where i is the id of the vehicle
0 = Ranger TSX, 1 = Ranger NBV, 2 = SSV, 3 = SCAMP, 4 = MPOD
 
gfxVehicleCmd3Obj
[0-3] Vehicle Desired Position Display Option Menu -> gfx_vehicle3CB(i)
where i is the id of the vehicle
0 = Ranger TSX, 1 = Ranger NBV, 2 = SSV, 3 = SCAMP, 4 = MPOD
 
gfxVehicleCmd4Obj
[0-3] Vehicle Trajectory Position Display Option Menu -> gfx_vehicle4CB(i)
where i is the id of the vehicle
0 = Ranger TSX, 1 = Ranger NBV, 2 = SSV, 3 = SCAMP, 4 = MPOD
 
Menus
SelectMenu

SelectMenuButton(i) -> gfx_selectMenuButtonCB(i)

where i is the display method
0 = None
1 = Textured
2 = Transparent
3 = Solid
4 = Wireframe
 

gfx_form[2] = gfxArm
Label = "Arm Display"
Objects
 
gfxArmSysObj
[0] File Menu button -> wm_fileMenuButtonCB(0)
[2] Display Menu Button -> wm_displayMenuButtonCB(0)
 
gfxArmCmd1Obj
[0-7] Arm Actual Position Display Option Menu -> gfx_arm1CB(i)
where i is the id of the arm
0 = DXL, 1 = DXR, 2 = GRP, 3 = VID, 4 = DXL8, 5 = DXR8, 6 = PXL, 7 = VID7
 
gfxArmCmd2Obj
[0-7] Arm Command Position Display Option Menu -> gfx_arm2CB(i)
where i is the id of the arm
0 = DXL, 1 = DXR, 2 = GRP, 3 = VID, 4 = DXL8, 5 = DXR8, 6 = PXL, 7 = VID7
 
gfxArmCmd3Obj
[0-7] Arm Desired Position Display Option Menu -> gfx_arm3CB(i)
where i is the id of the arm
0 = DXL, 1 = DXR, 2 = GRP, 3 = VID, 4 = DXL8, 5 = DXR8, 6 = PXL, 7 = VID7
 
gfxArmCmd4Obj
[0-7] Arm Trajectory Position Display Option Menu -> gfx_arm4CB(i)
where i is the id of the arm
0 = DXL, 1 = DXR, 2 = GRP, 3 = VID, 4 = DXL8, 5 = DXR8, 6 = PXL, 7 = VID7
 
gfxArmCmd5Obj
[0-5] Arm End Effector Selector Option Menu -> gfx_eeCB(i)
where i is the id of the arm
0 = DXL, 1 = DXR, 2 = GRP, 3 = VID, 4 = DXL8, 5 = DXR8
[6] PXL End Effector Selector => gfx_eePxlCB(0)
 
Menus
EeMenu

EeMenuButton(i) = gfx_EeMenuButtonCB(i)

0 = None
1 = Spar Jaws
2 = Angle Drive
3 = Bare Bolt Tool
4 = Tether Loop
5 = SpaceLab Pallet
6 = Handrail Gripper
7 = APFR Paddle
8 = Microconical
9 = PIP Pin
14 Tether w/ ECU
17 =Micro w/RPCM
24 = Teher w/ APFR
 
 
SelectMenu

SelectionMenuButton(i) -> gfx_selectMenuButtonCB(i)

0 = None
1 = Textured
2 = Transparent
3 = Solid
4 = Wireframe
 


gfx_form[3] = gfxSum
Label = "Simulation Control"

Objects

gfxSumSysObj
[0] File Menu button -> wm_fileMenuButtonCB(0)
[2] Display Menu Button -> wm_displayMenuButtonCB(0)
 
gfxSumChoiceObj
None
 
gfxSumLabelObj
None
 
gfxSumCmdObj
[0] NDDS->Shmem button -> gfx_ndds2Shmem(0)
[1] IO Device Offset toggle button -> gfx_tracking ModeCB(0)
 
gfxSumCmd0Obj
[1-7] IO Device Selection Option Menu -> gfx_overrideMenuButtonCB(i)
where i is defines which of the 7 menus
 
gfxSumCmd1Obj
[1-7] IO Device Multiplier Input -> gfx_multiplierCB(i)
where i is defines which of the 7 menus
 
gfxSumCmd2Obj
[1-7] Option IO Device Selection Option Menu -> gfx_overrideCartMenuButtonCB(i)
where i is defines which of the 7 menus
 
gfxSumCmd3Obj
[1-7] Offset IO Device Multiplier Input -> gfx_multiplierCartCB(i)
where i is defines which of the 7 menus
 
gfxSumCmd4Obj
[1-7] Object Selection Option Menu -> gfx_objectControlMenuButtonCB(i)
where i is defines which of the 7 menus
 
gfxSumCmd5Obj
[1-7] Object Message Type Selection Option Menu -> gfx_objectTypeMenuButtonCB(i)
where i is defines which of the 7 menus
 
gfxSumTelObj
None
 
Menus
VehicleMenu

VehicleMenuButton[i] -> gfx_vehicleMenuCB(i)

where i is the id of the specific views, as defined in gfx_define.h as <>_VIEW
0 = None
1 = Mobile1
2 = Mobile2
3 = N. Porthole
4 = S. Porthole
5 = SCAMP
6 = SSV
7 = Ranger NBV
8 = Ranger TSX
 
 
TypeMenu

TypeMenuButton [i] -> gfx_typeMenuCB(i)

where i is the message type id as defined in gfx_define.h as NBV_<>
0 = ACT
1 = CMD
2 = DES
3 = TRAJ
 

Utility Group Forms

This application also uses the utility group forms of the ECI. These include two additional panels.

Utility Programmer Notes


Menu Information

File Menu = gfxwmFileM

 gfxwmFileMCmdObj

[0] Load Window Config... -> gfxwm_fileMenuButtonCB(0)
[1] Save Window Config ... -> gfxwm_fileMenuButtonCB(1)
[2] Load Preferences ... ->gfxwm_fileMenuButtonCB(2)
[3] Save Preferences ... ->gfxwm_fileMenuButtonCB(3)
[4] Clean Up Desktop -> gfxwm_fileMenuButtonCB(4)
[5] Close Window -> gfxwm_fileMenuButtonCB(5)
[6] Quit All -> gfxwm_fileMenuButtonCB(6)

Display Menu = gfxwmDisplayM

 gxwmDisplayMCmdObj[i]->gfxwm_displayMenuButtonCB(i)

where is the id of the form to be opened
0 = Camera View Control
1 = Vehicle Display
2 = Arm Display
3 = Simulaiton Control
4 = TsxGraphics Load
5 = Input Display


Global Variables

Communication Variables

hcState_t gfx_ioState[HCID__NUM_OF]
This array of structures holds the state of each input device, ids defined in /vc_proj/RTSX/include/TSXNUMS.H,
float x, y, z, roll, pitch, yaw - These elements are the cartesian components of the input device, the units are either dimensionless for cartesian rate devices or in meters and rad/s for cartesian position devices.
short buttons - this is a bitwise packed variable giving the status of up to 16 buttons.
 
float gfx_RTSXArmJoint[ARMID__NUM_OF][MAX_NBVMESSAGE][MAX_DOF_PER_ARM]
This matrix holds the joint angles, in radians, of each joint on RTSX. The matrix ids are as follows:
ARMID__NUM_OF - The id of the arm(ARMID__DXL, ARMID__DXR, ARMID__PXL, ARMID__VID)
MAX_NBVMESSAGE - Which data variable (NBV_CMD, NBV_DES, NBV_ACT, NBV_TRAJ)
MAX_DOF_PER_ARM - The id of the arm joint
 
gfx_line_t gfx_line[GFX_MAX_LINE]
This array of structures is used to draw arbitary lines within the simulation
short color - The color of the line, 0 means the line will not be displayed
float x1, y1, z1 - These elements are the cartesian position of the first endpoint, in simulation frame of reference
float x2, y2, z2 - These elements are the cartesian position of the second endpoint, in simulation frame of reference
 
Simulation Variables
short CameraView[5]
This array identifies which trackable object is being viewed for each graphics window
[0] Graphics, [1] Graphics 1, [2] Graphics 2, [3] Stereo
 
short CameraObjectView[5]
This array identifies which object is being viewed for each graphics window
[0] Graphics, [1] Graphics 1, [2] Graphics 2, [3] Stereo
 
short CameraMessageView[5]
This array identifies which message type (ACT, CMD, DES, TRAJ) is being viewed for each graphics window.
[0] Graphics, [1] Graphics 1, [2] Graphics 2, [3] Stereo
 
short CameraControl
This variable indicates which graphics window camera is being operated
0 = Graphics, 1 = Graphics 1, 2 = Graphics 2, 3 = Stereo
 
short ObjectDisplay[MAX_VIEW*MAX_NBVMESSAGE]
This array designates the display status of each trackable object. This is not a human interface variable, this varable is set and used to reduce the number of if comparisions during the main event loop.
-1 = Display arm with forward kinematics, 0 = Don't display, 1 = Display, 2 = Display vehicle with Control Override
 
short VehDisplay[5][MAX_NBVMESSAGE], ArmDisplay[6][MAX_NBVMESSAGE]
These matrices holds the display status for each item within the graphical simulation. The first element identifies the vehicle, arm, or structure in the simulaiton, The second element designates which message type (ACT, CMD, DES, TRAJ), since there are four of each object. The matrix hold the display status, where 0 = Not Displayed, 1 = Virtual, 2 = Opaque.
 
float ObjMatDelta[MAX_VIEW*MAX_NBVMESSAGE][7]
This matrix holds the change in position, orientation(in Euler angles), and the FOV for each objects view. Since every object, denoted by the first element, can have a camera attached to it the second element provide for offset for each camera view.
 
float EyeOffset
This variable is used for stereo images. It is the distance, in inches, between the two views.
 
short IOControl[MAX_VIEW*MAX_NBVMESSAGE], IOCartControl[MAX_VIEW*MAX_NBVMESSAGE]
These arrays designate which input devices are used to control the different objects, as stated by the element of the array which includes information about which objects and message type. IOControl identifies which input device actually moves the object. IOCartControl identifies which input devices is used as a Cartesian offset, very useful for head tracking.
 
short IOMult[MAX_VIEW*MAX_NBVMESSAGE], IOCartMult[MAX_VIEW*MAX_NBVMESSAGE]
These arrays state the multipliers used to amplify the input devices signal. Defaulting at one, this multiplier can increase the movement caused by the input devices. IOMult is the multiplier for the input control, IOCartMult is the multiplier used by the Cartesian offset input devices. For Cartesian devices only the translation are multiplied, the rotation input remains at a one to one ratio.
 
short IOCartTrackMode
This variable designates which mode the Cartesian offset input device is in. 1 = Tracking mode, the typical head tracking mode were the viewpoint is slave to head motions. 2 = Target mode, a special mode where the view is moved about a target point, which is the center of the tracked object. Rotations are about this new position always keeping the target in the viewing center.
 
float DH_A_arm[6][10], DH_D_arm[6][10]
These matrices hold the DH parameters for each arm. The first element identifies the arm, 0 = DXR, 1 = DXL, 2 = GRP, 3 = VID, 4 = DXR8, 5 = DXL8). The second element identifies the joint on the arm.
 
float Q0V_arm[6][4], PV0_arm[6][3]
These matrices hold the quaterion and position vector for tranfering from the arm's base frame to last joint. The first element identifies the arm, 0 = DXR, 1 = DXL, 2 = GRP, 3 = VID, 4 = DXR8, 5 = DXL8). The second hold the quaterion or position information.
 
Performer Variables
pfPipeWindow *pw[5]
This array of pointers are the graphics pipe for each graphics window
[0] Graphics, [1] Graphics 1, [2] Graphics 2, [3] Stereo Left, [4] Stereo Right
 
pfChannel *chan[5]
This array of pointers are the channels for each graphics window, this relates the window to a graphics view
[0] Graphics, [1] Graphics 1, [2] Graphics 2, [3] Stereo Left, [4] Stereo Right
 
pfMatrix CameraMat[5]
The matrix defining the position and orientation of the view for each graphics window
[0] Graphics, [1] Graphics 1, [2] Graphics 2, [3] Stereo Left, [4] Stereo Right
 
pfMatrix ObjMat[MAX_VIEW*MAX_NBVMESSAGE]
This array of matrices define the position and orientation of each trackable objects. Each object (as defined in gfx_define.h as <>_VIEW) can be displayed four times, one for each message type (as defined in gfx_define.h as NBV_<>) .
 
pfMatrix ViewMat[MAX_VIEW*MAX_NBVMESSAGE]
This array of matrices define the transformation from ObjMat to the viewing matrix of each trackable objects. Each object (as defined in gfx_define.h as <>_VIEW) can be displayed four times, one for each message type (as defined in gfx_define.h as NBV_<>) .
 
pfMatrix ObjMatDelta[MAX_VIEW*MAX_NBVMESSAGE]
This array of matrices define the position and orientation of each trackable objects. Each object (as defined in gfx_define.h as <>_VIEW) can be displayed four times, one for each message type (as defined in gfx_define.h as NBV_<>) .
 
pfSwitch *SwitchScamp[MAX_NBVMESSAGE], *SwitchSSV[MAX_NBVMESSAGE], *SwitchNBV[MAX_NBVMESSAGE]
This array of switches are used to display each vehicle. Since each vehicle can be displayed four times, once for each message type(ACT, CMD, DES, TRAJ), each element represents one of the message types.
 
pfSwitch *SwitchStruct
This switch pointer is used to determine which structures are displayed in the graphical simulation. It is bytewise.
0x01 NBRF, 0x02 = NBV Pallet
 
pfSwitch *SwitchPalletRPCM[MAX_NBVMESSAGE]
This switch turns the RPCM task element on the TSX pallet on and off.
 
pfSwitch *SwitchPalletECU[MAX_NBVMESSAGE]
This switch turns the ECU task element on the TSX pallet on and off.
 
pfSwitch *SwitchPalletAPFR[MAX_NBVMESSAGE]
This switch turns the APFR task element on the TSX pallet on and off.
 
pfSwitch *SwitchHoops
This switch pointer is used to determine whether the hoops are displayed within the tank or not.
 
pfSwitch *SwitchNBVArm[8][MAX_NBVMESSAGE]
This pointer array displays the different arms on Ranger. The first element designates which arm. The second element designates the message type (ACT, CMD, DES, TRAJ).
 
pfSwitch *SwitchNBVArmEE[8][MAX_NBVMESSAGE]
This pointer array displays one of the many end effectors for each arm. The first element designates which arm. The second element designates the message type (ACT, CMD, DES, TRAJ). The value designate which end effector is displayed.
0 = None, 1 = Spar Jaws, 2 = Angle Drive, 3 = Bare Bolt Tool, 4 = Tether Loop, 5 = SpaceLab Pallet, 6 = Handrail Gripper, 7 = APFR Paddle, 8 = Microconical, 9 = PIP Pin, 14 Tether w/ ECU, 17 =Micro w/RPCM, 24 = Teher w/ APFR
 
DOFdata ArmDOF[8][8][MAX_NBVMESSAGE]
This stucture is used to hold information on the degrees of freedom for the arm. The first element designates which arm, the second identifies the joint number, the third element is the message type. Part of the structure hold the transformation matrix for that arm joint. Another part hold the parameters defining the linkage between the different arm segments

DOFdata VehDOF[5][MAX_NBVMESSAGE]
This stucture is used to hold information on the degrees of freedom for the vehicle. The first element designates which vehicle and the second identifies is the message type. Part of the structure hold the transformation matrix for the vehicle.
 
XForms Global Variables
short IOControlObject[8]
This array designates which tracakable object is listed in the ith row of the Kinematic Control form.
 
short IOControlMessage[8]
This array designates which message type is listed in the ith row of the Kinematic Control form.
 
short ViewMenuMemory, WindowMenuMemory, IOMenuMemory, IOCartMenuMemory, EeMenuMemory, ViewTypeMenuMemory, TypeMenuMemory, ControlMenuMemory
These variables track which button was pressed to activate the different menu. For example, the IOMenuMemory variable will hold which Input Device Option Menu was pressed. This is required since a separate function determines which button inside a menu was pressed, however which menu was pressed is only known through these MenuMemory variables.
 
short MenuFlag
This reusable global variable states whether a menu is currently displayed on the screen. It is used to close existing menus after a selection has been made.
 
short SelectMenuMemory[2]
This two element array is similiar to the MenuMemory variables. The Select Menu are used to change the display options on each object, the second element determines which object menu was manipulated. Since each object can be displayed four times, one for each message type, the first element determines which of the message types were manipulated.