Reading.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <sensor_msgs/Imu.h>
4 #include <geometry_msgs/WrenchStamped.h>
5 #include <sensor_msgs/Temperature.h>
6 
8 #include <boost/math/constants/constants.hpp>
9 
10 namespace rokubimini
11 {
18 static constexpr double G_TO_METERS_PER_SECOND_SQUARED = 9.80665;
19 
26 static constexpr double DEG_TO_RAD = boost::math::constants::pi<double>() / 180;
27 
35 class Reading
36 {
37 public:
38  using ImuType = sensor_msgs::Imu;
39  using WrenchType = geometry_msgs::WrenchStamped;
40  using TempType = sensor_msgs::Temperature;
41 
48  Reading() = default;
49  virtual ~Reading() = default;
50 
58  const ImuType& getImu() const
59  {
60  return imu_;
61  }
62 
71  {
72  return imu_;
73  }
74 
83  const WrenchType& getWrench() const
84  {
85  return wrench_;
86  }
87 
96  {
97  return wrench_;
98  }
99 
107  const ImuType& getExternalImu() const
108  {
109  return externalImu_;
110  }
111 
120  {
121  return externalImu_;
122  }
123 
131  const Statusword& getStatusword() const
132  {
133  return statusword_;
134  }
135 
143  void setStatusword(const Statusword& statusword)
144  {
145  statusword_ = statusword;
146  }
147 
156  {
158  }
159 
168  {
170  }
171 
179  const TempType& getTemperature() const
180  {
181  return temperature_;
182  }
183 
192  {
193  return temperature_;
194  }
195 
203  void setTemperature(const TempType& temperature)
204  {
205  temperature_ = temperature;
206  }
207 
208 protected:
216 
224 
232 
239  bool isForceTorqueSaturated_{ false };
240 
248 
256 };
257 
258 } // namespace rokubimini
sensor_msgs::Temperature TempType
Definition: Reading.hpp:40
sensor_msgs::Imu ImuType
Definition: Reading.hpp:38
const WrenchType & getWrench() const
Gets the wrench variable.
Definition: Reading.hpp:83
ImuType & getImu()
Non-const version of getImu() const. Gets the imu variable.
Definition: Reading.hpp:70
Class representing the readings received from the rokubi mini devices.
Definition: Reading.hpp:35
geometry_msgs::WrenchStamped WrenchType
Definition: Reading.hpp:39
Class representing the different states the communication or the sensors can be in.
Definition: Statusword.hpp:20
Reading()=default
Default constructor.
const ImuType & getExternalImu() const
Gets the externalImu variable.
Definition: Reading.hpp:107
bool isForceTorqueSaturated() const
Gets the isForceTorqueSaturated flag.
Definition: Reading.hpp:155
WrenchType & getWrench()
Non-const version of getWrench() const. Gets the wrench variable.
Definition: Reading.hpp:95
Statusword statusword_
The statusword variable.
Definition: Reading.hpp:255
void setStatusword(const Statusword &statusword)
Sets the statusword variable.
Definition: Reading.hpp:143
bool isForceTorqueSaturated_
The isForceTorqueSaturated variable.
Definition: Reading.hpp:239
void setForceTorqueSaturated(const bool isForceTorqueSaturated)
Sets the isForceTorqueSaturated variable.
Definition: Reading.hpp:167
TempType & getTemperature()
Definition: Reading.hpp:191
ImuType & getExternalImu()
Non-const version of getExternalImu() const. Gets the externalImu variable.
Definition: Reading.hpp:119
void setTemperature(const TempType &temperature)
Sets the temperature variable.
Definition: Reading.hpp:203
static constexpr double G_TO_METERS_PER_SECOND_SQUARED
g to m/s^2 abbreviation for convenience.
Definition: Reading.hpp:18
ImuType externalImu_
The externalImu variable.
Definition: Reading.hpp:231
const Statusword & getStatusword() const
Gets the statusword variable.
Definition: Reading.hpp:131
WrenchType wrench_
The wrench variable.
Definition: Reading.hpp:223
TempType temperature_
The temperature variable.
Definition: Reading.hpp:247
const TempType & getTemperature() const
Gets the temperature flag.
Definition: Reading.hpp:179
virtual ~Reading()=default
ImuType imu_
The imu variable.
Definition: Reading.hpp:215
const ImuType & getImu() const
Gets the imu variable.
Definition: Reading.hpp:58
Tests Configuration.
static constexpr double DEG_TO_RAD
degrees to rad abbreviation for convenience.
Definition: Reading.hpp:26


rokubimini
Author(s):
autogenerated on Wed Mar 3 2021 03:09:12