More Related Content
PDF
iTamabi 13 第6回:ARTSAT API 実践 1 Web APIから情報を取得する PDF
Interactive Music II SuperCollider入門 4 - 楽器を定義、変調合成(RM, AM, FM) PDF
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得 PDF
iTamabi 13 第7回:ARTSAT API 実践 2 衛星の情報で表現する PDF
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する PDF
PDF
iTamabi 13 第5回:ARTSAT API 導入 PDF
What's hot
PDF
QgisとRで野生動物の追跡結果を解析してみよう PDF
iTamabi iPhoneアプリ実践開発講座2 - 時計アプリをつくる PDF
openFrameworks基礎 たくさんの図形を動かす 静的配列と動的配列 - 芸大グラフィックスプログラミング演習B PDF
PDF
デジタルアートセミナー#2 openFrameworksで学ぶ、 クリエイティブ・コーディング Session 2: 構造をつくる PDF
PDF
PDF
PDF
Interactive Music II Processingによるアニメーション Viewers also liked
PDF
Media Art II 2013 第7回 : openFrameworks 3Dグラフィクス、OpenGL PDF
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII PDF
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング PDF
Interactive Music II ProcessingとSuperColliderの連携1 PDF
openFrameworks 外部ファイルを利用する - 画像、動画 - 多摩美メディアアートII PDF
Media Art II openFrameworks 複数のシーンの管理・切替え PDF
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control) PDF
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携 PDF
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望 PDF
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1 PDF
PDF
Interactive Music II ProcessingとSuperColliderの連携 -2 PDF
coma Creators session vol.2 PDF
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス PDF
PDF
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2 PDF
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う PDF
Interactive Music II Processing基本 PDF
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ More from Atsushi Tadokoro
PDF
Interactive Music II SuperCollider入門 5 時間構造をつくる PDF
Media Art II 2013 第6回:openFrameworks Addonを使う 2 - ofxOpenCV と ofxCv PDF
Interactive Music II SuperCollider入門 3 - 音を混ぜる(Mix)、楽器を定義(SynthDef) PDF
メディア芸術基礎 II Canvas + Javascriptで図形を描く PDF
Interactive Music II SuperCollider実習 オリジナルの楽器を作ろう! PDF
Recently uploaded
PDF
20260119_VIoTLT_vol22_kitazaki_v1___.pdf PDF
自転車ユーザ参加型路面画像センシングによる点字ブロック検出における性能向上方法の模索 (20260123 SeMI研) PDF
TomokaEdakawa_職種と講義の関係推定に基づく履修支援システムの基礎検討_HCI2026 PDF
maisugimoto_曖昧さを含む仕様書の改善を目的としたアノテーション支援ツールの検討_HCI2025.pdf PDF
ST2024_PM1_2_Case_study_of_local_newspaper_company.pdf PDF
Team Topology Adaptive Organizational Design for Rapid Delivery of Valuable S... iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
人工衛星の軌道要素
‣ 人工衛星の軌道要素
‣ 元期:Epoch(年と日)
‣ 平均運動(m): Mean Motion(周回/日)
‣ 離心率(e): Eccentricity(単位無し)
‣ 軌道傾斜角(i): Inclination(度)
‣ 昇交点赤経(Ω): RAAN (Right Ascension of Ascending Node)
(度)
‣ 近地点離角(ω): Argument of Perigee(度)
‣ 平均近点角(M): Mean Anomaly(度)
!
‣ つまりは… 非常に複雑!!
- 12.
TLE(Two Line Element)- 2行軌道要素形式
‣ TLE(Two Line Element) - 2行軌道要素形式
!
‣ 軌道要素は変動するため定期的な更新が必要
‣ 人工衛星の運用にあたっては軌道の測定が重要
‣ アメリカ合衆国のNORAD(※)は定期的に大きさ10cm以上の人
工天体のレーダー観測を行って軌道を測定し、公開している
‣ このフォーマットはTLE(Two Line Element)と呼ばれる
!
‣ ※ NORAD - 北アメリカ航空宇宙防衛司令部
- 13.
- 14.
TLE(Two Line Element)- 2行軌道要素形式
‣ 実際のTLEの例
NOAA 14
1 23455U 94089A
97320.90946019 .00000140 00000-0 10191-3 0 2621
2 23455 99.0090 272.6745 0008546 223.1686 136.8816 14.11711747148495
!
MIDORI (ADEOS)
1 24277U 96046A
2 24277 98.3597
!
09116.47337938 -.00000023 00000-0 73445-5 0
432
83.2073 0002090 64.7512 295.3886 14.28595439661547
ORBCOMM FM08 [+]
1 25112U 97084A
09116.51259343 .00000203 00000-0 12112-3 0 2154
2 25112 45.0199 241.1109 0010042 194.4473 165.6089 14.34380830592834
- 15.
- 16.
- 17.
ARTSAT API +ofxSGPで衛星軌道を取得 1
‣ TLEおよびSGPを用いた軌道の推定を、自力でコーディングす
るのはかなり大変!!
‣ ARTSAT APIでは、SGPを使用した軌道推定の機能もインクルー
ドされている
- 18.
ARTSAT API +ofxSGPで衛星軌道を取得 1
‣ ofxSgp - SGPを利用した軌道の計算を行う
!
‣ 例えば、ofxSgpのインスタンスをsgpとすると
!
‣ sgp.update(&現在の時刻)
‣ 軌道計算のための時間を更新
!
‣ sgp.getPos()
‣ 現在の衛星軌道の座標(ofVec3f)を返す
- 19.
ARTSAT API +ofxSGPで衛星軌道を取得 1
‣ では、ofxSgpを活用して、まずはシンプルに現在の時刻のPRISM
衛星の座標を取得してみましょう!
- 20.
ARTSAT API +ofxSGPで衛星軌道を取得 1
‣ testApp.h
#pragma once
!
#include
#include
#include
#include
#include
!
"ofMain.h"
"ofxiOS.h"
"ofxiOSExtras.h"
"ofxARTSATAPI.h"
"ofxSgp.h"
class testApp : public ofxiOSApp, private ofxSAT::Notifier {
public:
void
void
void
void
!
setup();
update();
draw();
exit();
… (中略)…
!
};
virtual void onNotifyTLE(ofxSAT::TLERec const& tle, ofxSATTime const& time);
virtual void onNotifyData(ofxSATTime const& time);
ofxInvaderSAT invader;
ofxSgp sgp;
ofxSATTime current;
ofVec3f position;
- 21.
ARTSAT API +ofxSGPで衛星軌道を取得 1
‣ testApp.mm
#include "testApp.h"
!
void testApp::setup(){
// 画面設定
ofBackground(0);
ofSetFrameRate(30);
// INVADERのセットアップ
if (invader.setNotifier(this) == SATERROR_OK) {
if (invader.setup() == SATERROR_OK) {
cout << "Hello ARTSAT." << endl;
}
}
}
!
void testApp::update(){
// 現在の時刻を取得
current = ofxSATTime::currentTime();
// SGPに時間を設定
sgp.update(¤t);
// 現在のPRISM衛星の3D座標を算出
position = sgp.getPos();
}
- 22.
ARTSAT API +ofxSGPで衛星軌道を取得 1
‣ testApp.mm
void testApp::draw(){
// 現在の衛星の座標を表示
ofSetHexColor(0xffffff);
string curretTimeStr = current.format("%YYYY/%MM/%DD %hh:%mm:%ss");
ofDrawBitmapString(curretTimeStr, 10, 15);
ofDrawBitmapString("x = " + ofToString(position.x, 4) + "n"
+ "y = " + ofToString(position.y, 4) + "n"
+ "z = " + ofToString(position.z, 4), 10, 50);
}
!
- 23.
ARTSAT API +ofxSGPで衛星軌道を取得 1
‣ testApp.mm
void testApp::onNotifyTLE(ofxSAT::TLERec const& tle, ofxSATTime const& time){
// 取得したTLEをファイルに保存
!
!
string name;
string path;
ofstream file;
name = invader.getID();
ofStringReplace(name, "://", "");
path = ofToDataPath("");
path = ofFilePath::join(ofFilePath::getEnclosingDirectory(path), "Library");
path = ofFilePath::join(path, name + ".txt");
file.open(path.c_str());
if (file.is_open()) {
file << name << endl;
file << tle.line[0] << endl;
file << tle.line[1] << endl;
file.close();
// SGPをセットアップ
sgp.setup(path.c_str());
}
}
- 24.
- 25.
ARTSAT API +ofxSGPで衛星軌道を取得 2
‣ では、取得したデータもとに実際に3D空間に描画してみましょ
う!
- 26.
ARTSAT API +ofxSGPで衛星軌道を取得 2
‣ testApp.h
#pragma once
!
#include
#include
#include
#include
#include
!
"ofMain.h"
"ofxiOS.h"
"ofxiOSExtras.h"
"ofxARTSATAPI.h"
"ofxSgp.h"
class testApp : public ofxiOSApp, private ofxSAT::Notifier {
public:
void setup();
void update();
void draw();
!
… (中略) …
!
};
virtual void onNotifyTLE(ofxSAT::TLERec const& tle, ofxSATTime const& time);
virtual void onNotifyData(ofxSATTime const& time);
ofxInvaderSAT invader;
ofxSgp sgp;
std::vector<ofxSATTime> available;
ofEasyCam camera;
ofxSATTime epoch;
ofxSATTime current;
ofBoxPrimitive box;
static const int TIME_SCALE = 100;
- 27.
ARTSAT API +ofxSGPで衛星軌道を取得 2
‣ testApp.mm
#include "testApp.h"
!
void testApp::setup(){
// 画面設定
ofBackground(0);
ofSetFrameRate(30);
// INVADERのセットアップ
if (invader.setNotifier(this) == SATERROR_OK) {
if (invader.setup() == SATERROR_OK) {
cout << "Hello ARTSAT." << endl;
}
}
// カメラ設定
camera.setFov(45);
camera.setFarClip(100000);
camera.setDistance(30000);
// 時間設定
epoch = ofxSATTime::currentTime();
current = epoch;
// 衛星設定
}
box.set(500);
!
void testApp::update(){
current = epoch + ofxSATTimeDiff(ofGetElapsedTimef() * TIME_SCALE);
sgp.update(¤t);
// 衛星の位置を設定
}
box.setPosition(sgp.getPos());
- 28.
ARTSAT API +ofxSGPで衛星軌道を取得 2
‣ testApp.mm
void testApp::update(){
current = epoch + ofxSATTimeDiff(ofGetElapsedTimef() * TIME_SCALE);
sgp.update(¤t);
// 衛星の位置を設定
box.setPosition(sgp.getPos());
}
!
void testApp::draw(){
camera.begin();
!
// 衛星を描画
ofSetColor(255);
box.draw();
camera.end();
}
- 29.
ARTSAT API +ofxSGPで衛星軌道を取得 1
‣ testApp.mm
void testApp::onNotifyTLE(ofxSAT::TLERec const& tle, ofxSATTime const& time){
// 取得したTLEをファイルに保存
!
!
string name;
string path;
ofstream file;
name = invader.getID();
ofStringReplace(name, "://", "");
path = ofToDataPath("");
path = ofFilePath::join(ofFilePath::getEnclosingDirectory(path), "Library");
path = ofFilePath::join(path, name + ".txt");
file.open(path.c_str());
if (file.is_open()) {
file << name << endl;
file << tle.line[0] << endl;
file << tle.line[1] << endl;
file.close();
// SGPをセットアップ
sgp.setup(path.c_str());
}
}
- 30.
- 31.
ARTSAT API +ofxSGPで衛星軌道を取得 3
‣ 衛星の点が表示されるだけでは、よくわからない
‣ 地球を実際のスケールで描いてみる
‣ 地球の赤道半径、6378km
‣ 6378kmの球を描けばよい
- 32.
ARTSAT API +ofxSGPで衛星軌道を取得 3
‣ testApp.h
#pragma once
!
#include
#include
#include
#include
#include
!
"ofMain.h"
"ofxiOS.h"
"ofxiOSExtras.h"
"ofxARTSATAPI.h"
"ofxSgp.h"
class testApp : public ofxiOSApp, private ofxSAT::Notifier {
public:
void setup();
void update();
!
… (中略) …
!
};
virtual void onNotifyTLE(ofxSAT::TLERec const& tle, ofxSATTime const& time);
virtual void onNotifyData(ofxSATTime const& time);
ofxInvaderSAT invader;
ofxSgp sgp;
std::vector<ofxSATTime> available;
ofEasyCam camera;
ofxSATTime epoch;
ofxSATTime current;
ofBoxPrimitive box;
ofSpherePrimitive earth;
static const int EARTH_SIZE = 6378;
static const int TIME_SCALE = 100;
- 33.
ARTSAT API +ofxSGPで衛星軌道を取得 1
‣ testApp.mm
#include "testApp.h"
!
void testApp::setup(){
// 画面設定
ofBackground(0);
ofSetFrameRate(30);
// INVADERのセットアップ
if (invader.setNotifier(this) == SATERROR_OK) {
if (invader.setup() == SATERROR_OK) {
cout << "Hello ARTSAT." << endl;
}
}
// カメラ設定
camera.setFov(45);
camera.setFarClip(100000);
camera.setDistance(30000);
// 時間設定
epoch = ofxSATTime::currentTime();
current = epoch;
// 衛星設定
}
box.set(500);
- 34.
ARTSAT API +ofxSGPで衛星軌道を取得 1
‣ testApp.mm
void testApp::update(){
current = epoch + ofxSATTimeDiff(ofGetElapsedTimef() * TIME_SCALE);
sgp.update(¤t);
// 衛星の位置を設定
}
box.setPosition(sgp.getPos());
!
void testApp::draw(){
camera.begin();
// 地球を描画
ofSetColor(0, 127, 255);
earth.setRadius(EARTH_SIZE);
earth.setPosition(0, 0, 0);
earth.drawWireframe();
// 衛星を描画
ofSetColor(255);
box.draw();
}
!
camera.end();
… (後略) …
- 35.
- 36.
ARTSAT API +ofxSGPで衛星軌道を取得 4
‣ さらに、いろいろ工夫してみる
!
‣ 時間の経過スピードを変えてみる (例:60倍速)
‣ 指定した過去から始める
!
‣ 軌道を線で描く
- 37.
ARTSAT API +ofxSGPで衛星軌道を取得 4
‣ testApp.h
#pragma once
!
#include
#include
#include
#include
#include
!
"ofMain.h"
"ofxiOS.h"
"ofxiOSExtras.h"
"ofxARTSATAPI.h"
"ofxSgp.h"
class testApp : public ofxiOSApp, private ofxSAT::Notifier {
public:
void setup();
… (中略) …
!
};
virtual void onNotifyTLE(ofxSAT::TLERec const& tle, ofxSATTime const& time);
virtual void onNotifyData(ofxSATTime const& time);
ofxInvaderSAT invader;
ofxSgp sgp;
std::vector<ofxSATTime> available;
ofEasyCam camera;
ofxSATTime epoch;
ofxSATTime current;
ofBoxPrimitive box;
ofSpherePrimitive earth;
ofImage earthTexture;
ofMesh orbit;
static const int EARTH_SIZE = 6378;
static const int TIME_SCALE = 100;
- 38.
ARTSAT API +ofxSGPで衛星軌道を取得 4
‣ testApp.mm
#include "testApp.h"
!
void testApp::setup(){
// 画面設定
ofBackground(0);
ofSetFrameRate(30);
// INVADERのセットアップ
if (invader.setNotifier(this) == SATERROR_OK) {
if (invader.setup() == SATERROR_OK) {
cout << "Hello ARTSAT." << endl;
}
}
// カメラ設定
camera.setFov(45);
camera.setFarClip(100000);
camera.setDistance(30000);
// 時間設定
epoch = ofxSATTime::currentTime();
current = epoch;
// 衛星の大きさ設定
box.set(500);
// 軌道の描画モード設定
orbit.setMode(OF_PRIMITIVE_LINE_STRIP);
}
- 39.
ARTSAT API +ofxSGPで衛星軌道を取得 4
‣ testApp.mm
void testApp::update(){
current = epoch + ofxSATTimeDiff(ofGetElapsedTimef() * TIME_SCALE);
sgp.update(¤t);
// 衛星の位置を設定
}
box.setPosition(sgp.getPos());
orbit.addVertex(sgp.getPos());
orbit.addColor(ofFloatColor(1.0,1.0,0.0));
!
void testApp::draw(){
camera.begin();
// Zバッファー
ofEnableDepthTest();
// 地球を描画
ofSetColor(0, 0, 255);
earth.setRadius(EARTH_SIZE);
earth.drawWireframe();
// 衛星を描画
ofSetColor(255);
box.draw();
// 軌道を描画
orbit.draw();
}
ofDisableDepthTest();
camera.end();
- 40.