source: flair-src/trunk/lib/FlairMeta/src/SimuPlane.cpp@ 463

Last change on this file since 463 was 462, checked in by Sanahuja Guillaume, 3 years ago

remove executable property

File size: 1.8 KB
RevLine 
[461]1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5// created: 2022/01/05
6// filename: SimuPlane.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: Class defining a simulation plane
14//
15//
16/*********************************************************************/
17#ifdef CORE2_64
18
19#include "SimuPlane.h"
20#include <FrameworkManager.h>
21#include <SimulatedImu.h>
22#include <PassthroughAhrs.h>
23#include <SimulatedBldc.h>
24#include <SimulatedServos.h>
25#include <SimulatedUs.h>
26#include <BatteryMonitor.h>
27#include "PlaneMultiplex.h"
28#include <Tab.h>
29
30using std::string;
31using namespace flair::core;
32using namespace flair::gui;
33using namespace flair::sensor;
34using namespace flair::filter;
35using namespace flair::actuator;
36
37namespace flair {
38namespace meta {
39
40SimuPlane::SimuPlane(string name, uint32_t simu_id,filter::PlaneMultiplex *multiplex)
41 : Plane(name, multiplex) {
42
43
44 SetBldc(new SimulatedBldc(multiplex->GetBldcMultiplex(), multiplex->GetLayout(),"motors",1, simu_id,0));
45 SetServos(new SimulatedServos(multiplex->GetServosMultiplex(),multiplex->GetLayout(),"servos",2, simu_id,0));
46 SetUsRangeFinder(new SimulatedUs("us", simu_id,0, 60));
47 SetAhrs(new PassthroughAhrs(new SimulatedImu("imu", simu_id,0, 70),"ahrs"));
48 Tab *bat_tab = new Tab(getFrameworkManager()->GetTabWidget(), "battery");
49 SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery"));
50 GetBatteryMonitor()->SetBatteryValue(12);
51
52}
53
54SimuPlane::~SimuPlane() {}
55
56void SimuPlane::StartSensors(void) {
57 ((SimulatedImu *)(GetAhrs()->GetImu()))->Start();
58 ((SimulatedUs *)GetUsRangeFinder())->Start();
59}
60
61
62
63} // end namespace meta
64} // end namespace flair
65
66#endif
Note: See TracBrowser for help on using the repository browser.