source: flair-src/trunk/lib/FlairSensorActuator/src/UgvControls.cpp@ 426

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

ugv update

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
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: 2020/12/09
6// filename: UgvControls.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: Virtual class for igv controls
14//
15//
16/*********************************************************************/
17
18#include "UgvControls.h"
19#include <Matrix.h>
20#include <FrameworkManager.h>
21#include <Tab.h>
22#include <DataPlot1D.h>
23
24using namespace flair::core;
25using namespace flair::gui;
26
27using std::string;
28
29namespace flair {
30namespace actuator {
31
32UgvControls::UgvControls(string name)
33 : IODevice(getFrameworkManager(), name) {
34 mainTab = new Tab(getFrameworkManager()->GetTabWidget(), name);
35
36 MatrixDescriptor *desc = new MatrixDescriptor(2, 1);
37 desc->SetElementName(0, 0, "speed");
38 desc->SetElementName(1, 0, "turn");
39
40 output = new Matrix(this, desc, floatType);
41 delete desc;
42 AddDataToLog(output);
43}
44
45UgvControls::~UgvControls() {
46}
47
48void UgvControls::UseDefaultPlot(void) {
49 DataPlot1D *speedPlot = new DataPlot1D(mainTab->NewRow(), "speed", -1, 1);
50 speedPlot->AddCurve(output->Element(0));
51 DataPlot1D *turnPlot = new DataPlot1D(mainTab->LastRowLastCol(), "turn", -1, 1);
52 turnPlot->AddCurve(output->Element(1));
53}
54
55Matrix *UgvControls::Output(void) const {
56 return output;
57}
58
59
60} // end namespace actuator
61} // end namespace flair
Note: See TracBrowser for help on using the repository browser.