How to produce and compile the Fiacre / Hippo version of the experiment.
You first need to install Hippo and TINA. Then
make sure that your $HIPPO_DIST
and $TINA_DIST
environment variables respectively point to the installed
distribution of Fiacre/Hippo and tina.
Although Hippo is a direct extension of Fiacre, it is not yet part of the official Fiacre distribution. For now you must grab it directly from Hippo distribution. If this distribution does not satisfy your system requirements, send me an email. |
Put these variables (tune the values for your installation) in your .bashrc
file.
export HIPPO_DIST=${HOME}/work/hippo-2.6.5 export TINA_DIST=${HOME}/work/tina-3.6.0
All the remaining components are git cloned, compiled and installed in ~/work
cd ~/work
Installing Utilities
The Fiacre GenoM template uses the following utility package.
-
felix-g3utils
which defines some macros and log functions used in writting codels.
git clone git://redmine.laas.fr/laas/users/felix/felix-g3utils.git cd felix-g3utils autoreconf -vif mkdir build cd build ../configure --prefix=${HOME}/work make install
Installing the GenoM3 Fiacre template
Then you need to install the GenoM3 Fiacre template:
cd ~/work git clone git://redmine.laas.fr/laas/users/felix/vandv/genom3-fiacre-template.git cd genom3-fiacre-template autoreconf -vif mkdir build cd build ../configure --prefix=${HOME}/work make install
After this, the command genom3 -l
(which list the templates available to your GenoM3 environment) should return this list of templates:
% genom3 -l fiacre/model fiacre/pocolibs fiacre/ros pocolibs/client/c pocolibs/server ros/client/c ros/client/ros ros/server interactive example mappings skeleton
Go in the ~/work/drone/vv
directory and type the commands:
cd ~/work/drone/vv mkdir build-hippo cd build-hippo genom3 fiacre/pocolibs --slow 10000 --wcet ../all-simu.wcet --patch ../fiacre-monitor.patch --port_mapping ../all-simu.pmap --exp_name quad ../all-simu.gen
The previous genom3
command can be interpreted like:
-
fiacre/pocolibs
is the name of template you are using. -
../all-simu.gen
is the file with the modules definition (in this case, it includes the 4 modules modeled). -
--slow 10000
is the frequency at which Hippo will run (in this case every 100 microsecond). -
--wcet ../all-simu.wcet
the file containing the worst case execution time value for the codels. -
--port_mapping ../all-simu.pmap
is the file where we mapin port
name inout port
name (e.g.nhfc_reference maneuver_desired
) -
--exp_name quad
is the name of the experiment.
cd fiacre-pocolibs autoreconf -vif ./configure --prefix=${HOME}/work make install
The content of the complete synthesized Fiacre model (with the monitor patch) can be found in: fiacre/drone_FiacreGenoM3.fcr
The fiacre-monitor.patch
includes mostly the following monitor process, plus the cnnection with the other parts of the model
process pom_state_quad_lander(
&state_updated: bool,
&rotorcraft_main_activities: Activities_rotorcraft_main_Array,
servo_index: act_inst_rotorcraft_main_index_type) is
states monitor_start, monitor_wait, monitor_error
var ignorep:nat
from monitor_start
ignorep := fiacre_c_print_patch_trace(6); // {0, "monitor_start entered"} /* 6 */
on (state_updated);
ignorep := fiacre_c_print_patch_trace(7); // {0, "monitor_start state_updated"}, /* 7 */
state_updated := false;
to monitor_wait
from monitor_wait
ignorep := fiacre_c_print_patch_trace(8); // {0, "monitor_wait entered"} /* 8 */
select
wait [2000,2000]; // 200 ms at 10 KHz = 2000
ignorep := fiacre_c_print_patch_trace(0); // {0, "monitor_wait 200 ms elapsed"}, /* 0 */
to monitor_error
[]
on (state_updated);
ignorep := fiacre_c_print_patch_trace(1); // {0, "monitor_wait state_updated."}, /* 1 */
state_updated := false;
to monitor_wait
end
from monitor_error
ignorep := fiacre_c_print_patch_trace(4); // {0, "monitor_error entered"},/* 4 */
if (rotorcraft_main_activities[servo_index].status = ACT_RUN_FCR) then
ignorep := fiacre_c_print_patch_trace(2); // {0, "monitor_error stopping Track"}, /* 2 */
rotorcraft_main_activities[servo_index].stop := true
else
ignorep := fiacre_c_print_patch_trace(9) // {0, "monitor_error nothing to stop"}, /* 9 */
end;
ignorep := fiacre_c_print_patch_trace(5); // {0, "monitor_error to monitor_start"},/* 5 */
to monitor_start
Basically, it monitors the shared variable state_updated
(which is automatically updated when pom
writes its state
port. If it is not updated for more than 200ms (2000 ticks when Hippo runs at 10 KHz), it goes to monitor_erreor, and
force the rotorcraft
servo
activity in the main
task to transit to its stop state. This has a result cuts the
engine. This monitor is rather crude… a more advanced one version monitor the same condition but send a take_off 0 0
request to maneuver
. Which is more gentle (but may result in a rough landing nevertheless).
To launch and run this experiment in simulation, check the Hippo Engine in simulation page, or on the real robot check the Hippo Engine on the real drone page.