Home → Frequently Asked Questions (FAQ) |
---|
Trick is a simulation environment and toolkit that allows users to create complex physics simulations.
You should use Trick if you want to develop an accurate physics simulation without needing to develop core simulation capabilities manually.
Trick currently runs on all System V and POSIX compliant UNIX operating systems. MacOSX and most Linux distributions fall under this umbrella.
Trick does not run natively on Windows, however it is possible to run Trick on the Windows 10 Linux Subsystem. Trick will not be ported to Windows until Windows is POSIX compliant, which is highly unlikely.
Homebrew.
Trick 19 is the version currently being developed on GitHub. We also maintain a branch for Trick 15 and Trick 17.
Trick 15 marked the first iteration of an open source Trick Simulation Environment. Trick 17 has several bug fixes, new features, and is currently in active development; it should be used for all new simulation development.
Trick is capable of interacting with other applications via the variable server; the variable server contains the values of a simulation which can then be sent over TCP/IP to a client application.
MathWorks developed a package to generate Trick friendly code from their models. An introduction video on Trick-MATLAB/Simulink interfacing can be found here.
cFS support for Trick is provided by the following external projects:
TVS-IO is an open-source, Core Flight Software (cFS) application that provides for two-way communication between a cFS Software Bus Network (SBN) and a Trick simulation.
Another soon to be released capability, presumably called TrickCFS should also be available soon as open-source software. Stay-tuned.
Create an issue on GitHub here. The more descriptive you are, the faster we can solve the issue.
Create an issue on GitHub here with "QUESTION: " appended to the title.
There are many reasons why a simulation will fail to compile properly.
Trick is capable of utilizing the vast majority of imperial and metric units. Trick uses the UDUNITS C library/database in its unit calculations. For a list of the most common units, run trick-units in a terminal window after installing Trick.
Trick's Java GUIs rely on several 3rd party .jar files which are normally downloaded during the initial compilation of Trick. If you are compiling on a machine without internet access you may copy the directory ${TRICK_HOME}/libexec/trick/java/lib to a machine that does have internet access and run make on that machine.
If the Trick memory manager and init attribute function is made a friend of a class, we are able to access protected/private variables in the input file through the memory manager.
class A {
// This class triggers Trick to process protected/private variables
friend class InputProcessor ;
// This friend function follows this naming convention "void init_attr ## <class_name>()"
friend void init_attrA() ;
private:
int ii ;
} ;
Input File statements
# Direct access will fail
my_sim_object.a.ii = 1 #fails
var = my_sim_object.a.ii #fails
# Use the var_set and var_get commands to access protected/private variables
trick.var_set("my_sim_object.a.ii", 1)
var = trick.var_get("my_sim_object.a.ii")
Trick has a few alternatives to an input file event. Both method execute faster than a regular input processor event, but are not as flexible.
Trick input files understand a lot about templates, but there is a limitation when using them. Input files cannot access a fixed array of template types directly. There are memory manager calls accessible from the input file that may be used to to read and write arrayed templates.
template < typename T > class A {
public:
T t;
} ;
class B {
public:
A<double> a[4] ;
} ;
Here is an input file accessing the template type
# direct access to arrayed template class will fail
my_sim_object.b.a[1].t = 1 # fails
var = my_sim_object.b.a[1].t = 2 # fails
# use these memory manager calls instead
trick.var_set("my_sim_object.b.a[1].t", 1)
var = trick.var_get("my_sim_object.b.a[1].t")
Trick is composed entirely of information. It contains no matter, organic or otherwise. Therefore Trick contains no gluten, GMOs, nor is it fed by grass, vegetables, or meat. Trick could be described as environmentally conservative in that it runs on numerous POSIX (Unix-like) operating systems. Trick is of course free-range! It's Opensource!, and freely available to anyone, even dolphins with internet access.