DataTrace.hpp
Go to the documentation of this file.
1 #ifndef YOUBOT_DATATRACE_H
2 #define YOUBOT_DATATRACE_H
3 
4 /****************************************************************
5  *
6  * Copyright (c) 2011
7  * All rights reserved.
8  *
9  * Hochschule Bonn-Rhein-Sieg
10  * University of Applied Sciences
11  * Computer Science Department
12  *
13  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14  *
15  * Author:
16  * Jan Paulus, Nico Hochgeschwender, Michael Reckhaus, Azamat Shakhimardanov
17  * Supervised by:
18  * Gerhard K. Kraetzschmar
19  *
20  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21  *
22  * This sofware is published under a dual-license: GNU Lesser General Public
23  * License LGPL 2.1 and BSD license. The dual-license implies that users of this
24  * code may choose which terms they prefer.
25  *
26  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
27  *
28  * Redistribution and use in source and binary forms, with or without
29  * modification, are permitted provided that the following conditions are met:
30  *
31  * * Redistributions of source code must retain the above copyright
32  * notice, this list of conditions and the following disclaimer.
33  * * Redistributions in binary form must reproduce the above copyright
34  * notice, this list of conditions and the following disclaimer in the
35  * documentation and/or other materials provided with the distribution.
36  * * Neither the name of the Hochschule Bonn-Rhein-Sieg nor the names of its
37  * contributors may be used to endorse or promote products derived from
38  * this software without specific prior written permission.
39  *
40  * This program is free software: you can redistribute it and/or modify
41  * it under the terms of the GNU Lesser General Public License LGPL as
42  * published by the Free Software Foundation, either version 2.1 of the
43  * License, or (at your option) any later version or the BSD license.
44  *
45  * This program is distributed in the hope that it will be useful,
46  * but WITHOUT ANY WARRANTY; without even the implied warranty of
47  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48  * GNU Lesser General Public License LGPL and the BSD license for more details.
49  *
50  * You should have received a copy of the GNU Lesser General Public
51  * License LGPL and BSD license along with this program.
52  *
53  ****************************************************************/
54 #include <vector>
55 #include <sstream>
56 #include <string>
57 #include <cstdio>
58 #include <stdexcept>
59 #include <iostream>
60 #include <stdlib.h>
61 #include "boost/date_time/gregorian/gregorian.hpp"
62 #include "boost/filesystem.hpp"
65 
66 using namespace boost::posix_time;
67 namespace youbot {
68 
69 
78 };
82 class DataTrace {
83  public:
84  DataTrace(YouBotJoint& youBotJoint, const std::string Name, const bool overwriteFiles = false);
85 
86  virtual ~DataTrace();
87 
88  void startTrace();
89 
90  void stopTrace();
91 
92  void plotTrace();
93 
94  void updateTrace(const JointAngleSetpoint& setpoint);
95 
96  void updateTrace(const JointVelocitySetpoint& setpoint);
97 
98  void updateTrace(const JointRoundsPerMinuteSetpoint& setpoint);
99 
100  void updateTrace(const JointCurrentSetpoint& setpoint);
101 
102  void updateTrace(const JointTorqueSetpoint& setpoint);
103 
104  void updateTrace(const JointEncoderSetpoint& setpoint);
105 
106  void updateTrace();
107 
108  unsigned long getTimeDurationMilliSec();
109 
110 
111  private:
112  DataTrace(const DataTrace & source);
113 
114  DataTrace & operator=(const DataTrace & source);
115 
116  void update();
117 
119 
121 
123 
125 
127 
129 
131 
132  std::fstream file;
133 
135 
137 
139 
141 
143 
145 
147 
149 
151 
153 
154  time_duration timeDuration;
155 
156  unsigned long timeDurationMicroSec;
157 
159 
161 
162  std::vector<YouBotJointParameterReadOnly*> parameterVector;
163 
164  std::string name;
165 
166  std::string path;
167 
169 
171 
173 
175 
177 
178 };
179 
180 } // namespace youbot
181 #endif
JointCurrentSetpoint currentSetpoint
Definition: DataTrace.hpp:140
time_duration timeDuration
Definition: DataTrace.hpp:154
JointTorqueSetpoint torqueSetpoint
Definition: DataTrace.hpp:142
JointRoundsPerMinuteSetpoint roundsPerMinuteSetpoint
Definition: DataTrace.hpp:138
DataTraceCntrollerMode controllerMode
Definition: DataTrace.hpp:158
Sensed encoder ticks of the joint.
Definition: JointData.hpp:100
JointPWMSetpoint PWMSetpoint
Definition: DataTrace.hpp:144
Set-point velocity of the joint.
Definition: JointData.hpp:182
The torque set-point of the joint will be set by setting the computed current set-point.
Definition: JointData.hpp:218
JointVelocitySetpoint targetVelocity
Definition: DataTrace.hpp:174
JointSensedRoundsPerMinute sensedRoundsPerMinute
Definition: DataTrace.hpp:126
JointSensedCurrent sensedCurrent
Definition: DataTrace.hpp:128
JointAngleSetpoint angleSetpoint
Definition: DataTrace.hpp:134
This torque of the joint is computed from the actual current.
Definition: JointData.hpp:148
Sensed velocity of the joint.
Definition: JointData.hpp:259
std::fstream parametersBeginTraceFile
Definition: DataTrace.hpp:148
JointSensedEncoderTicks sensedEncoderTicks
Definition: DataTrace.hpp:122
JointSensedVelocity sensedVelocity
Definition: DataTrace.hpp:124
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
std::fstream parametersEndTraceFile
Definition: DataTrace.hpp:150
Sensed rounds per minute (rpm) of the joint.
Definition: JointData.hpp:124
Creates a trace of all process data and reads all configuration parameter from one joint...
Definition: DataTrace.hpp:82
JointRampGeneratorVelocity rampGenSetpoint
Definition: DataTrace.hpp:170
Sensed electric current of the joint.
Definition: JointData.hpp:136
JointSensedAngle sensedAngle
Definition: DataTrace.hpp:120
encoder ticks setpoint of the joint
Definition: JointData.hpp:242
std::string path
Definition: DataTrace.hpp:166
std::fstream file
Definition: DataTrace.hpp:132
JointVelocitySetpoint velocitySetpoint
Definition: DataTrace.hpp:136
DataTraceCntrollerMode
Definition: DataTrace.hpp:70
std::vector< YouBotJointParameterReadOnly * > parameterVector
Definition: DataTrace.hpp:162
JointCurrentSetpoint targetCurrent
Definition: DataTrace.hpp:172
Pulse-width modulation set-point of the joint.
Definition: JointData.hpp:230
JointAngleSetpoint targetAngle
Definition: DataTrace.hpp:176
JointEncoderSetpoint encoderSetpoint
Definition: DataTrace.hpp:146
YouBotJoint & joint
Definition: DataTrace.hpp:118
std::string name
Definition: DataTrace.hpp:164
unsigned long timeDurationMicroSec
Definition: DataTrace.hpp:156
JointSensedTorque sensedTorque
Definition: DataTrace.hpp:130
Set-point current of the joint.
Definition: JointData.hpp:206
JointSensedPWM actualPWM
Definition: DataTrace.hpp:160
Sensed position / angle of the joint.
Definition: JointData.hpp:88
Set-point angle / position of the joint.
Definition: JointData.hpp:170
Rounds per minute set-point of the joint.
Definition: JointData.hpp:194
actual pwm value of the joint
Definition: JointData.hpp:76
Sensed velocity of the joint.
Definition: JointData.hpp:112


youbot_driver
Author(s): Jan Paulus
autogenerated on Mon Jun 10 2019 15:46:24