Comments (6)
前提
以下の2つの関数をそのまま利用する。
- drone_physics::acceleration_in_body_frame()
- drone_physics::angular_acceleration_in_body_frame()
from hakoniwa-px4sim.
コード設計
上記どちらの関数も3次元のベクトルなので、3次元ベクトル変換関数(f_vec)と思うことにする。
変数定義
- c_vec:現在の状態
- k1_vec:k2を求めるための状態
- k2_vec:k3を求めるための状態
- k3_vec:k4を求めるための状態
- delta_time:シミュレーション時間精度
- n_vec:次の時間の状態
from hakoniwa-px4sim.
k1
k1 = f_vec(c_vec);
k2
k2_vec = {c_vec.x + 0.5 * k1.x * delta_time, c_vec.y + 0.5 * k1.y * delta_time, c_vec.z + 0.5 * k1.z * delta_time};
k2 = f_vec(k2_vec);
k3
k3_vec = {c_vec.x + 0.5 * k2.x * delta_time, c_vec.y + 0.5 * k2.y * delta_time, c_vec.z + 0.5 * k2.z * delta_time};
k3 = f_vec(k3_vec);
k4
k4_vec = {c_vec.x + k3.x * delta_time, c_vec.y + k3.y * delta_time, c_vec.z + k3.z * delta_time};
k4 = f_vec(k4_vec);
from hakoniwa-px4sim.
次の状態
n_vec = {
c_vec.x + (delta_time / 6.0) * (k1.x + 2 * k2.x + 2 * k3.x + k4.x),
c_vec.y + (delta_time / 6.0) * (k1.y + 2 * k2.y + 2 * k3.y + k4.y),
c_vec.z + (delta_time / 6.0) * (k1.z + 2 * k2.z + 2 * k3.z + k4.z)
};
from hakoniwa-px4sim.
というわけで修正してみます。
from hakoniwa-px4sim.
めちゃくちゃ冗長だけど、やってみた。
from hakoniwa-px4sim.
Related Issues (20)
- 評価関数が期待した値にならないケースがあった
- MATLAB の実装に渡す情報よために、Cインターフェースを作る。 HOT 4
- せっかくなので、C++ vecmath のリポジトリ作る HOT 1
- 1stリリースの残課題
- ubuntu20.04 だと hakoniwa側のbuild.bashでエラーになる
- 最適パラメータチューニング HOT 28
- 機体移動中に、時々、PX4が警告出力する
- ドローンをPS4のコントローラで操作できるようにする HOT 6
- シミュレーションを連続して長時間実行しているとハングアップする場合がある(再現性不明)
- 機体のサイズを変更してみる HOT 28
- シンプル化のリファクタリング <tuple> をやめて,シンプルな struct に変更 HOT 3
- Unityで、オブジェクトが別のオブジェクトに衝突した時に、受ける外力を計算 or 取得可能かどうか調べる HOT 6
- Ground Frame で加速度・角加速度の計算をちゃんとやる HOT 1
- Unityの衝突検出をhakoniwa-px4sim側で受信して、物理側に反映させてみる HOT 18
- 衝突検出はコンフィグで有効・無効化できるようにする
- 地上座標系と機体座標系の物理モデルの実験をやって比較する HOT 21
- ローターとthrusterをjmavsimの実装に合わせてみる HOT 33
- AngularRate対応
- 治った後名前変更
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hakoniwa-px4sim.