Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AE-106] .toString() values from the SensorQuaternion class always returns zero #107

Open
aliphys opened this issue Jun 14, 2023 · 0 comments
Labels
type: imperfection Perceived defect in any part of project

Comments

@aliphys
Copy link
Contributor

aliphys commented Jun 14, 2023

Description of defect

.toString()values from the SensorQuaternion class always returns zero. Even after 10 minutes have passed.

String toString()
{
return _data.toString();
}

Split from #82

Target(s) affected by this defect ?

Nicla Sense ME

Toolchain(s) (name and version) displaying this defect ?

Version: 2.0.4
Date: 2023-02-27T16:14:28.576Z
CLI Version: 0.31.0

Copyright © 2023 Arduino SA

What version of Mbed-os are you using (tag or sha) ?

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

ArduinoBLE 1.3.3
Arduino_BHY2 1.0.6
Firmware of Nicla Sense Flashed (see this comment)

How is this defect reproduced ?

Run this sketch, which is modified from the Standalone.ino sketch


/* 
 * This sketch shows how nicla can be used in standalone mode.
 * Without the need for an host, nicla can run sketches that 
 * are able to configure the bhi sensors and are able to read all 
 * the bhi sensors data.
*/

#include "Arduino_BHY2.h"

SensorXYZ accel(SENSOR_ID_ACC);
SensorXYZ gyro(SENSOR_ID_GYRO);
Sensor temp(SENSOR_ID_TEMP);
Sensor gas(SENSOR_ID_GAS);
SensorQuaternion rotation(SENSOR_ID_RV);
SensorBSEC bsec(SENSOR_ID_BSEC);

void setup()
{
  Serial.begin(115200);
  while(!Serial);

  BHY2.begin();

  accel.begin();
  gyro.begin();
  temp.begin();
  gas.begin();
  bsec.begin();
  rotation.begin();
  delay(3000); # 3 second delay, before starting loop
}

void loop()
{
  static auto printTime = millis();

  // Update function should be continuously polled
  BHY2.update();

  if (millis() - printTime >= 1000) {
    printTime = millis();

    Serial.println(String("acceleration: ") + accel.toString());
    Serial.println(String("gyroscope: ") + gyro.toString());
    Serial.println(String("temperature: ") + String(temp.value(),3));

    # remove decimalPlaces agrument in String function
    Serial.println(String("gas: ") + String(gas.value()));
    Serial.println(String("co2: ") + String(bsec.co2_eq()));
    Serial.println(String("iaq: ") + String(bsec.iaq()));

    Serial.println(String("rotation: ") + rotation.toString());
  }
}


Output

acceleration: XYZ values - X: 390   Y: -971   Z: -3929

gyroscope: XYZ values - X: 0   Y: -2   Z: -2

temperature: 30.430
gas: 22369.00
co2: 502
iaq: 26
rotation: Quaternion values - X: 0.000   Y: 0.000   Z: 0.000   W: 0.000   Accuracy: 0.000


@aliphys aliphys changed the title [AE-13] .toString() values from the SensorQuaternion class always returns zero [AE-106] .toString() values from the SensorQuaternion class always returns zero Jun 14, 2023
@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants