質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.47%
GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

関数

関数(ファンクション・メソッド・サブルーチンとも呼ばれる)は、はプログラムのコードの一部であり、ある特定のタスクを処理するように設計されたものです。

Arduino

Arduinoは、AVRマイコン、単純なI/O(入出力)ポートを備えた基板、C言語を元としたArduinoのプログラム言語と、それを実装した統合開発環境から構成されたシステムです。

Q&A

解決済

1回答

2030閲覧

Madgwickライブラリが動かせません

mast008

総合スコア1

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

関数

関数(ファンクション・メソッド・サブルーチンとも呼ばれる)は、はプログラムのコードの一部であり、ある特定のタスクを処理するように設計されたものです。

Arduino

Arduinoは、AVRマイコン、単純なI/O(入出力)ポートを備えた基板、C言語を元としたArduinoのプログラム言語と、それを実装した統合開発環境から構成されたシステムです。

0グッド

0クリップ

投稿2020/11/12 12:52

前提・実現したいこと

Arduino初心者です。Arduino及びESP32でラジコン飛行機の制御をするためにMadgwickAHRSのライブラリを
GitHubよりダウンロードして使おうと思ったのですが、ファイルが見つからないエラー(?)が起きてしまいコンパイルが通せませんでした。これは何かほかのファイルをダウンロードする必要があるのでしょうか?それともほかの問題があるのでしょうか?

よろしくお願いします。

発生している問題・エラーメッセージ

ライブラリのexamplesのプログラムでエラーが起きる

Visualize101:1:22: error: CurieIMU.h: No such file or directory compilation terminated. exit status 1 CurieIMU.h: No such file or directory

該当のソースコード

Arduino

1#include <CurieIMU.h> 2#include <MadgwickAHRS.h> 3 4Madgwick filter; 5unsigned long microsPerReading, microsPrevious; 6float accelScale, gyroScale; 7 8void setup() { 9 Serial.begin(9600); 10 11 // start the IMU and filter 12 CurieIMU.begin(); 13 CurieIMU.setGyroRate(25); 14 CurieIMU.setAccelerometerRate(25); 15 filter.begin(25); 16 17 // Set the accelerometer range to 2G 18 CurieIMU.setAccelerometerRange(2); 19 // Set the gyroscope range to 250 degrees/second 20 CurieIMU.setGyroRange(250); 21 22 // initialize variables to pace updates to correct rate 23 microsPerReading = 1000000 / 25; 24 microsPrevious = micros(); 25} 26 27void loop() { 28 int aix, aiy, aiz; 29 int gix, giy, giz; 30 float ax, ay, az; 31 float gx, gy, gz; 32 float roll, pitch, heading; 33 unsigned long microsNow; 34 35 // check if it's time to read data and update the filter 36 microsNow = micros(); 37 if (microsNow - microsPrevious >= microsPerReading) { 38 39 // read raw data from CurieIMU 40 CurieIMU.readMotionSensor(aix, aiy, aiz, gix, giy, giz); 41 42 // convert from raw data to gravity and degrees/second units 43 ax = convertRawAcceleration(aix); 44 ay = convertRawAcceleration(aiy); 45 az = convertRawAcceleration(aiz); 46 gx = convertRawGyro(gix); 47 gy = convertRawGyro(giy); 48 gz = convertRawGyro(giz); 49 50 51 // update the filter, which computes orientation 52 filter.updateIMU(gx, gy, gz, ax, ay, az); 53 54 // print the heading, pitch and roll 55 roll = filter.getRoll(); 56 pitch = filter.getPitch(); 57 heading = filter.getYaw(); 58 Serial.print("Orientation: "); 59 Serial.print(heading); 60 Serial.print(" "); 61 Serial.print(pitch); 62 Serial.print(" "); 63 Serial.println(roll); 64 65 // increment previous time, so we keep proper pace 66 microsPrevious = microsPrevious + microsPerReading; 67 } 68} 69 70float convertRawAcceleration(int aRaw) { 71 // since we are using 2G range 72 // -2g maps to a raw value of -32768 73 // +2g maps to a raw value of 32767 74 75 float a = (aRaw * 2.0) / 32768.0; 76 return a; 77} 78 79float convertRawGyro(int gRaw) { 80 // since we are using 250 degrees/seconds range 81 // -250 maps to a raw value of -32768 82 // +250 maps to a raw value of 32767 83 84 float g = (gRaw * 250.0) / 32768.0; 85 return g; 86}

試したこと

githubから何回かライブラリを入れなおしてみましたが効果ありませんでした。
他にもMadgwickライブラリを使用している方で同様のエラーは見つけられませんでした。

補足情報(FW/ツールのバージョンなど)

version,Arduino1.8.9
ボード,ESP32Dev Module

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

MadgwickAHRSのライブラリ

ってのはこれ のことでいいのかしら?

で、examples/Visualize101ってのは、いまは亡きArduino101用のサンプルではないでしょうか。
Arduino 101 CurieIMU Gyro

投稿2020/11/14 23:30

thkana

総合スコア7639

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

mast008

2020/11/15 13:24

Arduino101専用だったんですね...種類ごとに使える使えないがあるってのも初めて知りました。 回答ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.47%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問