Graphics.ApiFileReference - lordmundi/wikidoctest GitHub Wiki
« | EDGE User’s Guide | »
This is the older API File Reference documentation for versions of EDGE 2.0 and below. For newer versions, see this page.
The API file is a file used to map graphics nodes to simulation variables.
It has the following syntax:
<node_name> <simulation_variable_name> <node_dof> <destination units> write 1.0
FG ++
I'm not sure if the last two fields are used by the API parser
FG —
As an example:
STATUS_DYN_OV graphics.chutes.out.pos[0] x M write 1.0
This will convert the value found in "graphics.chutes.out.pos[0]" to meters, and then drive the "x" DOF of node "STATUS_DYN_OV" with it.
An example of an orbital body mapping:
ISS_SIM_POS graphics.orbital.element[5].out.ecef_to_gmf.location[0] x in write 1.0
ISS_SIM_POS graphics.orbital.element[5].out.ecef_to_gmf.location[1] y in write 1.0
ISS_SIM_POS graphics.orbital.element[5].out.ecef_to_gmf.location[2] z in write 1.0
ISS_SIM_ATT graphics.orbital.element[5].out.ecef_to_gmf.euler_angles[0] pitch d write 1.0
ISS_SIM_ATT graphics.orbital.element[5].out.ecef_to_gmf.euler_angles[1] yaw d write 1.0
ISS_SIM_ATT graphics.orbital.element[5].out.ecef_to_gmf.euler_angles[2] roll d write 1.0
The simdata plugin will look at two units:
- the source unit: the unit specified in the header file that says in what the unit the simulation variable is recorded in
- the destination unit: the unit specified in the API file (see above) that says in what unit the variable should be converted to
Getting unit declarations that work well using both comm and the simdata plugin can sometime get a bit hairy. Here is our suggestion to avoid the most headaches:
- Keep data declared in the sim in meters (the variables you are recording… nothing else matters here), even if it is just data such as on/off flags that doesn't represent distances.
- Convert distances and angles to inches and degrees using the API file as shown in the example above
- Use meters ("M") in the api file when the data in the node is just being used for flags or other data that you don't want converted. By using "M" as the unit (as in the STATUS_DYN_OV example above), the parser sees the same unit as the input unit in the header file and no conversion is performed.
« | EDGE User’s Guide | »