Skip to content

Commit 8e18d22

Browse files
committed
Corrected units for visualization
1 parent 76e1659 commit 8e18d22

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Source/Devices/Bno055.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic
4444
"Eul",
4545
ContinuousChannel::Type::AUX,
4646
eulerAngleScale,
47-
"Degrees",
47+
"Deg.",
4848
{ "Y", "R", "P" },
4949
"euler",
5050
{ "y", "r", "p" },
@@ -62,7 +62,7 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic
6262
"Quat",
6363
ContinuousChannel::Type::AUX,
6464
quaternionScale,
65-
"u", // NB: Quaternion data is unitless by definition
65+
"", // NB: Quaternion data is unitless by definition
6666
{ "W", "X", "Y", "Z" },
6767
"quaternion",
6868
{ "w", "x", "y", "z" },
@@ -116,7 +116,7 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic
116116
"Temp",
117117
ContinuousChannel::Type::AUX,
118118
1.0f,
119-
"Celsius",
119+
String::fromUTF8 ("\xc2\xb0") + String ("C"), // NB: "\xc2\xb0" --> degree symbol
120120
{ "" },
121121
"temperature",
122122
{},

Source/Devices/PolledBno055.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev
4545
"Eul",
4646
ContinuousChannel::Type::AUX,
4747
EulerAngleScale,
48-
"Degrees",
48+
"Deg.",
4949
{ "Y", "R", "P" },
5050
"euler",
5151
{ "y", "r", "p" },
@@ -63,7 +63,7 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev
6363
"Quat",
6464
ContinuousChannel::Type::AUX,
6565
QuaternionScale,
66-
"",
66+
"", // NB: Quaternion data is unitless by definition
6767
{ "W", "X", "Y", "Z" },
6868
"quaternion",
6969
{ "w", "x", "y", "z" },
@@ -81,7 +81,7 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev
8181
"Acc",
8282
ContinuousChannel::Type::AUX,
8383
AccelerationScale,
84-
"m / s ^ 2",
84+
"m/s^2",
8585
{ "X", "Y", "Z" },
8686
"acceleration",
8787
{ "x", "y", "z" },
@@ -117,7 +117,7 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev
117117
"Temp",
118118
ContinuousChannel::Type::AUX,
119119
1.0f,
120-
"Celsius",
120+
String::fromUTF8 ("\xc2\xb0") + String ("C"), // NB: "\xc2\xb0" --> degree symbol
121121
{ "" },
122122
"temperature",
123123
{},

Source/OnixDevice.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct StreamInfo
7171
std::string channelPrefix,
7272
ContinuousChannel::Type channelType,
7373
float bitVolts,
74-
std::string units,
74+
String units,
7575
std::vector<std::string> channelNameSuffixes,
7676
std::string channelIdentifierDataType,
7777
std::vector<std::string> channelIdentifierSubTypes,
@@ -161,7 +161,7 @@ struct StreamInfo
161161
std::string getChannelPrefix() const { return m_channelPrefix; }
162162
ContinuousChannel::Type getChannelType() const { return m_channelType; }
163163
float getBitVolts() const { return m_bitVolts; }
164-
std::string getUnits() const { return m_units; }
164+
String getUnits() const { return m_units; }
165165
std::vector<std::string> getChannelNameSuffixes() const { return m_channelNameSuffixes; }
166166
std::string getChannelIdentifierDataType() const { return m_channelIdentifierDataType; }
167167
std::vector<std::string> getChannelIdentifierSubTypes() const { return m_channelIdentifierSubTypes; }
@@ -176,7 +176,7 @@ struct StreamInfo
176176
std::string m_channelPrefix = "channelPrefix";
177177
ContinuousChannel::Type m_channelType = ContinuousChannel::Type::INVALID;
178178
float m_bitVolts = 1.0f;
179-
std::string m_units = "units";
179+
String m_units = "units";
180180
std::vector<std::string> m_channelNameSuffixes = { "suffixes" };
181181
std::string m_channelIdentifierDataType = "datatype";
182182
std::vector<std::string> m_channelIdentifierSubTypes = { "subtypes" };

0 commit comments

Comments
 (0)