Contents
Note: This tutorial is your first step in getting started with T-REX.. |
Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Obtain, compile and test T-REX.
Description: This tutorial will get you started using T-REX.Keywords: trex, build, test
Tutorial Level: BEGINNER
Next Tutorial: Before going any further, we suggest you peruse this background material first Create your own project with T-REX
Prerequisites
T-REX requires Perforce Jam 2.5 or better. Under linux this can be obtained thus:
sudo apt-get install jam
The easiest way to build T-REX is through ROS. Only the ROS build tools are required. These can be obtained by following the instructions in steps 1 and 2, for the ROS only install detailed here.
Getting Required Sources and Building
Make sure the ROS_PACKAGE_PATH environment variable is set to include the directory into which you check out T-REX. For example:
export ROS_PACKAGE_PATH=`pwd`:$ROS_PACKAGE_PATH
Check out the ROS package used to build TREX and all its external dependencies:
svn co https://code.ros.org/svn/wg-ros-pkg/branches/trunk_cturtle/stacks/executive_trex \ executive_trex
Now you can build:
roscd trex rosmake
Building and Running the Test Harness
TREX has an extensive test harness consisting of small examples which exercise a range of different behaviors in the executive. To build all relevant libraries and execute the tests:
roscd trex make test
If successful, you should see the following command line complete without complaint.
ExecuteTarget RUN_agent-module-tests_g_rt
Inspection of the output file:
cat TREX/agent/test/RUN_agent-module-tests_g_rt.output
should illustrate the set of tests that passed and will look something like this:
GamePlayTests::test*************** Running testPersonalRobots .... SUCCESS Running testSynch .... SUCCESS Running testExtensions .... SUCCESS Running OrienteeringSolver .... SUCCESS Running testRecall .... SUCCESS Running testRepair .... SUCCESS Running testLogging .... SUCCESS Running testPersistence .... SUCCESS Running testSimulationWithPlannerTimeouts .... SUCCESS Running testScalability .... SUCCESS Running testTestMonitor .... SUCCESS Running testOneDeliberatorOneAdapter .... SUCCESS Running bugFixes .... SUCCESS Running testInconsistent .... SUCCESS Running testOneStepAhead .... SUCCESS Running testFileSearch .... SUCCESS Running testDispatch .... SUCCESS Running testSqueezeObserver .... SUCCESS Running testSimulation .... SUCCESS Running testUndefinedSingleTimeline .... SUCCESS Running testUndefinedDerived .... SUCCESS Running testActions .... SUCCESS GamePlayTests::test PASSED. AgentTests::test*************** Running testRealTimeClock .... SUCCESS Running testForeverConfiguration .... SUCCESS Running testTimelimitOverride .... SUCCESS AgentTests::test PASSED.
Setting up the environment
This does not work yet. There are a number of tools available from the command line, and a number of environment variables required for correct execution. To avail of these tools conveniently:
source `rospack find trex`/bashrc.trex
After which you should you should see tab completion after entering
trex
will produce the following output
trexcreate trexdepends trexfind trexmonitor trexparse trexrun
It is convenient to set this up whenever you open up a new bash shell. To do this:
echo "source `rospack find trex_core`/bashrc.trex" >> ~/.bashrc