Skip to content

Topic一覧 ​

Topicは、操作中の機体に属するものを/ksp_vessel、bridgeプロセス自身に属するものを/pylonへ分けています。表の方向はROS2ノードから見た方向です。

型名はROS 2のパッケージ/msg/型名形式で記載しています。型のリンクからフィールド・定数・元の定義へ辿れます。独自型の全一覧はメッセージ・サービス型を参照してください。

Bridge ​

方向Topic型QoS / 内容
Publish/pylon/statusstd_msgs/msg/StringReliable / Transient Local。bridgeの稼働状態
Publish/pylon/diagnosticsdiagnostic_msgs/msg/DiagnosticArrayモーター診断とWrench配分残差

IMU ​

センサーtimestampの間隔はKSPの物理時間を保持します。通信遅延やゲームの描画速度に合わせて飛行中にoffsetを飛ばしません。lifecycleはセンサーと独立したセッションheartbeatから生成します。udp_bridge --disable-ground-truthでは真値Topicとworld TFの配信を完全に無効化できます。このモードのVesselLifecycle.world_frameは空です。runtime_instance・runtime_epoch・runtime_generationがKSP側のセッションを表し、generationとorigin_sequenceは機体切替・時刻巻き戻り・セッションtimeoutからの復帰時に更新されるROS側の世代番号です。

全機体で追加パーツ・設定なしに、操作中の機体の3軸ジャイロと3軸加速度計を出力します。機体切替時も同じTopicを使用します。

方向Topic型QoS / 内容
Publish/ksp_vessel/imu/data_rawsensor_msgs/msg/ImuBest Effort / Volatile / depth 10。物理サンプル更新時、最大30 Hz

header.frame_id=base_link、軸はX前方・Y左・Z上。angular_velocity は慣性系に対するrad/s(KSPの回転物理座標系では惑星の自転分を加算)、linear_acceleration はm/s²の比力(慣性加速度−重力)です。Z上向きで静止していれば約+g、自由落下中は約0となります。KSPの perturbation_immediate を機体軸へ変換し、ノイズやバイアスは追加しません。絶対姿勢は測定しないため orientation_covariance[0]=-1、角速度・加速度の共分散は未知を表す全要素0です。ROS IMU規約(REP-145) の imu/data_raw に対応します。

タイムスタンプはKSPのシミュレーション時刻を既存bridge時計に写像します。Flight以外、物理演算停止(packed)、ポーズ中は新規測定を出力しません。ロード・機体切替・unpack直後は1サンプル待ちます。仮想センサーは機体重心の比力を機体軸で表すもので、個別パーツ位置の回転による加速度はモデル化しません。非アクティブ機体の個別Topicは作成しません。

スタートラッカー ​

方向Topic型内容
Publish/ksp_vessel/star_tracker/<id>/statepylon_interfaces/msg/StarTrackerState姿勢・共分散・valid・測定不能理由を同時配信
Publish/ksp_vessel/star_tracker/<id>/attitudegeometry_msgs/msg/QuaternionStamped有効な慣性姿勢のみ

専用パーツを取り付けると既定5 Hz、Reliable / Volatile / depth 10で配信します。位置は測定しません。state.valid=false時はquaternionが全0、共分散先頭が−1です。通信断でもstale状態を通知します。座標・制約・再捕捉・Topicの寿命はスタートラッカーを参照してください。

機体・モデル ​

