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
rokubimini::Reading::getTemperature
const TempType & getTemperature() const
Gets the temperature flag.
Definition: Reading.hpp:179
rokubimini::Reading::isForceTorqueSaturated
bool isForceTorqueSaturated() const
Gets the isForceTorqueSaturated flag.
Definition: Reading.hpp:155
rokubimini::G_TO_METERS_PER_SECOND_SQUARED
static constexpr double G_TO_METERS_PER_SECOND_SQUARED
g to m/s^2 abbreviation for convenience.
Definition: Reading.hpp:18
rokubimini::Reading::~Reading
virtual ~Reading()=default
rokubimini::Reading::getExternalImu
ImuType & getExternalImu()
Definition: Reading.hpp:119
Statusword.hpp
rokubimini::Reading::setStatusword
void setStatusword(const Statusword &statusword)
Sets the statusword variable.
Definition: Reading.hpp:143
rokubimini::Reading::setForceTorqueSaturated
void setForceTorqueSaturated(const bool isForceTorqueSaturated)
Sets the isForceTorqueSaturated variable.
Definition: Reading.hpp:167
rokubimini::Reading::getImu
const ImuType & getImu() const
Gets the imu variable.
Definition: Reading.hpp:58
rokubimini::Reading::getWrench
const WrenchType & getWrench() const
Gets the wrench variable.
Definition: Reading.hpp:83
rokubimini::Reading::getStatusword
const Statusword & getStatusword() const
Gets the statusword variable.
Definition: Reading.hpp:131
rokubimini::Reading::getTemperature
TempType & getTemperature()
Definition: Reading.hpp:191
rokubimini::Reading::TempType
sensor_msgs::Temperature TempType
Definition: Reading.hpp:40
rokubimini::Reading
Class representing the readings received from the rokubi mini devices.
Definition: Reading.hpp:35
rokubimini::Reading::imu_
ImuType imu_
The imu variable.
Definition: Reading.hpp:215
rokubimini::Reading::getImu
ImuType & getImu()
Definition: Reading.hpp:70
rokubimini::Reading::getWrench
WrenchType & getWrench()
Definition: Reading.hpp:95
rokubimini
Tests Configuration.
Definition: ForceTorqueCalibration.hpp:5
rokubimini::Reading::temperature_
TempType temperature_
The temperature variable.
Definition: Reading.hpp:247
rokubimini::Reading::setTemperature
void setTemperature(const TempType &temperature)
Sets the temperature variable.
Definition: Reading.hpp:203
rokubimini::Reading::wrench_
WrenchType wrench_
The wrench variable.
Definition: Reading.hpp:223
rokubimini::Reading::Reading
Reading()=default
Default constructor.
rokubimini::Reading::isForceTorqueSaturated_
bool isForceTorqueSaturated_
The isForceTorqueSaturated variable.
Definition: Reading.hpp:239
rokubimini::Reading::WrenchType
geometry_msgs::WrenchStamped WrenchType
Definition: Reading.hpp:39
rokubimini::DEG_TO_RAD
static constexpr double DEG_TO_RAD
degrees to rad abbreviation for convenience.
Definition: Reading.hpp:26
rokubimini::Reading::ImuType
sensor_msgs::Imu ImuType
Definition: Reading.hpp:38
rokubimini::Reading::externalImu_
ImuType externalImu_
The externalImu variable.
Definition: Reading.hpp:231
rokubimini::Reading::getExternalImu
const ImuType & getExternalImu() const
Gets the externalImu variable.
Definition: Reading.hpp:107
rokubimini::Statusword
Class representing the different states the communication or the sensors can be in.
Definition: Statusword.hpp:20
rokubimini::Reading::statusword_
Statusword statusword_
The statusword variable.
Definition: Reading.hpp:255


rokubimini
Author(s):
autogenerated on Sat Apr 15 2023 02:53:52