-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update Main.ino #20
Update Main.ino #20
Conversation
100Hz処理でくくって、BME280も追加しました。
Main/Main.ino
Outdated
int phase_now = 0; //現在のフェーズを区別(0=CHEAK,1=READY,2=FLIGHT,3=OPENED) | ||
int Openjudge = 1; //開放禁止コマンド用状態表示用(0=NOT_OPEN,1=OPEN) | ||
double BNO[10]; //BNOデータ取得、格納に用いる | ||
unsigned long time_data = 0; //離床判定タイマー(燃焼終了検知) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Use int16/int64/etc, rather than the C type long [runtime/int] [4]
Main/Main.ino
Outdated
#include<Adafruit_BME280.h> | ||
//1013.25は地球の海面上の大気圧の平均値(1気圧)です。 | ||
#define SEALEVELPRESSURE_HPA (1013.25) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
Main/Main.ino
Outdated
#define SEALEVELPRESSURE_HPA (1013.25) | ||
|
||
Adafruit_BME280 bme; | ||
unsigned long delayTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
Main/Main.ino
Outdated
#define SEALEVELPRESSURE_HPA (1013.25) | ||
|
||
Adafruit_BME280 bme; | ||
unsigned long delayTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Use int16/int64/etc, rather than the C type long [runtime/int] [4]
Main/Main.ino
Outdated
|
||
Adafruit_BME280 bme; | ||
unsigned long delayTime; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
Main/Main.ino
Outdated
status = bme.begin(0x76); | ||
if (!status) { | ||
Serial.println("BME280 sensor"); | ||
while (10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Empty loop bodies should use {} or continue [whitespace/empty_loop_body] [5]
Main/Main.ino
Outdated
} | ||
|
||
// loop()と,ここから呼び出される関数ではdelay()使用禁止 | ||
void loop() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
cpplint
Main/0317mainprogram/utility/imumaths.h|28| Include the directory when naming header files [build/include_subdir] [4]
Main/0317mainprogram/utility/imumaths.h|29| Include the directory when naming header files [build/include_subdir] [4]
Main/0317mainprogram/utility/matrix.h|30| Include the directory when naming header files [build/include_subdir] [4]
Main/0317mainprogram/utility/quaternion.h|32| Include the directory when naming header files [build/include_subdir] [4]
Main/0317mainprogram/utility/quaternion.h|107| Is this a non-const reference? If so, make const or use a pointer: Vector<3> &axis [runtime/references] [2]
Main/0317mainprogram/utility/quaternion.h|107| Is this a non-const reference? If so, make const or use a pointer: double &angle [runtime/references] [2]
Main/0317mainprogram/utility/vector.h|37| Single-parameter constructors should be marked explicit. [runtime/explicit] [5]
Main/Main.ino|61| Use int16/int64/etc, rather than the C type long [runtime/int] [4]
Main/Main.ino|79| Use int16/int64/etc, rather than the C type long [runtime/int] [4]
Main/Main.ino|271| Using C-style cast. Use static_cast(...) instead [readability/casting] [4]
Main/0314mainprogram.ino
Outdated
|
||
Servo myservo; | ||
const int SV_PIN = 7; | ||
unsigned long time_servo_ms = 0; //servoが閉じるのを時間指定するために用いる |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Use int16/int64/etc, rather than the C type long [runtime/int] [4]
Main/0314mainprogram.ino
Outdated
int phase_now = 0; //現在のフェーズを区別(0=CHEAK,1=READY,2=FLIGHT,3=OPENED) | ||
int Openjudge = 1; //開放禁止コマンド用状態表示用(0=NOT_OPEN,1=OPEN) | ||
double BNO[10]; //BNOデータ取得、格納に用いる | ||
unsigned long time_data_ms = 0; //離床判定タイマー(燃焼終了検知) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Use int16/int64/etc, rather than the C type long [runtime/int] [4]
Main/0314mainprogram.ino
Outdated
#define SEALEVELPRESSURE_HPA (1013.25) | ||
|
||
Adafruit_BME280 bme; | ||
unsigned long delayTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Use int16/int64/etc, rather than the C type long [runtime/int] [4]
Main/0314mainprogram.ino
Outdated
} | ||
} | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Could not find a newline character at the end of the file. [whitespace/ending_newline] [5]
int phase_now = 0; //現在のフェーズを区別(0=CHEAK,1=READY,2=FLIGHT,3=OPENED) | ||
int Openjudge = 1; //開放禁止コマンド用状態表示用(0=NOT_OPEN,1=OPEN) | ||
double BNO[10]; //BNOデータ取得、格納に用いる | ||
unsigned long time_data_ms = 0; //離床判定タイマー(燃焼終了検知) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Use int16/int64/etc, rather than the C type long [runtime/int] [4]
/* 1m/s^2 = 100 LSB */ | ||
xyz[0] = ((double)x) / 100.0; | ||
xyz[1] = ((double)y) / 100.0; | ||
xyz[2] = ((double)z) / 100.0; |
There was a problem hiding this comment.
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]
|
||
/* Functions to deal with raw calibration data */ | ||
bool getSensorOffsets(uint8_t *calibData); | ||
bool getSensorOffsets(adafruit_bno055_offsets_t &offsets_type); |
There was a problem hiding this comment.
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: adafruit_bno055_offsets_t &offsets_type [runtime/references] [2]
/* Power managments functions */ | ||
void enterSuspendMode(); | ||
void enterNormalMode(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
bool write8(adafruit_bno055_reg_t, byte value); | ||
|
||
private: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Do not leave a blank line after "private:" [whitespace/blank_line] [3]
#ifndef IMUMATH_H | ||
#define IMUMATH_H | ||
|
||
#include "matrix.h" |
There was a problem hiding this comment.
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]
int phase_now = 0; //現在のフェーズを区別(0=CHEAK,1=READY,2=FLIGHT,3=OPENED) | ||
int Openjudge = 1; //開放禁止コマンド用状態表示用(0=NOT_OPEN,1=OPEN) | ||
double BNO[10]; //BNOデータ取得、格納に用いる | ||
unsigned long time_data_ms = 0; //離床判定タイマー(燃焼終了検知) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Use int16/int64/etc, rather than the C type long [runtime/int] [4]
Adafruit_BME280 bme; | ||
const float SEALEVELPRESSURE_HPA = 1013.25; | ||
unsigned long delayTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Use int16/int64/etc, rather than the C type long [runtime/int] [4]
if (Serial.available()) { | ||
uplink = Serial.readStringUntil('\n'); | ||
char c = (char)Serial.read(); |
There was a problem hiding this comment.
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]
もろもろの修正
Main/Main/Main.ino
Outdated
int phase_now = 0; //現在のフェーズを区別(0=CHEAK,1=READY,2=FLIGHT,3=OPENED) | ||
int Openjudge = 1; //開放禁止コマンド用状態表示用(0=NOT_OPEN,1=OPEN) | ||
double BNO[10]; //BNOデータ取得、格納に用いる | ||
unsigned long time_data_ms = 0; //離床判定タイマー(燃焼終了検知) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Use int16/int64/etc, rather than the C type long [runtime/int] [4]
Main/Main/Main.ino
Outdated
#define SEALEVELPRESSURE_HPA (1013.25) | ||
|
||
Adafruit_BME280 bme; | ||
unsigned long delayTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Use int16/int64/etc, rather than the C type long [runtime/int] [4]
Main/Main/Main.ino
Outdated
// Serial.println(downlink); | ||
// } | ||
if (Serial.available()) { | ||
char c = (char)Serial.read(); |
There was a problem hiding this comment.
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]
Main/Main/Adafruit_BNO055.cpp
Outdated
|
||
/* Reset */ | ||
write8(BNO055_SYS_TRIGGER_ADDR, 0x20); | ||
/* Delay incrased to 30ms due to power issues https://tinyurl.com/y375z699 */ |
There was a problem hiding this comment.
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]
Main/Main/Adafruit_BNO055.cpp
Outdated
switch (vector_type) { | ||
case VECTOR_MAGNETOMETER: | ||
/* 1uT = 16 LSB */ | ||
xyz[0] = ((double)x) / 16.0; |
There was a problem hiding this comment.
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]
Main/Main/Adafruit_BNO055.cpp
Outdated
case VECTOR_MAGNETOMETER: | ||
/* 1uT = 16 LSB */ | ||
xyz[0] = ((double)x) / 16.0; | ||
xyz[1] = ((double)y) / 16.0; |
There was a problem hiding this comment.
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]
Main/Main/Adafruit_BNO055.cpp
Outdated
/* 1uT = 16 LSB */ | ||
xyz[0] = ((double)x) / 16.0; | ||
xyz[1] = ((double)y) / 16.0; | ||
xyz[2] = ((double)z) / 16.0; |
There was a problem hiding this comment.
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]
Main/Main/Adafruit_BNO055.cpp
Outdated
break; | ||
case VECTOR_GYROSCOPE: | ||
/* 1dps = 16 LSB */ | ||
xyz[0] = ((double)x) / 16.0; |
There was a problem hiding this comment.
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]
Main/Main/utility/matrix.h
Outdated
#include <stdint.h> | ||
#include <string.h> | ||
|
||
#include "vector.h" |
There was a problem hiding this comment.
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]
Main/Main/utility/quaternion.h
Outdated
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
#include "matrix.h" |
There was a problem hiding this comment.
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]
Main/Main/utility/quaternion.h
Outdated
} | ||
} | ||
|
||
void toAxisAngle(Vector<3> &axis, double &angle) const { |
There was a problem hiding this comment.
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]
Main/Main/utility/quaternion.h
Outdated
} | ||
} | ||
|
||
void toAxisAngle(Vector<3> &axis, double &angle) const { |
There was a problem hiding this comment.
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]
Main/Main/utility/vector.h
Outdated
public: | ||
Vector() { memset(p_vec, 0, sizeof(double) * N); } | ||
|
||
Vector(double a) { |
There was a problem hiding this comment.
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]
動作検証間に合わなかったのでOpener.hでいく |
100Hz処理でくくって、BME280も追加しました。
概要
mainコード(改良&BME追加)
背景
変更範囲
BMEを追加して、100Hz処理を分割しました。結構全体的に改善しました。