方向Topic型QoS / 内容
Publish/ksp_vessel/simulator/statepylon_interfaces/msg/SimulatorStateReliable / Transient Local。pause・warp・packed・通信とUT進行
Publish/ksp_vessel/simulator/universal_timestd_msgs/msg/Float64KSP UT [s]。Reliable / Transient Local。pause中は同じ値、巻き戻り時は減少
Subscribe/ksp_vessel/control/batchpylon_interfaces/msg/ControlBatchReliable。更新→姿勢→推力→分離を順序付きで送信
Publish/ksp_vessel/control/snapshotpylon_interfaces/msg/ControlSnapshotReliable。同一frameの飛行・全エンジン・分離器。真値無効時は配信しない
Publish/ksp_vessel/health/powerpylon_interfaces/msg/VehicleHealth電力残量・容量・品質付き収支推定、2 Hz
Publish/ksp_vessel/health/thermalpylon_interfaces/msg/PartThermalStateパーツ別温度・上限・遮蔽・電力、2 Hz
Publish/ksp_vessel/lifecyclepylon_interfaces/msg/VesselLifecycleReliable / Transient Local。実機体IDとframe lifecycle
Subscribe/ksp_vessel/control/authority/commandpylon_interfaces/msg/ControlAuthorityCommandReliable。lease・SAS排他・e-stop
Publish/ksp_vessel/control/authority/statepylon_interfaces/msg/ControlAuthorityStateReliable / Transient Local。確定したowner
Subscribe/ksp_vessel/control/wrench_commandpylon_interfaces/msg/BodyWrenchCommandReliable。lease-bound base_link Wrench
Subscribe/ksp_vessel/control/flight_commandpylon_interfaces/msg/FlightControlCommandReliable。lease付きstock操舵入力・着陸脚
Publish/ksp_vessel/ground_truth/flightpylon_interfaces/msg/FlightStateBest Effort。高度・軌道・燃料・接地状態とbody-frame地表軸。Ground Truth無効時は配信しない
Publish/ksp_vessel/control/wrench_feedbackpylon_interfaces/msg/WrenchFeedbackrequested / allocated / achieved / residual
Publish/ksp_vessel/ground_truth/posegeometry_msgs/msg/PoseStampedBest Effort。ENU位置・姿勢
Publish/ksp_vessel/ground_truth/nearby_vesselspylon_interfaces/msg/NearbyVessels自機と近隣機体の同時刻・同原点の絶対位置と速度。最大32機、2500 m以内、同天体・loaded/unpacked
Publish/ksp_vessel/ground_truth/twistgeometry_msgs/msg/TwistStampedBest Effort。ENU速度
Publish/ksp_vessel/ground_truth/twist_bodygeometry_msgs/msg/TwistStampedBest Effort。body速度
Publish/ksp_vessel/ground_truth/frame_angular_velocitygeometry_msgs/msg/Vector3Stamped惑星固定ENU軸の慣性系に対する回転角速度。評価器が慣性推定と比較するための情報
Publish/ksp_vessel/ground_truth/accelerationgeometry_msgs/msg/AccelStampedBest Effort。ENU加速度
Publish/ksp_vessel/joint_statessensor_msgs/msg/JointState全ROSサーボの状態
Publish/ksp_vessel/robot_descriptionstd_msgs/msg/StringReliable / Transient Local。プロキシURDF
Publish/ksp_vessel/root_framestd_msgs/msg/StringReliable / Transient Local。RViz Fixed Frame名
Publish/tftf2_msgs/msg/TFMessageGround TruthとCoM基準proxy rootのdynamic TF
Publish/tf_statictf2_msgs/msg/TFMessageproxy固定jointとsensor mount

Ground TruthのENU軸は惑星固定です。真値の角速度もこの軸に対する値に揃え、KSP物理座標系の高度による切替に影響されません。IMUの慣性姿勢と比較する場合はframe_angular_velocityによる座標回転と速度の輸送項を評価側で加えます。デモの推定器・制御器はこのTopicを購読しません。

センサー ​

方向Topic型
Publish/ksp_vessel/lidar_2d/<lidar_2d_id>/scansensor_msgs/msg/LaserScan
Publish/ksp_vessel/lidar_3d/<lidar_3d_id>/pointssensor_msgs/msg/PointCloud2
Publish/ksp_vessel/camera/<camera_id>/image_rawsensor_msgs/msg/Image
Publish/ksp_vessel/camera/<camera_id>/camera_infosensor_msgs/msg/CameraInfo
Publish/ksp_vessel/docking_ports/<id>/camera/image_rawsensor_msgs/msg/Image
Publish/ksp_vessel/docking_ports/<id>/camera/camera_infosensor_msgs/msg/CameraInfo

