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

BNO055のレンジを16Gに変更 #21

Merged
merged 2 commits into from
Feb 18, 2024
Merged

BNO055のレンジを16Gに変更 #21

merged 2 commits into from
Feb 18, 2024

Conversation

771-8bit
Copy link
Member

@771-8bit 771-8bit commented Feb 18, 2024

ライブラリのプライベートな関数を叩かないとどうにもならなかったのでライブラリごと取り込んだ

コードは以下を参考
https://forums.adafruit.com/viewtopic.php?t=85097


/* Reset */
write8(BNO055_SYS_TRIGGER_ADDR, 0x20);
/* Delay incrased to 30ms due to power issues https://tinyurl.com/y375z699 */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Complex multi-line /.../-style comment found. Lint may give bogus warnings. Consider replacing these with //-style comments, with #if 0...#endif, or with more clearly structured multi-line comments. [readability/multiline_comment] [5]

switch (vector_type) {
case VECTOR_MAGNETOMETER:
/* 1uT = 16 LSB */
xyz[0] = ((double)x) / 16.0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Using C-style cast. Use static_cast(...) instead [readability/casting] [4]

case VECTOR_MAGNETOMETER:
/* 1uT = 16 LSB */
xyz[0] = ((double)x) / 16.0;
xyz[1] = ((double)y) / 16.0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Using C-style cast. Use static_cast(...) instead [readability/casting] [4]

/* 1uT = 16 LSB */
xyz[0] = ((double)x) / 16.0;
xyz[1] = ((double)y) / 16.0;
xyz[2] = ((double)z) / 16.0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Using C-style cast. Use static_cast(...) instead [readability/casting] [4]

break;
case VECTOR_GYROSCOPE:
/* 1dps = 16 LSB */
xyz[0] = ((double)x) / 16.0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Using C-style cast. Use static_cast(...) instead [readability/casting] [4]

#include <stdint.h>
#include <string.h>

#include "vector.h"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Include the directory when naming header files [build/include_subdir] [4]

#include <stdlib.h>
#include <string.h>

#include "matrix.h"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Include the directory when naming header files [build/include_subdir] [4]

}
}

void toAxisAngle(Vector<3> &axis, double &angle) const {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Is this a non-const reference? If so, make const or use a pointer: Vector<3> &axis [runtime/references] [2]

}
}

void toAxisAngle(Vector<3> &axis, double &angle) const {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Is this a non-const reference? If so, make const or use a pointer: double &angle [runtime/references] [2]

public:
Vector() { memset(p_vec, 0, sizeof(double) * N); }

Vector(double a) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Single-parameter constructors should be marked explicit. [runtime/explicit] [5]

@771-8bit 771-8bit merged commit a5ea9a1 into main Feb 18, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant