source: flair-src/trunk/lib/FlairMeta/src/HdsX8.cpp@ 131

Last change on this file since 131 was 122, checked in by Sanahuja Guillaume, 8 years ago

modifs uav vrpn i686

File size: 1.9 KB
RevLine 
[10]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[10]4// %flair:license}
[7]5// created: 2015/02/08
6// filename: HdsX8.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
[22]13// purpose: Class defining a HDS X8 uav
[7]14//
15//
16/*********************************************************************/
17
18#include "HdsX8.h"
19#include <FrameworkManager.h>
20#include <RTDM_I2cPort.h>
21#include <RTDM_SerialPort.h>
22#include <Srf08.h>
23#include <Gx3_25_ahrs.h>
24#include <BlCtrlV2.h>
25#include <X4X8Multiplex.h>
26#include <Ps3Eye.h>
27
28using std::string;
29using namespace flair::core;
30using namespace flair::sensor;
31using namespace flair::filter;
32using namespace flair::actuator;
33
[15]34namespace flair {
35namespace meta {
[7]36
[122]37HdsX8::HdsX8(string name,
[15]38 filter::UavMultiplex *multiplex)
[122]39 : Uav(name, multiplex) {
40 RTDM_I2cPort *i2cport = new RTDM_I2cPort(getFrameworkManager(), "rtdm_i2c", "rti2c3");
41 RTDM_SerialPort *imu_port = new RTDM_SerialPort(getFrameworkManager(), "imu_port", "rtser1");
[7]42
[15]43 if (multiplex == NULL)
[122]44 SetMultiplex(new X4X8Multiplex(getFrameworkManager(), "motors", X4X8Multiplex::X8));
[7]45
[15]46 SetBldc(new BlCtrlV2(GetUavMultiplex(), GetUavMultiplex()->GetLayout(),
47 "motors", GetUavMultiplex()->MotorsCount(), i2cport));
[122]48 SetUsRangeFinder(new Srf08(getFrameworkManager(), "SRF08", i2cport, 0x70, 60));
49 SetAhrs(new Gx3_25_ahrs(getFrameworkManager(), "imu", imu_port,
[100]50 Gx3_25_imu::AccelerationAngularRateAndOrientationMatrix, 70));
[15]51 SetBatteryMonitor(((BlCtrlV2 *)GetBldc())->GetBatteryMonitor());
[122]52 SetVerticalCamera(new Ps3Eye(getFrameworkManager(), "camv", 0, 50));
[7]53}
54
[15]55HdsX8::~HdsX8() {}
[7]56
57void HdsX8::StartSensors(void) {
[15]58 ((Gx3_25_ahrs *)GetAhrs())->Start();
59 ((Srf08 *)GetUsRangeFinder())->Start();
[107]60 ((Ps3Eye *)GetVerticalCamera())->Start();
[7]61}
62
63} // end namespace meta
64} // end namespace flair
Note: See TracBrowser for help on using the repository browser.