LiDARとRGBカメラのIDはVAB/SPHのEdit ROS2 Sensor IDで設定します。新規パーツにはlidar_2d_...、lidar_3d_...、camera_...のIDが自動生成されます。センサーTopicは最初の完全なデータで作成され、inactive通知または--topic-timeout-secの無通信で削除されます。

型付きアクチュエータ ​

個体ごとにTopicを作らず、種類ごとに1組のcommand / stateを共有します。すべてのcommandはidフィールドで対象を指定し、stateにも送信元のidが入ります。stateのnameは既存コード向けの同値エイリアスです。

対象Command TopicState Topic型
ROSサーボ/リニアモーター/ksp_vessel/actuators/servo/command/ksp_vessel/actuators/servo/statepylon_interfaces/msg/MotorCommand / pylon_interfaces/msg/MotorState
KSP標準ホイール/ksp_vessel/actuators/wheel/command/ksp_vessel/actuators/wheel/statepylon_interfaces/msg/WheelCommand / pylon_interfaces/msg/WheelState
Engine/ksp_vessel/actuators/propulsion/command/ksp_vessel/actuators/propulsion/statepylon_interfaces/msg/EngineCommand / pylon_interfaces/msg/EngineState
RCSモジュール/ksp_vessel/actuators/rcs/command/ksp_vessel/actuators/rcs/statepylon_interfaces/msg/RcsCommand / pylon_interfaces/msg/RcsState
デカプラー/フェアリング/ksp_vessel/actuators/separation/command/ksp_vessel/actuators/separation/statepylon_interfaces/msg/SeparationCommand / pylon_interfaces/msg/SeparationState

操作とTopicは常にactive_vesselが対象です。正式commandはPyLoNが操作権を持っている間に実行され、vessel_id / controller_id / lease_id / sequenceは省略時にbridgeが補完します。操作権はSTATE_PLAYER / STATE_PYLONの二択で、緊急停止は独立フラグです。commandはReliable / Volatile / depth 10です。通常のstateはBest Effort / Volatile / depth 10、分離stateはReliable / Transient Local / depth 10です。

分離結果は/ksp_vessel/actuators/separation/result (pylon_interfaces/msg/SeparationResult, Reliable / Transient Local)。再照会サービスは/ksp_vessel/actuators/separation/get_result (pylon_interfaces/srv/GetSeparationResult)です。保持期間・identity・snapshotの扱いは機体制御APIを参照してください。

ドッキングポート ​

方向Topic型
Publish/ksp_vessel/docking_ports/<id>/statepylon_interfaces/msg/DockingPortState
Subscribe/ksp_vessel/docking_ports/<id>/commandpylon_interfaces/msg/DockingPortCommand

<id>の既定値はdocking_port_<persistentId>_<moduleIndex>です。commandはSELECT_CAMERA、STOP_CAMERA、RELEASEを提供します。

主な起動引数 ​

対象引数既定値
機体センサー--topic-prefix/ksp_vessel
bridge状態--bridge-prefix/pylon
診断--diagnostics-topic/pylon/diagnostics
Wrench command--body-wrench-command-topic/ksp_vessel/control/wrench_command
Authority command--control-authority-command-topic/ksp_vessel/control/authority/command
Authority state--control-authority-state-topic/ksp_vessel/control/authority/state
Wrench feedback--wrench-feedback-topic/ksp_vessel/control/wrench_feedback
Vessel lifecycle--vessel-lifecycle-topic/ksp_vessel/lifecycle
Ground Truth--ground-truth-prefix/ksp_vessel/ground_truth
アクチュエータ--actuators-prefix/ksp_vessel/actuators
ドッキングポート--docking-ports-prefix/ksp_vessel/docking_ports
joint state--joint-states-topic/ksp_vessel/joint_states
URDF--robot-description-topic/ksp_vessel/robot_description
root frame--root-frame-topic/ksp_vessel/root_frame

全オプションはros2 run pylon_bridge udp_bridge --helpで確認できます。

PyLoNを使ったROS2アプリケーション開発のためのガイドとAPIリファレンス